New tool available: findbay
It’s still early days, but I got a wild hair today and began writing a new simple tool, findbay.
root@elden:~# zpool status | grep SHGP31
nvme-SHGP31-2000GM_ANA7N7[elided]
root@elden:~# findbay ANA7N7
/dev/nvme0n1
root@elden:~# pv < `findbay ANA7N7` > /dev/null
47.0GiB 0:00:08 [6.97GiB/s] [> ] 2% ETA 0:04:59
In the above snippet, we can see me demonstrating that NVME drives have absurdly long device labels, showing you a chunk of one of mine, and then running findbay against a small chunk of that device label (usually, I’d recommend using the last four or five characters, because those are the most likely to be unique).
Run by itself, findoid [string] will either return the bare devicename (eg /dev/sda) associated with any entry in /dev/disk/by-id, or will complain and error if there’s either no result or multiple results (the latter meaning the string you chose was not even locally unique, eg using SEA when you have more than one Seagate drive).
But you can also chain it into a pv (or even cat) command, as shown directly after that, which will not only return the raw devicename but also light up the associated LED.
Future versions of the tool will support blipping the drive with reads DIRECTLY, and include an option to specify a pattern (for obnoxious bays that don’t show much difference between full saturation and light activity). But I think this is already pretty useful in the meantime.
You can find findbay in MASTER of the Sanoid project Github right now; it should make its way out to distributions with our next full release.
1 post - 1 participant
Read full topic
#zfs