0

There is a single-disk ZFS pool. Now I want to add another ssd to the pool and create a mirror. zpool

  pool: datapool
 state: ONLINE
  scan: scrub repaired 0B in 00:00:03 with 0 errors on Sun Feb 13 00:24:04 2022
config:
    NAME                                            STATE     READ WRITE CKSUM
    datapool                                        ONLINE       0     0     0
      usb-WDC_WDS_100T2B0A-00SM50_98765432100C-0:0  ONLINE       0     0     0</pre>

When I look at the disks by-id

 ls -l /dev/disk/by-id
total 0
....
lrwxrwxrwx 1 root root  9 Mar  7 19:07 usb-WDC_WDS_100T2B0A-00SM50_98765432100C-0:0 -> ../../sdc
lrwxrwxrwx 1 root root 10 Feb 27 07:37 usb-WDC_WDS_100T2B0A-00SM50_98765432100C-0:0-part1 -> ../../sdd1
lrwxrwxrwx 1 root root 10 Feb 27 07:37 usb-WDC_WDS_100T2B0A-00SM50_98765432100C-0:0-part9 -> ../../sdd9
....

Note that /dev/sdc by id = /dev/sdd by id. I can't add a device to the pool this way

zpool attach datapool /dev/disk/by-id/old-drive-id  /dev/disk/by-id/your-new-drive-id
zpool attach datapool /dev/disk/by-id/usb-WDC_WDS_100T2B0A-00SM50_98765432100C-0:0  /dev/disk/by-id/usb-WDC_WDS_100T2B0A-00SM50_98765432100C-0:0

The sdc disk is not visible in uuid, partuuid. I only see him in by-path

lrwxrwxrwx 1 root root  9 Mar  7 21:46 pci-0000:00:15.0-usb-0:1:1.0-scsi-0:0:0:0 -> ../../sdc
lrwxrwxrwx 1 root root  9 Feb 27 07:37 pci-0000:00:15.0-usb-0:2:1.0-scsi-0:0:0:0 -> ../../sdd
lrwxrwxrwx 1 root root 10 Feb 27 07:37 pci-0000:00:15.0-usb-0:2:1.0-scsi-0:0:0:0-part1 -> ../../sdd1
lrwxrwxrwx 1 root root 10 Feb 27 07:37 pci-0000:00:15.0-usb-0:2:1.0-scsi-0:0:0:0-part9 -> ../../sdd9

Can I then add a device to the pool this way?

zpool attach datapool /dev/disk/by-path/pci-0000:00:15.0-usb-0:2:1.0-scsi-0:0:0:0  /dev/disk/by-path/pci-0000:00:15.0-usb-0:1:1.0-scsi-0:0:0:0
gusto
  • 1
  • Do not attach a drive with the same name, that will only lead to data loss and regret. Two different drives should never have the same name in /dev/disk/by-id because they should never have the same serial number, which is a component of that name (manufacturer + model + serial no). You should find out why the name is being generated incorrectly and fix it. – cas Mar 07 '22 at 23:38
  • Can't you just use sdc sdd? – frostschutz Mar 08 '22 at 00:10
  • 1
    It might be a problem with the USB enclosure(s). Those things are notoriously unreliable because they tend to change the drive parameters in weird ways. It looks like the enclosures might not be reporting the true drive serial number. What does smartctl -a /dev/sdX say about the drives, if anything? (eg. serial number and such) – CR. Mar 08 '22 at 02:30
  • Both SSDs are in this cover. When I look smartctl -a /dev/sdc and smartctl -a /dev/sdd The serial number is of course different. How to connect this SSD to the pool? – gusto Mar 08 '22 at 06:50
  • Maybe a udev problem? Take a look at this. Seems kind of weird, I'm not sure why the by-id links are not correct if the serial is reported. – CR. Mar 08 '22 at 16:13

0 Answers0