procfs icon indicating copy to clipboard operation
procfs copied to clipboard

Support parse raid type for mdstat

Open ImSingee opened this issue 2 years ago • 11 comments

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

ImSingee avatar Apr 13 '23 08:04 ImSingee

This needs a DCO sign-off. You can use git commit -s --amend to add it.

SuperQ avatar Apr 13 '23 09:04 SuperQ

@SuperQ Sorry that I forgot the sign-off in later commits😂. And now it's added.

ImSingee avatar Apr 13 '23 09:04 ImSingee

@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?

ImSingee avatar Apr 13 '23 09:04 ImSingee

@SuperQ I changed the code for type checking. It passes all current tests, and I hope it can work forever.

ImSingee avatar Apr 13 '23 09:04 ImSingee

@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.

ImSingee avatar Apr 13 '23 10:04 ImSingee

Ahh, crap, yea, that's a problem.

SuperQ avatar Apr 13 '23 10:04 SuperQ

@SuperQ @discordianfish Because of the lack of some knowledge, let's keep this open and see if anyone can help.

ImSingee avatar Apr 27 '23 05:04 ImSingee