我在raidz配置中有一个带有4 2TB USB磁盘的zpool:
[root@chef /mnt/Chef]# zpool status farcryz1
pool: farcryz1
state: ONLINE
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
farcryz1 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
da1 ONLINE 0 0 0
da2 ONLINE 0 0 0
da3 ONLINE 0 0 0
da4 ONLINE 0 0 0为了测试这个池,我模拟了一个驱动器故障,从其中一个驱动器中拔出USB电缆,而不让它脱机:
[root@chef /mnt/Chef]# zpool status farcryz1
pool: farcryz1
state: ONLINE
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
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
farcryz1 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
da4 ONLINE 22 4 0
da3 ONLINE 0 0 0
da1 ONLINE 0 0 0
da2 ONLINE 0 0 0
errors: No known data errors数据还在那里,池还在网上。太棒了!现在让我们尝试恢复池。我插入了驱动器,并按照上面的指示发出了zpool replace命令:
[root@chef /mnt/Chef]# zpool replace farcryz1 da4
invalid vdev specification
use '-f' to override the following errors:
/dev/da4 is part of active pool 'farcryz1'嗯..。这没什么用..。所以我尝试了一个zpool clear farcryz1,但这一点也没有帮助。我仍然无法取代da4。所以我尝试了onlineing,offlineing,clearing,replaceing和scrubing的组合。现在我被困在这里:
[root@chef /mnt/Chef]# zpool status -v farcryz1
pool: farcryz1
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://www.sun.com/msg/ZFS-8000-4J
scrub: scrub completed after 0h2m with 0 errors on Fri Sep 9 13:43:34 2011
config:
NAME STATE READ WRITE CKSUM
farcryz1 DEGRADED 0 0 0
raidz1 DEGRADED 0 0 0
da4 UNAVAIL 9 0 0 experienced I/O failures
da3 ONLINE 0 0 0
da1 ONLINE 0 0 0
da2 ONLINE 0 0 0
errors: No known data errors
[root@chef /mnt/Chef]# zpool replace farcryz1 da4
cannot replace da4 with da4: da4 is busy如何才能从这种情况中恢复过来呢?在这种情况下,我的zpool中的一个设备意外断开(但不是一个失败的设备),现在又回来了,准备重新镀银吗?
编辑:根据请求,tail of dmesg:
(ses3:umass-sim4:4:0:1): removing device entry
(da4:umass-sim4:4:0:0): removing device entry
ugen3.2: <Western Digital> at usbus3
umass4: <Western Digital My Book 1140, class 0/0, rev 3.00/10.03, addr 1> on usbus3
da4 at umass-sim4 bus 4 scbus6 target 0 lun 0
da4: <WD My Book 1140 1003> Fixed Direct Access SCSI-6 device
da4: 400.000MB/s transfers
da4: 1907697MB (3906963456 512 byte sectors: 255H 63S/T 243197C)
ses3 at umass-sim4 bus 4 scbus6 target 0 lun 1
ses3: <WD SES Device 1003> Fixed Enclosure Services SCSI-6 device
ses3: 400.000MB/s transfers
ses3: SCSI-3 SES Device
GEOM: da4: partition 1 does not start on a track boundary.
GEOM: da4: partition 1 does not end on a track boundary.
GEOM: da4: partition 1 does not start on a track boundary.
GEOM: da4: partition 1 does not end on a track boundary.
ugen3.2: <Western Digital> at usbus3 (disconnected)
umass4: at uhub3, port 1, addr 1 (disconnected)
(da4:umass-sim4:4:0:0): lost device
(da4:umass-sim4:4:0:0): removing device entry
(ses3:umass-sim4:4:0:1): lost device
(ses3:umass-sim4:4:0:1): removing device entry
ugen3.2: <Western Digital> at usbus3
umass4: <Western Digital My Book 1140, class 0/0, rev 3.00/10.03, addr 1> on usbus3
da4 at umass-sim4 bus 4 scbus6 target 0 lun 0
da4: <WD My Book 1140 1003> Fixed Direct Access SCSI-6 device
da4: 400.000MB/s transfers
da4: 1907697MB (3906963456 512 byte sectors: 255H 63S/T 243197C)
ses3 at umass-sim4 bus 4 scbus6 target 0 lun 1
ses3: <WD SES Device 1003> Fixed Enclosure Services SCSI-6 device
ses3: 400.000MB/s transfers
ses3: SCSI-3 SES Device发布于 2011-09-09 21:10:49
确定是否需要替换该设备,并使用“zpool”清除错误,或用“zpool替换”替换该设备。
看起来,在最初的临时故障之后,您可能只需要做一个zpool clear来清除错误。
如果您想假装它是一个驱动器替换,您可能需要先清除驱动器上的数据,然后再将它重新添加到池中。
发布于 2011-09-09 20:22:33
您尝试过的各种命令的输出是什么?你在其中任何一个上尝试过-f开关吗?
你运行zpool clear poolname device-name了吗?
在你的例子中,zpool clear farcryz1 da4
发布于 2015-12-15 15:37:13
如果zpool clear没有修复它,您可以让zfs忘记使用zpool labelclear <partition> (从zfs-v0.6.2开始在http://zfsonlinux.org中可用)的磁盘。
请注意,即使您使用整个设备(例如/dev/sda )创建了zpool,您也必须指定zfs创建的分区,例如/dev/sda1。
(学分归DeHackEd,https://github.com/zfsonlinux/zfs/issues/2076)
zpool labelclear [-f] device
Removes ZFS label information from the specified device. The device
must not be part of an active pool configuration.
-f Treat exported or foreign devices as inactive.https://serverfault.com/questions/309859
复制相似问题