ZFS-zpool replace 永远无法完成

ZFS-zpool replace 永远无法完成

我在 ubuntu 14.04.1 服务器上有一个 5 x 3TB raidz1 阵列。上个月,其中一个驱动器坏了(发出咔嗒声)。我能够用 替换该驱动器zpool replace RAID <dead drive> <new drive>。这没有问题,池又恢复了在线和健康。然后另一个驱动器坏了。我尝试了同样的事情,但池卡在以下状态

# zpool status
  pool: RAID
 state: DEGRADED
status: One or more devices has experienced an error resulting in data
        corruption.  Applications may be affected.
action: Restore the file in question if possible.  Otherwise restore the
        entire pool from backup.
   see: http://zfsonlinux.org/msg/ZFS-8000-8A
  scan: resilvered 29.1G in 6h3m with 1028 errors on Mon Jan  5 05:35:35 2015
config:

NAME                                   STATE     READ WRITE CKSUM
RAID                                   DEGRADED     0     0 1.00K
  raidz1-0                             DEGRADED     0     0 2.01K
    ata-ST3000DM001-9YN166_Z1F15FAV    ONLINE       0     0     0
    ata-ST3000DM001-9YN166_Z1F15FCJ    ONLINE       0     0     0
    replacing-2                        DEGRADED     0     0     4
      17164957131155215254             UNAVAIL      0     0     0  was /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F15TBH-part1
      ata-ST3000DM001-1ER166_W500JFME  ONLINE       0     0     0
    ata-ST3000DM001-1ER166_Z500765Z    ONLINE       0     0     3
    ata-ST3000DM001-1CH166_W1F1M2C6    ONLINE       0     0     0

errors: 1028 data errors, use '-v' for a list

好消息是数据不是必需的。我并不担心错误(文件是视频,仍然可以正常播放)。我已尝试采取以下措施来解决这个问题,正如其他问题和论坛所建议的那样。

# zpool offline RAID ata-ST3000DM001-9YN166_Z1F15TBH
cannot offline ata-ST3000DM001-9YN166_Z1F15TBH: no valid replicas

# zpool offline RAID 17164957131155215254
cannot offline 17164957131155215254: no valid replicas

# zpool detach RAID ata-ST3000DM001-9YN166_Z1F15TBH
cannot detach ata-ST3000DM001-9YN166_Z1F15TBH: no valid replicas

# zpool detach RAID 17164957131155215254
cannot detach 17164957131155215254: no valid replicas

我还运行了触发重新zpool clear RAID同步zpool scrub但池仍处于与上述相同的状态的命令。然后我尝试移除新磁盘,但奇怪的是,出现了相同的无有效副本错误。

# zpool offline RAID ata-ST3000DM001-1ER166_W500JFME
cannot offline ata-ST3000DM001-1ER166_W500JFME: no valid replicas

我不知道该怎么做。看起来替换成功了,但是 zfs 不会放弃原始磁盘。

# dkms status -v
spl, 0.6.3, 3.13.0-43-generic, x86_64: installed
zfs, 0.6.3, 3.13.0-43-generic, x86_64: installed

更新:我删除了 zpool 缓存/etc/zfs/zpool.cache并重新启动。再次重新镀银,将报告结果。

更新 2:仍处于与上述相同的状态。如果没有办法完成替换,有没有办法重建池而不丢失任何数据?

更新 3:以下是最新状态:

# zpool status
  pool: RAID
 state: DEGRADED
status: One or more devices has experienced an error resulting in data
        corruption.  Applications may be affected.
action: Restore the file in question if possible.  Otherwise restore the
        entire pool from backup.
   see: http://zfsonlinux.org/msg/ZFS-8000-8A
  scan: resilvered 29.1G in 6h1m with 1028 errors on Wed Jan  7 03:49:13 2015
config:

    NAME                                   STATE     READ WRITE CKSUM
    RAID                                   DEGRADED     0     0 1.00K
      raidz1-0                             DEGRADED     0     0 2.01K
        ata-ST3000DM001-9YN166_Z1F15FAV    ONLINE       0     0     0
        ata-ST3000DM001-9YN166_Z1F15FCJ    ONLINE       0     0     1
        replacing-2                        DEGRADED     0     0     0
          17164957131155215254             UNAVAIL      0     0     0  was /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F15TBH-part1
          ata-ST3000DM001-1ER166_W500JFME  ONLINE       0     0     0
        ata-ST3000DM001-1ER166_Z500765Z    ONLINE       0     0     0
        ata-ST3000DM001-1CH166_W1F1M2C6    ONLINE       0     0     0

errors: 1028 data errors, use '-v' for a list

所有 5 个驱动器的 smartctl 数据是这里

答案1

请尝试

zpool 脱机 zpool 分离

例如第一篇文章 zpool offline RAID 17164957131155215254 zpool detach RAID 17164957131155215254

答案2

我也有同样的状况:

   NAME                                              STATE     READ WRITE CKSUM
    RAIDZ0_01                                         DEGRADED     0     0     0
      raidz1-0                                        DEGRADED     0     0     0
        gptid/4fb5f83e-91b1-11e2-923c-000c292ee274    ONLINE       0     0     0
        gptid/50402028-91b1-11e2-923c-000c292ee274    ONLINE       0     0     0
        replacing-2                                   DEGRADED     0     0     0
          2345526077585836973                         UNAVAIL      0     0     0
 was /dev/gptid/72973ce8-f3bf-11e2-9759-000c292ee274
          gptid/19062bb3-c67f-11e4-8683-000c292ee274  ONLINE       0     0     0
        gptid/d69abb6b-3cd2-11e4-873f-000c292ee274    ONLINE       0     0     0
        gptid/51e62469-91b1-11e2-923c-000c292ee274    ONLINE       0     0     0
        gptid/528221a4-91b1-11e2-923c-000c292ee274    ONLINE       0     0     0
        gptid/53288697-91b1-11e2-923c-000c292ee274    ONLINE       0     0    36
        gptid/c8d9e708-cc4a-11e3-99b3-000c292ee274    ONLINE       0     0     0
    logs
      gptid/ade4947f-e365-11e3-8230-000c292ee274      ONLINE       0     0     0
    cache
      gptid/f0017430-e364-11e3-8230-000c292ee274      ONLINE       0     0     0

errors: 802342 data errors, use '-v' for a list

除了您尝试过的方法之外,我还更新了 Freenas,但都无济于事。然而,就我而言,我被迫移除旧驱动器并用新驱动器物理替换它。我决定大胆一点,通过 Web GUI“分离”驱动器。这立即将池的状态从“降级”更改为“在线”。

相关内容