备用磁盘替换完成后,如何从 ZFS 池中移除故障磁盘

备用磁盘替换完成后,如何从 ZFS 池中移除故障磁盘

我有一个当前状态的 ZFS 池:

[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

如您所见,我已通过命令添加了备用磁盘“ata-HGST_HUH728080ALE604_2EGWD3WX”,zpool replace zdata /dev/disk/by-id/ata-HGST_HUH728080ALE604_2EGWHSGX /dev/disk/by-id/ata-HGST_HUH728080ALE604_2EGWD3WX该命令现已创建了一个spare-1包含两个磁盘的设备(希望备用驱动2EGWD3WX器能够替换损坏的驱动器2EGWHSGX。)

我现在该如何移除坏掉的驱动器ata-HGST_HUH728080ALE604_2EGWHSGX

答案1

要用热备件替换故障磁盘,您zpool replace根本不需要这样做(事实上,这可能会给您以后带来各种麻烦;我从来没有这样做过)。相反,您只需更换zpool detach故障磁盘,热备件就会自动替换它。

相关内容