Search code examples
freebsdnaszfs

zpool replace leaves pool degraded


been having issues with my FreeNAS 9.10 ZFS pool.

One of the drives was being warned as having many bad sectors so I decided to replace it. Had tremendous problems getting 'zpool replace' to recognise the new drive (it was in ada3, but it wouldn't accept that as parameter). Only thing I could figure out was to add the new drive as a 'spare' to the zpool and then use zpool replace [poolname] [old device id] [spare device id]

This worked and resilvered the new drive. However, once the resilver completed the pool remains in degraded state and seems to want the old drive back.

How do I convince it to 'forget' the old drive and accept the new one permanently??

many thanks

  pool: ZFS_NAS
state: DEGRADED
status: One or more devices could not be opened.  Sufficient replicas exist for
the pool to continue functioning in a degraded state.
action: Attach the missing device and online it using 'zpool online'.
  see: http://illumos.org/msg/ZFS-8000-2Q
scan: resilvered 989G in 4h42m with 0 errors on Mon May  2 19:45:33 2016
config:

NAME                                              STATE     READ WRITE CKSUM
ZFS_NAS                                           DEGRADED     0     0     0
  raidz1-0                                        DEGRADED     0     0     0
    spare-0                                       DEGRADED     0     0     0
      12082773611957310038                        UNAVAIL      0     0     0  was /dev/gptid/1418d56c-431b-11e4-b9f7-28924a2f106f
      gptid/503d6d1c-106e-11e6-a169-28924a2f106f  ONLINE       0     0     0
    gptid/1608e28a-431b-11e4-b9f7-28924a2f106f    ONLINE       0     0     0
    gptid/1699dab6-431b-11e4-b9f7-28924a2f106f    ONLINE       0     0     0
spares
  16673430511205791764                            INUSE     was /dev/gptid/503d6d1c-106e-11e6-a169-28924a2f106f

errors: No known data errors

Solution

  • You have to remove the failed drive:

    zpool detach ZFS_NAS gptid/1418d56c-431b-11e4-b9f7-28924a2f106f
    

    or

    zpool detach ZFS_NAS 12082773611957310038
    

    Then the spare drive (gptid/503d6d1c-106e-11e6-a169-28924a2f106f) becomes a ONLINE member of ZFS_NAS pool.

    Now you can add a new spare to the pool

    Refs.