ZFSのディスク入れ替え

また、8TB*6のRAIDZのディスクが死んでしまった。切ない。

手順としてはZFSのディスク入れ替え - smectic-g’s blogと同様。

まずはdegaredになった状況

pool: tank
state: DEGRADED
status: One or more devices are faulted in response to persistent errors.
Sufficient replicas exist for the pool to continue functioning in a
degraded state.
action: Replace the faulted device, or use 'zpool clear' to mark the device
repaired.
scan: scrub repaired 0B in 14:31:37 with 0 errors on Sun Feb 11 14:55:38 2024
config:

NAME STATE READ WRITE CKSUM
tank DEGRADED 0 0 0
raidz1-0 DEGRADED 0 0 0
ata-ST8000VN0022-2EL112_ZA196HJA ONLINE 0 0 0
ata-ST8000VN0022-2EL112_ZA17B2GK ONLINE 0 0 0
ata-ST8000VN004-2M2101_WKD06BMA ONLINE 0 0 0
ata-ST8000VN0022-2EL112_ZA196HT7 ONLINE 0 0 0
ata-ST8000VN004-2M2101_WSD9LC9T ONLINE 0 0 0
ata-ST8000VN004-2M2101_WKD04ZFV FAULTED 18 0 0 too many errors
cache
nvme-INTEL_SSDPEKKW256G8_BTHH81951F1W256B ONLINE 0 0 0

errors: No known data errors

エラーになっているWKD004ZFVはZFSのディスク入れ替え(Open ZFSの場合) - smectic-g’s blogで交換したディスク。
導入当初(2014/7月)から元気に動いてるディスクもまだ残っていることを考えると、こういうのは本当に確率なんだなとよく分かる。

$ sudo dd if=/dev/zero of=/dev/disk/by-id/ata-ST8000VN004-2M2101_WSDA0PQX bs=1G count=1
$ sudo fdisk /dev/disk/by-id/ata-ST8000VN004-2M2101_WSDA0PQX
$ sudo zpool replace tank 8018796220637990350 ata-ST8000VN004-2M2101_WSDA0PQX

途中のfdiskではg+wでGPTのパーティションテーブルだけ作る。

pool: tank
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 Mar 3 18:59:06 2024
2.68T scanned at 3.10G/s, 658G issued at 761M/s, 41.3T total
104G resilvered, 1.56% done, 15:32:44 to go
config:

NAME STATE READ WRITE CKSUM
tank DEGRADED 0 0 0
raidz1-0 DEGRADED 0 0 0
ata-ST8000VN0022-2EL112_ZA196HJA ONLINE 0 0 0
ata-ST8000VN0022-2EL112_ZA17B2GK ONLINE 0 0 0
ata-ST8000VN004-2M2101_WKD06BMA ONLINE 0 0 0
ata-ST8000VN0022-2EL112_ZA196HT7 ONLINE 0 0 0
ata-ST8000VN004-2M2101_WSD9LC9T ONLINE 0 0 0
replacing-5 DEGRADED 0 0 0
8018796220637990350 UNAVAIL 0 0 0 was /dev/disk/by-id/ata-ST8000VN004-2M2101_WKD04ZFV-part1
ata-ST8000VN004-2M2101_WSDA0PQX ONLINE 0 0 0 (resilvering)
cache
nvme-INTEL_SSDPEKKW256G8_BTHH81951F1W256B ONLINE 0 0 0

errors: No known data errors

resilver完了まで祈るのみ