You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Turn LEDs on or off depending on their existence at the bottom of in block
device stacks. This works with pretty much any hierarchy (RAID, LVM, DM, etc)
because the kernel tracks block device stacking dependencies in
/sys/block/<dev>/slaves/* (which can be seen as a tree using the tool `lsblk`).
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
In the more complex stack shown below, /dev/bcache0 is backed by /dev/md125
and /dev/md126. Now encled can find the referenced devices at any point in the
stack:
] encled md125
0:0:18:0/Slot03 sdh fault_off locate_off
0:0:18:0/Slot02 sdc fault_off locate_off
] encled md126
0:0:18:0/Slot01 sdb fault_off locate_off
0:0:18:0/Slot00 sdi fault_off locate_off
] encled bcache0
0:0:18:0/Slot03 sdh fault_off locate_off
0:0:18:0/Slot01 sdb fault_off locate_off
0:0:18:0/Slot02 sdc fault_off locate_off
0:0:18:0/Slot00 sdi fault_off locate_off
Signed-off-by: Eric Wheeler <[email protected]>
0 commit comments