なんと、年末に買ったSSD、半月でエラーが出始めやがった。
Jan 17 01:34:02 kamui root: ZFS: checksum mismatch, zpool=tank path=/dev/ad6s1d offset=28516061184 size=4608
Jan 17 01:34:26 kamui root: ZFS: checksum mismatch, zpool=tank path=/dev/ad6s1d offset=28516051968 size=512
こういうのがドヨドヨと。zpool status
するとCKSUM
が上ってる。
$ zpool status
Checking status of zfs pools:
pool: tank
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
tank ONLINE 0 0 0
mirror ONLINE 0 0 0
ad4s1d ONLINE 0 0 0
ad6s1d ONLINE 0 0 28
errors: No known data errors
以後、この数字は順調に増え、今朝のdaily reportでは171になっていた。なんだかな。確かにkamuiのad6
にしたディスクは、4個中1個だけ容量が2MB少ないとか、妙な特徴があったわけだけど、やっぱりハズレだったんだなぁと納得。ということで、交換用のディスクを買ってきた。同じ機種にしたのは、あれこれ調べるのが面倒だったから。
まずは、障害の出たad6s1d
をOFFLINEにする。
# zpool offline tank ad6s1d
この後、物理的にディスクを交換するわけだが、SATAなんだからホットスワップできるはず。だけど、FreeBSDでどうやっていいのか思いつかず。atacontrol(8)
にそれらしきサブコマンドも見つからず。面倒なのでshutdownして交換した。情けない。
$ dmesg | grep 'ad[46]'
ad4: FAILURE - SET_MULTI status=51<READY,DSC,ERROR> error=4<ABORTED>
ad4: 30520MB <MTRON MSD-SATA3525 0.19R1H2> at ata2-master UDMA100
ad6: FAILURE - SET_MULTI status=51<READY,DSC,ERROR> error=4<ABORTED>
ad6: 30520MB <MTRON MSD-SATA3525 0.19R1> at ata3-master UDMA100
こんどは容量が同じ。んでも、ロットが違うからか「H2
」が付いてないな。古くなったかな?
スライス切りとパーティションを作成。予備のブートパーティションad6s1a
の作り直しは後回しにして、zpoolの再構成を。
# zpool status
pool: tank
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'.
scrub: resilver completed with 0 errors on Sun Feb 1 20:23:36 2009
config:
NAME STATE READ WRITE CKSUM
tank DEGRADED 0 0 0
mirror DEGRADED 0 0 0
ad4s1d ONLINE 0 0 0
ad6s1d OFFLINE 0 0 0
errors: No known data errors
この起動後の状態表示はzpool offline
直後のものと変わらない。それでは、交換したデバイスをONLINEに。
# zpool online tank ad6s1d
Bringing device ad6s1d online
こいつは、ちょこっと時間がかかった。これで、初期化されてないことがzfsにも伝わり、状態はこんなことに。
# zpool status
pool: tank
state: DEGRADED
status: One or more devices could not be opened. Sufficient replicas exist for
the pool to continue functioning in a degraded state.
action: Attach the missing device and online it using 'zpool online'.
see: http://www.sun.com/msg/ZFS-8000-D3
scrub: resilver in progress, 0.96% done, 0h10m to go
config:
NAME STATE READ WRITE CKSUM
tank DEGRADED 0 0 0
mirror DEGRADED 0 0 0
ad4s1d ONLINE 0 0 0
ad6s1d UNAVAIL 0 0 0 cannot open
errors: No known data errors
で、zpool replace を実施。このコマンドは一瞬にして返ってきた。
# sudo zpool replace tank ad6s1d
# zpool status
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.
scrub: resilver in progress, 0.06% done, 12h50m to go
config:
NAME STATE READ WRITE CKSUM
tank DEGRADED 0 0 0
mirror DEGRADED 0 0 0
ad4s1d ONLINE 0 0 0
replacing DEGRADED 0 0 0
ad6s1d/old UNAVAIL 0 0 0 cannot open
ad6s1d ONLINE 0 0 0
errors: No known data errors
同じディスク番号だと、こんな感じでreplace作業をする。mirror構成なので、データのコピーをしてるんでしょう。残りが13時間弱とか出てるけど、この数字は瞬く間に減って、残り数分となり、残り0h4mからが長かったが、最後はこのように完了。
# zpool status
pool: tank
state: ONLINE
scrub: resilver completed with 0 errors on Sun Feb 1 21:07:49 2009
config:
NAME STATE READ WRITE CKSUM
tank ONLINE 0 0 0
mirror ONLINE 0 0 0
ad4s1d ONLINE 0 0 0
ad6s1d ONLINE 0 0 0
errors: No known data errors
ログを調べると、replaceが完了するのに、およそ30分かかっていたことがわかる。
# zpool history | grep ad6
2008-12-28.00:57:18 zpool create tank mirror ad4s1d ad6s1d
2009-02-01.20:13:01 zpool offline tank ad6s1d
2009-02-01.20:36:02 zpool online tank ad6s1d
2009-02-01.20:36:35 zpool replace tank ad6s1d