サマリー
1TB x5台で構成されているRAIDZの空き容量が不足しているので、全部2TBに交換してオンラインマイグレーションする。
Tip
zpoolのオンラインマイグレーションは、
- zpoolのautoexpandプロパティを使用する
- zpool online -e を使用する
の2パターンがあるが、FreeBSD 8.2(zpool v15)以前では使用出来ず再起動したので、実際は「オンラインマイグレーションする予定でした。」が正しい。
現況
現在の接続状況
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# camcontrol devlist -v
scbus0 on mpt0 bus 0:
<ATA WDC WD10EADS-00L 1A01> at scbus0 target 0 lun 0 (da0,pass0)
<ATA ST2000DL003-9VT1 CC3C> at scbus0 target 1 lun 0 (da1,pass1)
<ATA Hitachi HDS5C302 A580> at scbus0 target 2 lun 0 (da2,pass2)
<ATA Hitachi HDS72202 A28A> at scbus0 target 3 lun 0 (da3,pass3)
<> at scbus0 target -1 lun -1 ()
scbus1 on mpt0 bus 1:
<> at scbus1 target -1 lun -1 ()
scbus-1 on xpt0 bus 0:
<> at scbus-1 target -1 lun -1 (xpt0)
# zpool status lib_01
pool: lib_01
state: ONLINE
scrub: resilver completed after 13h42m with 0 errors on Fri Apr 27 10:13:08 2012
config:
NAME STATE READ WRITE CKSUM
lib_01 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad10 ONLINE 0 0 0 900G resilvered
ad8 ONLINE 0 0 0
ad6 ONLINE 0 0 0
da0 ONLINE 0 0 0
ad12 ONLINE 0 0 0
errors: No known data errors
|
対象をda0(scbus0 target 0 lun 0)に決定。
HDDのリプレース
通常、camcontrolでdeviceを外す場合はejectを使用するが、今回はデバイスがejectを受け付けない。
1
2
|
# camcontrol eject da0
Error received from stop unit command
|
今回は zpool offline
でzpoolから切り離した後 camcontrol stop
でディスクの回転を止めて、引っこ抜くことにする。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# zpool offline lib_01 da0
# zpool status lib_01
pool: lib_01
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 after 13h42m with 0 errors on Fri Apr 27 10:13:08 2012
config:
NAME STATE READ WRITE CKSUM
lib_01 DEGRADED 0 0 0
raidz1 DEGRADED 0 0 0
ad10 ONLINE 0 0 0 900G resilvered
ad8 ONLINE 0 0 0
ad6 ONLINE 0 0 0
da0 OFFLINE 0 0 0
ad12 ONLINE 0 0 0
errors: No known data errors
# camcontrol stop da0
Unit stopped successfully
|
物理作業。単純に引っこ抜く。
一応引っこ抜かれる。
1
2
3
4
|
# camcontrol devilst
<ATA ST2000DL003-9VT1 CC3C> at scbus0 target 1 lun 0 (da1,pass1)
<ATA Hitachi HDS5C302 A580> at scbus0 target 2 lun 0 (da2,pass2)
<ATA Hitachi HDS72202 A28A> at scbus0 target 3 lun 0 (da3,pass3)
|
同じ位置にHDDを挿し直して、スキャン。
1
2
3
4
5
6
7
8
|
# camcontrol rescan all
Re-scan of bus 0 was successful
Re-scan of bus 1 was successful
# camcontrol devlist
<ATA ST2000DL003-9VT1 CC3C> at scbus0 target 1 lun 0 (da1,pass1)
<ATA Hitachi HDS5C302 A580> at scbus0 target 2 lun 0 (da2,pass2)
<ATA Hitachi HDS72202 A28A> at scbus0 target 3 lun 0 (da3,pass3)
<ATA Hitachi HDS5C302 A800> at scbus0 target 4 lun 0 (pass0,da0)
|
挿し直して認識されることを確認。
後はいつも通り。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# zpool list status lib_01
pool: lib_01
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 after 13h42m with 0 errors on Fri Apr 27 10:13:08 2012
config:
NAME STATE READ WRITE CKSUM
lib_01 DEGRADED 0 0 0
raidz1 DEGRADED 0 0 0
ad10 ONLINE 0 0 0 900G resilvered
ad8 ONLINE 0 0 0
ad6 ONLINE 0 0 0
da0 OFFLINE 0 0 0
ad12 ONLINE 0 0 0
errors: No known data errors
# zpool replace lib_01 da0
# zpool status lib_01
pool: lib_01
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 for 0h0m, 0.00% done, 664h8m to go
config:
NAME STATE READ WRITE CKSUM
lib_01 DEGRADED 0 0 0
raidz1 DEGRADED 0 0 0
ad10 ONLINE 0 0 0
ad8 ONLINE 0 0 0
ad6 ONLINE 0 0 0
replacing DEGRADED 0 0 0
da0/old OFFLINE 0 0 0
da0 ONLINE 0 0 0 5.35M resilvered
ad12 ONLINE 0 0 0
errors: No known data errors
|
終了を待って、おしまい。