zpool export my_pool
Drawbacks of /dev/sdx way:The names are not persistent and will change depending on what order they disks are detected in. Adding or removing hardware for your system can easily cause the names to change. You would then need to remove the zpool.cache file and re-import the pool using the new names.
https://ubuntuforums.org/archive/index.php/t-2087726.html
https://wiki.archlinux.org/index.php/Persistent_block_device_naming#by-id_and_by-path
https://unix.stackexchange.com/questions/86764/understanding-dev-disk-by-folders
zpool import -d /dev/disk/by-id/ my_pool
Example of creating pool using by-path
zfs create tank raidz1 pci-0000:03:00.0-scsi-0:0:21:0 pci-0000:03:00.0-scsi-0:0:19:0 pci-0000:02:00.0-scsi-0:0:9:0 pci-0000:02:00.0-scsi-0:0:11:0 pci-0000:03:00.0-scsi-0:0:22:0 pci-0000:03:00.0-scsi-0:0:18:0
ls -l /dev/disk/by-path/
total 0
lrwxrwxrwx 1 root root 9 Mar 23 14:01 pci-0000:00:07.1-ata-2 -> ../../sr0
lrwxrwxrwx 1 root root 9 Mar 23 14:01 pci-0000:00:10.0-scsi-0:0:0:0 -> ../../sda
lrwxrwxrwx 1 root root 10 Mar 23 14:01 pci-0000:00:10.0-scsi-0:0:0:0-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Mar 23 14:01 pci-0000:00:10.0-scsi-0:0:0:0-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Mar 23 14:01 pci-0000:00:10.0-scsi-0:0:0:0-part3 -> ../../sda3
lrwxrwxrwx 1 root root 10 Mar 23 14:01 pci-0000:00:10.0-scsi-0:0:0:0-part4 -> ../../sda4
lrwxrwxrwx 1 root root 10 Mar 23 14:01 pci-0000:00:10.0-scsi-0:0:0:0-part5 -> ../../sda5
lrwxrwxrwx 1 root root 10 Mar 23 14:01 pci-0000:00:10.0-scsi-0:0:0:0-part9 -> ../../sda9
Drawbacks of /dev/sdx way:The names are not persistent and will change depending on what order they disks are detected in. Adding or removing hardware for your system can easily cause the names to change. You would then need to remove the zpool.cache file and re-import the pool using the new names.
https://wiki.archlinux.org/index.php/Persistent_block_device_naming#by-id_and_by-path
https://unix.stackexchange.com/questions/86764/understanding-dev-disk-by-folders
No comments:
Post a Comment