Added md-raid support
Turn LEDs on or off depending on their RAID membership
For example:
] grep md9 /proc/mdstat
md9 : active raid5 sdg[0] sde[6] sdj[4] sdk[3] sdf[2] sdl[1]
] encled md9
0:0:18:0/Slot11 sde fault_off locate_off
0:0:18:0/Slot08 sdf fault_off locate_off
0:0:18:0/Slot06 sdg fault_off locate_off
0:0:18:0/Slot10 sdj fault_off locate_off
0:0:18:0/Slot09 sdk fault_off locate_off
0:0:18:0/Slot07 sdl fault_off locate_off
] encled md9 locate
] encled md9
0:0:18:0/Slot11 sde fault_off LOCATE_ON
0:0:18:0/Slot08 sdf fault_off LOCATE_ON
0:0:18:0/Slot06 sdg fault_off LOCATE_ON
0:0:18:0/Slot10 sdj fault_off LOCATE_ON
0:0:18:0/Slot09 sdk fault_off LOCATE_ON
0:0:18:0/Slot07 sdl fault_off LOCATE_ON
@amarao, are you open to importing re ?
I could make this PR a bit more robust and readable if re is acceptable.
Let me know...
Improvements are welcome, but, please, do not break existing scenarios.
And re is in standard, so, yep, it's fine as long as it readable
We cleaned up the commit, and now it will recurse arbitrary block device stacking hierarchies, such as RAID, LVM, etc. Please see the commit message and the diff for details. I believe that everything is compatible in the same way, now with an additional feature.
The second commit is a minor change that default sorting output by enclosure and slot.
Let me know if you have any questions or comments, and thank you for maintaining this!
-Eric