It is important to know a position of a bad drive in a multi-bay device, however default naming of drives e.g /dev/sda
, /dev/sdb
etc. does not provide a clue where a particular drive is residing physically.
I have an 8-bay external JBOD enclosure used for backup. It hosts a ZFS pool and is connected to an Arch Linux box. Is it possible on a Linux system which uses systemd
/udev
to name drives according to their physical location in the enclosure instead of /dev/sd*
?
I would like the names to reflect the physical position of a drive in the enclosure /dev/encl1
, /dev/encl2
... or similar. I would prefer these labels to appear by default instead of /dev/sd*
in lsblk
and zpool status
.
I do know location of every drive in the enclosure, and keep this
information in a file, but it would be way better to see it with
lsblk
and other commands directly.
I tried to create rules at /etc/udev/rules.d
like
SUBSYSTEM=="block" KERNEL=="sd*" ENV{ID_SERIAL_SHORT}=="ZR5CTR4V" SYMLINK+="encl1"
And I do get such symlinks after running udevadm trigger
, but they are not equivalent to /dev/sd*
and I was not able to use them as a substitution.
/dev/sd*
. Take a look at/dev/disk/by-id/
and the other directories under/dev/disk
.by-path
?by-path
still does not allow to tell that this particular drive is for example located 2nd from the top in the enclosurelshw -c disk -c storage | grep -E 'bus info|logical name
to give you a hint on the disk bays? I expect that the bus info will be incrementing uniformly following the bay numbers.