0

After an embarrassing session trying to replace a disk in my ZFS pool, I have a bunch of entries representing disks that are no longer present in the system:

NAME                        STATE     READ WRITE CKSUM
  data                        DEGRADED     0     0     0
    mirror-0                  DEGRADED  141K     0     0
      replacing-0             UNAVAIL      0     0     0  insufficient replicas
        15005414211141553750  UNAVAIL      0     0     0  was /dev/sdb2
        3582694243925899896   UNAVAIL      0     0     0  was /dev/disk/by-path/pci-0000:00:1f.2-ata-3-part1
      sda                     ONLINE       0     0  141K
    mirror-1                  ONLINE       0     0     0
      sdc                     ONLINE       0     0     0
      sdd                     ONLINE       0     0     0

How can I get rid of the disks listed as replacing-0? Once this is cleared I should be able to correctly add the new disk to the system and run the replace command to resilver.

A zpool replace fails:

user@server:~$ sudo zpool replace data 3582694243925899896 /dev/disk/by-id/ata-ST16000NM001G-2KK103_ZL2KGLN4
cannot replace 3582694243925899896 with /dev/disk/by-id/ata-ST16000NM001G-2KK103_ZL2KGLN4: /dev/disk/by-id/ata-ST16000NM001G-2KK103_ZL2KGLN4 is busy, or device removal is in progress

A zpool detach also fails:

user@server:~$ sudo zpool detach data 3582694243925899896
cannot detach 3582694243925899896: no valid replicas

1 Answers1

0

You're mixing terms, and this could lead to the pool corruption/destruction. So you have a spen comprising two mirrors, and one mirror is degraded because the disk died.

  • you should replace the failed drive if first mirror. Actually, both of them, the original drive that died and the replaced drive that for some reason is also missing (died ? weird). This can be done with one step.
  • you could detach the failed drive from mirror (but I don't see why you should)
  • you don't add the drive to the pool, you attach it to the mirror in case you detached one disk form first span mirror block.
drookie
  • 8,625
  • 1
  • 19
  • 29
  • I've updated the original question around `replace` & `detach` as that gives me errors. I tried the add command but I couldn't get the right syntax, do you have an example of how that should work? – Danny Roberts Jan 28 '22 at 14:15