procfs
procfs copied to clipboard
Support parse raid type for mdstat
For something like
md6 : active raid1 sdb2[2](F) sdc[1](S) sda2[0]
md11 : active (auto-read-only) raid1 sdb2[0] sdc2[1] sdc3[2](F) hda[4](S) ssdc2[3](S)
We can also get the raid type from /proc/mdstat
This needs a DCO sign-off. You can use git commit -s --amend to add it.
@SuperQ Sorry that I forgot the sign-off in later commits😂. And now it's added.
@SuperQ There's a case that I cannot check (...) only
md219 : inactive sdb[2](S) sdc[1](S) sda[0](S)
If we only check parentheses, the type will be sdb[2](S)
But maybe we can assume the type does not contain any special characters?
@SuperQ I changed the code for type checking. It passes all current tests, and I hope it can work forever.
@SuperQ I considered this before. But there is another case...
md4 : inactive raid1 sda3[0](F) sdb3[1](S)
4883648 blocks [2/2] [UU]
We can ignore the type for this, but it's here anyway and it may be useful in some case.
Ahh, crap, yea, that's a problem.
@SuperQ @discordianfish Because of the lack of some knowledge, let's keep this open and see if anyone can help.