alt_disk_copy コマンドを使用して、rootvg 複製を確認しました。
・alt_disk_copy コマンド
https://www.ibm.com/docs/ja/aix/7.1?topic=alt-disk-copy-command
手順内、alt_rootvg_op も使用します。
・alt_rootvg_op コマンド
https://www.ibm.com/docs/ja/aix/7.1?topic=alt-rootvg-op-command
実行環境
AIX 7.1 TL3 SP3
元rootvg が hdisk0、コピー先が hdisk1 、切り離し対象が hdisk0 の場合
- ディスクの確認
hdisk0 は hdisk1 と同容量(20GB)のボリュームを接続しています。
# lspv
hdisk0 00f62fc64a541a41 rootvg active
hdisk1 00f98db5e9eb61c9 None
- alt_disk_copy コマンド実行
-d オプションで対象ディスク指定
# time alt_disk_copy -d hdisk1
Calling mkszfile to create new /image.data file.
Checking disk sizes.
Creating cloned rootvg volume group and associated logical volumes.
Creating logical volume alt_hd5.
Creating logical volume alt_hd6.
Creating logical volume alt_hd8.
Creating logical volume alt_hd4.
Creating logical volume alt_hd2.
Creating logical volume alt_hd9var.
Creating logical volume alt_hd3.
Creating logical volume alt_hd1.
Creating logical volume alt_hd10opt.
Creating logical volume alt_hd11admin.
Creating logical volume alt_lg_dumplv.
Creating logical volume alt_livedump.
Creating /alt_inst/ file system.
Creating /alt_inst/admin file system.
Creating /alt_inst/home file system.
Creating /alt_inst/opt file system.
Creating /alt_inst/tmp file system.
Creating /alt_inst/usr file system.
Creating /alt_inst/var file system.
Creating /alt_inst/var/adm/ras/livedump file system.
Generating a list of files
for backup and restore into the alternate file system...
Backing-up the rootvg files and restoring them to the alternate file system...
Modifying ODM on cloned disk.
Building boot image on cloned disk.
forced unmount of /alt_inst/var/adm/ras/livedump
forced unmount of /alt_inst/var/adm/ras/livedump
forced unmount of /alt_inst/var
forced unmount of /alt_inst/var
forced unmount of /alt_inst/usr
forced unmount of /alt_inst/usr
forced unmount of /alt_inst/tmp
forced unmount of /alt_inst/tmp
forced unmount of /alt_inst/opt
forced unmount of /alt_inst/opt
forced unmount of /alt_inst/home
forced unmount of /alt_inst/home
forced unmount of /alt_inst/admin
forced unmount of /alt_inst/admin
forced unmount of /alt_inst
forced unmount of /alt_inst
Changing logical volume names in volume group descriptor area.
Fixing LV control blocks...
Fixing file system superblocks...
Bootlist is set to the boot disk: hdisk1 blv=hd5
real 2m46.62s
user 0m12.77s
sys 0m18.55s
#
-> 2分50秒弱です。20GB のrootvgです。
- ディスク確認
# lspv
hdisk0 00f62fc64a541a41 rootvg active
hdisk1 00f98db5e9eb61c9 altinst_rootvg
-> hdisk1 が alt_inst rootvg になっています。
- ブートリスト確認
# bootlist -m normal -o
hdisk1 blv=hd5 pathid=0
hdisk1 blv=hd5 pathid=1
hdisk1 blv=hd5 pathid=2
hdisk1 blv=hd5 pathid=3
hdisk1 blv=hd5 pathid=4
#
alt_disk_copy 対象のディスクにブートリストが変更されています。
- リブート
# shutdown -Fr
SHUTDOWN PROGRAM
(省略)
起動後ログイン
- 確認
# lspv
hdisk0 00f62fc64a541a41 old_rootvg
hdisk1 00f98db5e9eb61c9 rootvg active
#
元のhdisk0 が old_rootvg になっています。
- old_rootvg の削除
alt_rootvg_opコマンドの-X オプションで、altinst_rootvg ボリューム・グループ定義を ODM データベースから 除去します。
# alt_rootvg_op -X old_rootvg
# lspv
hdisk0 00f62fc64a541a41 None
hdisk1 00f98db5e9eb61c9 rootvg active
#
- hdisk削除
# rmdev -dl hdisk0
hdisk0 deleted
# lspv
hdisk1 00f98db5e9eb61c9 rootvg active
#
hdisk0 から hdisk1 にrootvg が置き変わりました。
ケース2 元rootvg が hdisk0、コピー先が hdisk1 、切り離し対象が hdisk1 の場合
以下の "2. Using the alt_disk_copy command to clone the rootvg volume group." の手順です。
・Supported Methods of Duplicating an AIX OS Instance
https://www.ibm.com/support/pages/supported-methods-duplicating-aix-os-instance
- ディスク確認
hdisk1 へコピーします。
# lspv
hdisk0 00f62fc64a541a41 rootvg active
hdisk1 00f98db5e9eb61c9 None
- alt_disk_copy コマンド実行
-B オプションでブートリストを切り替えない。
-O オプションで指定したディスクのODMデータベースを削除します。ターゲット・ディスクを別システムにしたい場合に便利です。
# time alt_disk_copy -BOd hdisk1
Calling mkszfile to create new /image.data file.
Checking disk sizes.
Creating cloned rootvg volume group and associated logical volumes.
Creating logical volume alt_hd5.
Creating logical volume alt_hd6.
Creating logical volume alt_hd8.
Creating logical volume alt_hd4.
Creating logical volume alt_hd2.
Creating logical volume alt_hd9var.
Creating logical volume alt_hd3.
Creating logical volume alt_hd1.
Creating logical volume alt_hd10opt.
Creating logical volume alt_hd11admin.
Creating logical volume alt_lg_dumplv.
Creating logical volume alt_livedump.
Creating /alt_inst/ file system.
Creating /alt_inst/admin file system.
Creating /alt_inst/home file system.
Creating /alt_inst/opt file system.
Creating /alt_inst/tmp file system.
Creating /alt_inst/usr file system.
Creating /alt_inst/var file system.
Creating /alt_inst/var/adm/ras/livedump file system.
Generating a list of files
for backup and restore into the alternate file system...
Backing-up the rootvg files and restoring them to the alternate file system...
Modifying ODM on cloned disk.
Building boot image on cloned disk.
Resetting all device attributes.
NOTE: The first boot from altinst_rootvg will prompt to define the new
system console.
Resetting all device attributes.
NOTE: The first boot from altinst_rootvg will prompt to define the new
system console.
forced unmount of /alt_inst/var/adm/ras/livedump
forced unmount of /alt_inst/var/adm/ras/livedump
forced unmount of /alt_inst/var
forced unmount of /alt_inst/var
forced unmount of /alt_inst/usr
forced unmount of /alt_inst/usr
forced unmount of /alt_inst/tmp
forced unmount of /alt_inst/tmp
forced unmount of /alt_inst/opt
forced unmount of /alt_inst/opt
forced unmount of /alt_inst/home
forced unmount of /alt_inst/home
forced unmount of /alt_inst/admin
forced unmount of /alt_inst/admin
forced unmount of /alt_inst
forced unmount of /alt_inst
Changing logical volume names in volume group descriptor area.
Fixing LV control blocks...
Fixing file system superblocks...
real 2m39.40s
user 0m12.85s
sys 0m18.50s
2分40秒弱でした。rootvgは 20GB 程度です。
- ディスク確認
# lspv
hdisk0 00f62fc64a541a41 rootvg active
hdisk1 00f98db5e9eb61c9 altinst_rootvg
hdisk1 が altinst_rootvg となっています。
- ブートリスト確認
# bootlist -m normal -o
hdisk0 blv=hd5 pathid=0
hdisk0 blv=hd5 pathid=1
hdisk0 blv=hd5 pathid=2
hdisk0 blv=hd5 pathid=3
hdisk0 blv=hd5 pathid=4
ブートリストは、hdisk0 のままです。
- alt_rootvg_op 実行
リブートはせず、このまま hdisk1 の定義を削除します。
# alt_rootvg_op -X altinst_rootvg
Bootlist is set to the boot disk: hdisk0 blv=hd5
# lspv
hdisk0 00f62fc64a541a41 rootvg active
hdisk1 00f98db5e9eb61c9 None
#
- hdisk削除
# rmdev -dl hdisk1
hdisk1 deleted
hdisk1 を削除します。
- 確認
# lspv
hdisk0 00f62fc64a541a41 rootvg active
#
hdisk0が残りました。
- この状態で、hdisk1 のLUN を別サーバーにマッピングし直すなどを行えば、別システムで稼働が可能です。
(SAN boot、VIOS 環境想定)
以上です。