One super-easy way to identify disks on the fly is just to do a cat </dev/sdx >/dev/null
and see which disk activity light stays on.
What I do is figure out which names in /dev/disk/by-path
correspond to which disks. The by-path names are stable, even if you replace the disks (as long as the cabling doesn't change). Then I set up aliases in /etc/zfs/vdev_id.conf
to give the disks names that correspond to the external labels on the enclosure.
For example, disk /dev/disk/by-path/pci-0000:06:08.0-sas-0x5842b2b2167fc188-lun-0
might be the disk in slot zero in the array I've designated as "array0". So /etc/zfs/vdev_id.conf
would have:
alias array0-0 pci-0000:06:08.0-sas-0x5842b2b2167fc188-lun-0
Then I create the pool with the /dev/disk/by-vdev
names so I can tell immediately what each disk is. (If you've already created the pool, you can export it and then use zpool import -d /dev/disk/by-vdev
to switch to the vdev names.)
In theory, you can use some other settings in /etc/zfs/vdev_id.conf
to get the system to enumerate the disks itself, rather than working out the aliases by hand. In my case, my enclosures don't have stable numbering that the automatic settings can work with.