sdled icon indicating copy to clipboard operation
sdled copied to clipboard

Added md-raid support

Open KJ7LNW opened this issue 3 years ago • 4 comments

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

KJ7LNW avatar Mar 22 '23 20:03 KJ7LNW

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

KJ7LNW avatar Mar 22 '23 20:03 KJ7LNW

Improvements are welcome, but, please, do not break existing scenarios.

amarao avatar Mar 22 '23 21:03 amarao

And re is in standard, so, yep, it's fine as long as it readable

amarao avatar Mar 22 '23 21:03 amarao

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

KJ7LNW avatar Mar 25 '23 02:03 KJ7LNW