0

I have a ZFS pool in the current state:

[root@zfs01 ~]# zpool status
  pool: zdata
 state: DEGRADED
status: One or more devices could not be used because the label is missing or
        invalid.  Sufficient replicas exist for the pool to continue
        functioning in a degraded state.
action: Replace the device using 'zpool replace'.
   see: http://zfsonlinux.org/msg/ZFS-8000-4J
  scan: scrub repaired 0 in 186h53m with 0 errors on Sun Jan 27 20:53:44 2019
config:

        NAME                                                  STATE     READ WRITE CKSUM
        zdata                                                 DEGRADED     0     0     0
          raidz3-0                                            DEGRADED     0     0     0
            ata-HGST_HUH728080ALE604_2EGWK97X                 ONLINE       0     0     0
            spare-1                                           DEGRADED     0     0     2
              ata-HGST_HUH728080ALE604_2EGWHSGX               UNAVAIL      0     0     0
              ata-HGST_HUH728080ALE604_2EGWD3WX               ONLINE       0     0     0
            ata-HGST_HUH728080ALE604_2EGGVUTX                 ONLINE       0     0     0
            ata-HGST_HUH728080ALE604_2EHG14TX                 ONLINE       0     0     0
            ata-HGST_HUH728080ALE604_2EGWW4XX                 ONLINE       0     0     0
            ata-HGST_HUH728080ALE604_2EGW5A5X                 ONLINE       0     0     0
            ata-HGST_HUH728080ALE604_2EGWTPYX                 ONLINE       0     0     0
            ata-HGST_HUH728080ALE604_2EGWALNX                 ONLINE       0     0     0
            ata-HGST_HUH728080ALE604_2EGWNN1X                 ONLINE       0     0     0
            ata-HGST_HUH728080ALE604_2EGWG0BX                 ONLINE       0     0     0
            ata-HGST_HUH728080ALE604_2EGWWTGX                 ONLINE       0     0     0
        logs
          mirror-1                                            ONLINE       0     0     0
            ata-INTEL_SSDSC2BA100G3_BTTV5435005Y100FGN-part1  ONLINE       0     0     0
            ata-INTEL_SSDSC2BA100G3_BTTV54350016100FGN-part1  ONLINE       0     0     0
        cache
          ata-INTEL_SSDSC2BA100G3_BTTV5435005Y100FGN-part2    ONLINE       0     0     0
          ata-INTEL_SSDSC2BA100G3_BTTV54350016100FGN-part2    ONLINE       0     0     0
        spares
          ata-HGST_HUH728080ALE604_2EGWD3WX                   INUSE     currently in use

errors: No known data errors

As you can see, I have added the spare disk "ata-HGST_HUH728080ALE604_2EGWD3WX" via the command zpool replace zdata /dev/disk/by-id/ata-HGST_HUH728080ALE604_2EGWHSGX /dev/disk/by-id/ata-HGST_HUH728080ALE604_2EGWD3WX which has now created a spare-1 device with boths disks in it (was expecting the spare 2EGWD3WX drive to replace the dead 2EGWHSGX one.)

How do I remove the dead drive ata-HGST_HUH728080ALE604_2EGWHSGX now?

1

To replace a failed disk with a hot spare, you do not need to zpool replace at all (and in fact this might cause you all sorts of grief later; I've never done this). Instead you are supposed to simply zpool detach the failed disk and the hot spare automatically replaces it.

  • Good to know for the next time... (but doesn't really answer my question) – Will Dennis Feb 2 '19 at 20:09
  • So what happened when you did it? – Michael Hampton Feb 2 '19 at 20:47
  • As you can see above, it made a "spare-1" device containing both the old failed and spare disks. The spare resilvered, and has "taken the place" of the old failed disk, except that now I need to remove the old failed disk from the pool. I'm just needing the correct command to do that. – Will Dennis Feb 2 '19 at 20:55
  • I already gave you the command to do that! – Michael Hampton Feb 2 '19 at 20:55
  • Sorry, that wasn't clear to me... So zpool detach zdata /dev/disk/by-id/ata-HGST_HUH728080ALE604_2EGWHSGX then? – Will Dennis Feb 2 '19 at 21:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.