我正在使用本机ZFS运行UbuntuServer13.04 64位。我有一个由4个硬盘驱动器组成的zpool,其中一个昨天就死了,现在操作系统和BIOS不再认可我了。
不幸的是,在下一次重新启动之后,我才看到了这个问题,所以现在驱动器标签丢失了,我无法使用官方指令这里和这里替换磁盘。
zpool status hermes -x版画
root@zeus:~# zpool status hermes -x
pool: hermes
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 2h4m with 0 errors on Sun Jun 9 00:28:24 2013
config:
NAME STATE READ WRITE CKSUM
hermes DEGRADED 0 0 0
raidz1-0 DEGRADED 0 0 0
ata-ST3300620A_5QF0MJFP ONLINE 0 0 0
ata-ST3300831A_5NF0552X UNAVAIL 0 0 0
ata-ST3200822A_5LJ1CHMS ONLINE 0 0 0
ata-ST3200822A_3LJ0189C ONLINE 0 0 0
errors: No known data errors我已经用一个新的驱动器替换了这个驱动器(它的标签是/dev/disk/by-id/ata-ST3500320AS_9QM03ATQ)
任何一条命令
zpool replace hermes /dev/disk/by-id/ata-ST3300831A_5NF0552X /dev/disk/by-id/ata-ST3500320AS_9QM03ATQ
zpool offline hermes /dev/disk/by-id/ata-ST3300831A_5NF0552X
zpool detatch hermes /dev/disk/by-id/ata-ST3300831A_5NF0552X失败与
root@zeus:~# zpool offline hermes /dev/disk/by-id/ata-ST3300831A_5NF0552X
cannot offline /dev/disk/by-id/ata-ST3300831A_5NF0552X: no such device in pool因为死了的驱动器的标签不再存在于系统中,我还尝试了上面的命令,忽略驱动器标签的路径,但没有效果。
我如何替换“鬼”磁盘?
发布于 2013-06-09 09:41:08
经过今晚没完没了的挖掘,我终于找到了解决办法。简单地说,您可以使用zpool命令使用磁盘的GUID(即使在断开驱动器之后仍然存在)。
长答案:我使用zdb命令获得磁盘的GUID,该命令为我提供了以下输出
root@zeus:/dev# zdb
hermes:
version: 28
name: 'hermes'
state: 0
txg: 162804
pool_guid: 14829240649900366534
hostname: 'zeus'
vdev_children: 1
vdev_tree:
type: 'root'
id: 0
guid: 14829240649900366534
children[0]:
type: 'raidz'
id: 0
guid: 5355850150368902284
nparity: 1
metaslab_array: 31
metaslab_shift: 32
ashift: 9
asize: 791588896768
is_log: 0
create_txg: 4
children[0]:
type: 'disk'
id: 0
guid: 11426107064765252810
path: '/dev/disk/by-id/ata-ST3300620A_5QF0MJFP-part2'
phys_path: '/dev/gptid/73b31683-537f-11e2-bad7-50465d4eb8b0'
whole_disk: 1
create_txg: 4
children[1]:
type: 'disk'
id: 1
guid: 15935140517898495532
path: '/dev/disk/by-id/ata-ST3300831A_5NF0552X-part2'
phys_path: '/dev/gptid/746c949a-537f-11e2-bad7-50465d4eb8b0'
whole_disk: 1
create_txg: 4
children[2]:
type: 'disk'
id: 2
guid: 7183706725091321492
path: '/dev/disk/by-id/ata-ST3200822A_5LJ1CHMS-part2'
phys_path: '/dev/gptid/7541115a-537f-11e2-bad7-50465d4eb8b0'
whole_disk: 1
create_txg: 4
children[3]:
type: 'disk'
id: 3
guid: 17196042497722925662
path: '/dev/disk/by-id/ata-ST3200822A_3LJ0189C-part2'
phys_path: '/dev/gptid/760a94ee-537f-11e2-bad7-50465d4eb8b0'
whole_disk: 1
create_txg: 4
features_for_read:我正在寻找的GUID是15935140517898495532,它使我能够完成
root@zeus:/dev# zpool offline hermes 15935140517898495532
root@zeus:/dev# zpool status
pool: hermes
state: DEGRADED
status: One or more devices has been taken offline by the administrator.
Sufficient replicas exist for the pool to continue functioning in a
degraded state.
action: Online the device using 'zpool online' or replace the device with
'zpool replace'.
scan: scrub repaired 0 in 2h4m with 0 errors on Sun Jun 9 00:28:24 2013
config:
NAME STATE READ WRITE CKSUM
hermes DEGRADED 0 0 0
raidz1-0 DEGRADED 0 0 0
ata-ST3300620A_5QF0MJFP ONLINE 0 0 0
ata-ST3300831A_5NF0552X OFFLINE 0 0 0
ata-ST3200822A_5LJ1CHMS ONLINE 0 0 0
ata-ST3200822A_3LJ0189C ONLINE 0 0 0
errors: No known data errors然后
root@zeus:/dev# zpool replace hermes 15935140517898495532 /dev/disk/by-id/ata-ST3500320AS_9QM03ATQ
root@zeus:/dev# zpool status
pool: hermes
state: DEGRADED
status: One or more devices is currently being resilvered. The pool will
continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
scan: resilver in progress since Sun Jun 9 01:44:36 2013
408M scanned out of 419G at 20,4M/s, 5h50m to go
101M resilvered, 0,10% done
config:
NAME STATE READ WRITE CKSUM
hermes DEGRADED 0 0 0
raidz1-0 DEGRADED 0 0 0
ata-ST3300620A_5QF0MJFP ONLINE 0 0 0
replacing-1 OFFLINE 0 0 0
ata-ST3300831A_5NF0552X OFFLINE 0 0 0
ata-ST3500320AS_9QM03ATQ ONLINE 0 0 0 (resilvering)
ata-ST3200822A_5LJ1CHMS ONLINE 0 0 0
ata-ST3200822A_3LJ0189C ONLINE 0 0 0
errors: No known data errors收银工作完成后,一切又顺利了。最好包含这样的信息,您可以使用通过zdb通过zpool命令获得的磁盘GUID,以及zpool的命令页。
正如durval在下面指出的那样,zdb命令可能不会输出任何内容。然后你可以试着用
zdb -l /dev/<name-of-device>显式列出有关设备的信息(即使该设备已从系统中丢失)。
发布于 2013-06-09 09:41:39
问题是磁盘是由ids而不是设备引用的。
以下是一个应该有效的解决办法:
ln -s /dev/null /dev/ata-ST3300831A_5NF0552X
zpool export hermes
zpool import hermes
zpool status
# note the new device name that should appear here
zpool offline hermes xxxx
zpool replace hermes xxxx /dev/disk/by-id/ata-ST3500320AS_9QM03ATQ编辑:我迟到30秒.
发布于 2016-11-21 17:52:20
我也有过类似的问题:
驱动器失败的方式,它不再注册在BIOS (完全死)。zpool status表明它是UNAVAILABLE。
我安装了一个类似的容量驱动器,并设法将其分配为一个新的spare,即INUSE,并对驱动器进行了重新处理。但是,它实际上并不是zpool的一部分,而是存储了丢失的驱动器的记忆,认为它总有一天会再次出现。
解决方案是首先从zpool中删除丢失的驱动器:
[root@hactar ~]# zpool detach hactar_data /dev/gptid/87410b00-adb0-11e6-9193-00241d738094 然后,删除标记为spare-1 INUSE的驱动器:
[root@hactar ~]# zpool detach hactar_data /dev/gptid/f2089b59-2654-11e5-8d99-00241d738094一旦我这样做了,看起来FreeNAS不需要执行replace命令就能解决这个问题,但是如果您的系统本身没有解决这个问题,下面的命令应该将一个设备替换为另一个设备:
zpool replace {your_poolname} {drive to be replaced} {new drive to take its place}例如:
zpool replace hactar_data /dev/gptid/87410b00-adb0-11e6-9193-00241d738094 /dev/gptid/87410b00-adb0-11e6-9193-00241d
738094zpool status命令。https://askubuntu.com/questions/305830
复制相似问题