我有一个 zpool,在断电重新启动服务器和设备名称后,它现在显示为 FAULTED 状态。我知道我通过设备名称添加 vdev 搞砸了,但不知道它可以在创建和填充池后更改。目前,池正在寻找“/dev/sde”(而不是“/dev/sdc”),而“/dev/sde”是 root fs 所在的设备,我不确定如何在没有潜在风险的情况下进行任何恢复更糟糕。
希望有一种方法可以简单地将 zpool 重新配置为使用“sdc”,以便能够使用“by-id”命名导出和重新导入,以避免将来出现这种情况。
root@boxey:~# zpool status
pool: data
state: FAULTED
status: One or more devices could not be used because the label is missing
or invalid. There are insufficient replicas for the pool to continue
functioning.
action: Destroy and re-create the pool from
a backup source.
see: http://zfsonlinux.org/msg/ZFS-8000-5E
scan: none requested
config:
NAME STATE READ WRITE CKSUM
data UNAVAIL 0 0 0 insufficient replicas
raidz1-0 UNAVAIL 0 0 0 insufficient replicas
sda ONLINE 0 0 0
sde UNAVAIL 0 0 0
sdd FAULTED 0 0 0 corrupted data
sdb FAULTED 0 0 0 corrupted data
root@boxey:~# lsblk --output=NAME,FSTYPE,LABEL,SIZE,UUID
NAME FSTYPE LABEL SIZE UUID
sda 2.7T
├─sda1 zfs_member data 2.7T 166412156792699288
└─sda9 8M
sdb 2.7T
├─sdb1 zfs_member data 2.7T 166412156792699288
└─sdb9 8M
sdc 2.7T
├─sdc1 zfs_member data 2.7T 166412156792699288
└─sdc9 8M
sdd 2.7T
├─sdd1 zfs_member data 2.7T 166412156792699288
└─sdd9 8M
sde 55.9G
├─sde1 ext4 53.6G f2d9733a-846d-48c2-bb63-c7f4e0345ad5
├─sde2 1K
└─sde5 swap 2.3G 6c34cadd-db42-4e14-a647-733e021c018e
root@boxey:~# zpool export -f data
cannot export 'data': one or more devices is currently unavailable
root@boxey:~# zdb
data:
version: 5000
name: 'data'
state: 0
txg: 23300202
pool_guid: 166412156792699288
errata: 0
hostid: 8323329
hostname: 'boxey'
com.delphix:has_per_vdev_zaps
vdev_children: 1
vdev_tree:
type: 'root'
id: 0
guid: 166412156792699288
children[0]:
type: 'raidz'
id: 0
guid: 1294813595973345307
nparity: 1
metaslab_array: 34
metaslab_shift: 36
ashift: 12
asize: 12002313371648
is_log: 0
create_txg: 4
com.delphix:vdev_zap_top: 39
children[0]:
type: 'disk'
id: 0
guid: 4873892069497714664
path: '/dev/sda1'
whole_disk: 1
DTL: 101
create_txg: 4
com.delphix:vdev_zap_leaf: 40
children[1]:
type: 'disk'
id: 1
guid: 16241503886070383904
path: '/dev/sde1'
whole_disk: 1
DTL: 100
create_txg: 4
com.delphix:vdev_zap_leaf: 41
children[2]:
type: 'disk'
id: 2
guid: 1910545688695459106
path: '/dev/sdd1'
whole_disk: 1
DTL: 99
create_txg: 4
com.delphix:vdev_zap_leaf: 42
children[3]:
type: 'disk'
id: 3
guid: 2766829802450425996
path: '/dev/sdb1'
whole_disk: 1
DTL: 98
create_txg: 4
com.delphix:vdev_zap_leaf: 43
features_for_read:
com.delphix:hole_birth
com.delphix:embedded_data