rpool の置き換え

rpoolのディスクを交換&容量拡張の予定です。今回はVirtualBoxでとりあえず確認したのでそのログです。

なお、方法自体はug-jposug システムDISK交換で回答している chototsuさんの起動ディスクを交換する(mirrorを使用する方法) そのままとなります。

まぁ、今後自分の環境で何度か実施するだろうと思うので自分用メモといったところ。

交換前環境


root@vm-opensolaris:~# zpool status
pool: rpool
state: ONLINE
status: The pool is formatted using an older on-disk format. The pool can
still be used, but some features are unavailable.
action: Upgrade the pool using 'zpool upgrade'. Once this is done, the
pool will no longer be accessible on older software versions.
scrub: none requested
config:

NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
c3d0s0 ONLINE 0 0 0

errors: No known data errors

VirtualBoxのプライマリスレーブに交換用ディスクを追加して fdisk & format
交換用のディスクは c3d1 に見えます。セカンダリだと c4とかになるかなと。


root@vm-opensolaris:~# format
AVAILABLE DISK SELECTIONS:
0. c3d0
/pci@0,0/pci-ide@1,1/ide@0/cmdk@0,0
1. c3d1
/pci@0,0/pci-ide@1,1/ide@0/cmdk@1,0
Specify disk (enter its number)[0]: 1
selecting c3d1
Controller working list found
[disk formatted, defect list found]
No Solaris fdisk partition found.
format> fdisk
No fdisk table exists. The default partition for the disk is:

a 100% "SOLARIS System" partition

Type "y" to accept the default partition, otherwise type "n" to edit the
partition table.
y
format> p
partition> p
...
(Partition切るところは省略。元のパーティションを参考に)
...
partition> p
Current partition table (unnamed):
Total disk cylinders available: 2607 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 root wm 3 - 2606 19.95GB (2604/0/0) 41833260
1 unassigned wm 0 0 (0/0/0) 0
2 backup wu 0 - 2606 19.97GB (2607/0/0) 41881455
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
8 boot wu 0 - 0 7.84MB (1/0/0) 16065
9 alternates wm 1 - 2 15.69MB (2/0/0) 32130

partition> label
Ready to label disk, continue? yes

partition> quit
format> quit

mirrorディスクの追加


root@vm-opensolaris:~# zpool attach -f rpool c3d0s0 c3d1s0
Please be sure to invoke installgrub(1M) to make 'c3d1s0' bootable.


zpool status で、ミラーの同期が終わったの確認して(?)、grubのインストール


root@vm-opensolaris:~# zpool status
config:

NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
mirror ONLINE 0 0 0
c3d0s0 ONLINE 0 0 0
c3d1s0 ONLINE 0 0 0 5.07G resilvered
errors: No known data errors
root@vm-opensolaris:~# installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c3d1s0

stage1 written to partition 0 sector 0 (abs 16065)
stage2 written to partition 0, 271 sectors starting at 50 (abs 16115)

元のディスクを切り離してシャットダウン


root@vm-opensolaris:~# zpool detach rpool c3d0s0
root@vm-opensolaris:~# init 5

VirutaulBoxの設定で、プライマリマスターのディスク(元)を外して、プライマリスレーブのディスク(新)をプライマリマスターに変更してブート


root@vm-opensolaris:~# zpool status
pool: rpool
state: ONLINE
status: The pool is formatted using an older on-disk format. The pool can
still be used, but some features are unavailable.
action: Upgrade the pool using 'zpool upgrade'. Once this is done, the
pool will no longer be accessible on older software versions.
scrub: none requested
config:

NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
c3d0s0 ONLINE 0 0 0

errors: No known data errors
root@vm-opensolaris:~#

バイスのパスが変わるとどうなるかな?と不安がありましたが、ちゃんと c3d1 -> c3d0 に変更されても無事 起動してくれました。

このあたり、他のOSよりらく〜。