Fix ZFS DEGRADED pool that had hot spare

I have a pool of 8-mirrored drives and one hot spare. One of the drives in a mirrored set failed, but I can't tell if the hot-spare was automatically added or not. The status of the spare is "IN USE", and the scan says it resilvered 1.7T. The mirror-0 still shows DEGRADED however. Is the mirror-0 100% up and I just need to clear the status with "zpool clear primary_vol"? Or do I need to issue a "zpool replace c0t12d1 c0t21d1"

zpool status
pool: primary_vol
state: DEGRADED
status: One or more devices has experienced an unrecoverable error.  An
        attempt was made to correct the error.  Applications are unaffected.
action: Determine if the device needs to be replaced, and clear the errors
        using 'zpool clear' or replace the device with 'zpool replace'.
   see: http://www.sun.com/msg/ZFS-8000-9P
scan: resilvered 1.70T in 11h17m with 0 errors on Sun Feb 12 10:17:39 2017
config:

    NAME           STATE     READ WRITE CKSUM
    primary_vol    DEGRADED     0     0     0
      mirror-0     DEGRADED     0     0     0
        spare-0    DEGRADED     0     0   184
          c0t12d1  DEGRADED     0     0   199  too many errors
          c0t21d1  ONLINE       0     0   207
        c0t13d1    ONLINE       0     0     0
      mirror-1     ONLINE       0     0     0
        c0t15d1    ONLINE       0     0     0
        c0t18d1    ONLINE       0     0     0
      mirror-2     ONLINE       0     0     0
        c0t19d1    ONLINE       0     0     0
        c0t20d1    ONLINE       0     0     0
      mirror-3     ONLINE       0     0     0
        c0t22d1    ONLINE       0     0     0
        c0t24d1    ONLINE       0     0     0
    logs
      c0t16d1      ONLINE       0     0     0
    spares
      c0t21d1      INUSE     currently in use

errors: No known data errors

pool: syspool
state: ONLINE
scan: scrub repaired 0 in 0h2m with 0 errors on Sun Feb 12 03:05:10 2017
config:

    NAME           STATE     READ WRITE CKSUM
    syspool        ONLINE       0     0     0
      mirror-0     ONLINE       0     0     0
        c0t14d1s0  ONLINE       0     0     0
        c0t17d1s0  ONLINE       0     0     0

errors: No known data errors

Solution 1:

I've got similar issue here. Try this:

 zpool detach syspool c0t12d1  

It will kick out the faulted disk, then your pool will be ONLINE again.

Solution 2:

  • The drive failed.
  • The spare took over.
  • You can replace the failed disk and the rebuild may depend on your pool autoreplace settings.

Some details like the OS, distribution and hardware involved may help with a more specific answer.

Once a rebuild is done, the spare would go back to spare duties.