ディスクに取得したmksysbファイルから、システムを復旧する方法(alt_disk_mksysb)を試してみました。
仮の新規インストールやそのためのディスク領域は必要ですが、この方法もアリと思うので投稿してみます。
mksysb(システムバックアップ)をディスクに取得する。
システムバックアップを取得する先としてbkupvgを作成します。また
後でわかりやすいように/testファイルシステムとその下にAAAファイルを作成します。
# lspv
hdisk0 00c05040dedcf51e rootvg active
hdisk1 00c05040df17d653 bkupvg active
# df -k
Filesystem 1024-blocks Free %Used Iused %Iused Mounted on
/dev/hd4 131072 76240 42% 2880 15% /
/dev/hd2 2490368 220692 92% 45620 48% /usr
/dev/hd9var 196608 160932 19% 650 2% /var
/dev/hd3 131072 124148 6% 103 1% /tmp
/dev/hd1 65536 65160 1% 7 1% /home
/dev/hd11admin 131072 130692 1% 5 1% /admin
/proc - - - - - /proc
/dev/hd10opt 65536 47396 28% 165 2% /opt
/dev/livedump 262144 261776 1% 4 1% /var/adm/ras/livedump
/dev/fslv00 20971520 17490920 17% 6 1% /bkup
/ahafs - - - 36 1% /aha
/dev/fslv02 2097152 2088312 1% 5 1% /test
# ls -ltr /test
total 0
drwxr-xr-x 2 root system 256 Feb 10 11:01 lost+found
-rw-r--r-- 1 root system 0 Feb 10 11:02 AAA
#
bkupvgにシステムバックアップを取得します。
Back Up This System to Tape/File or UDFS capable media
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
[TOP] [Entry Fields]
WARNING: Execution of the mksysb command will
result in the loss of all material
previously stored on the selected
output medium. This command backs
up only rootvg volume group.
* Backup DEVICE or FILE [/bkup/mksysb_20250210] +/
Create MAP files? no +
Create backup using snapshots? no +
EXCLUDE files? no +
Exclude WPAR file systems? no +
Location of File System Exclusion List [] /
List files as they are backed up? no +
Verify readability if tape device? no +
[MORE...12]
F1=Help F2=Refresh F3=Cancel F4=List
F5=Reset F6=Command F7=Edit F8=Image
F9=Shell F10=Exit Enter=Do
COMMAND STATUS
Command: OK stdout: yes stderr: no
Before command completion, additional instructions may appear below.
Creating information file (/image.data) for rootvg.
Creating list of files to back up
Backing up 50476 files....
50476 of 50476 files backed up (100%)
0512-038 mksysb: Backup Completed Successfully.
F1=Help F2=Refresh F3=Cancel F6=Command
F8=Image F9=Shell F10=Exit /=Find
n=Find Next
# ls -ltr /bkup
-rw-r--r-- 1 root system 1738291200 Feb 10 11:04 mksysb_20250210
#
ディスクに取得したmksysbファイルからシステムを復元
OSのメディアなどから新規にAIXを導入する
ディスクに取得したmksysbファイルから直接リストアすることはできないため、まずは純粋にAIXをメディアから導入します。(新規導入方法は割愛します。)
※ 新規インストールする環境は、リストアするレベルと同じテクノロジー・レベルの最新SPの環境にする必要があります。
また、mksysbをリストアする先のディスクとして、ブランクのディスク(hdisk2)を用意しました。
# oslevel -s
7300-02-02-2420
# df -m
Filesystem MB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 128.00 74.57 42% 2862 15% /
/dev/hd2 2432.00 215.52 92% 45619 48% /usr
/dev/hd9var 192.00 157.86 18% 634 2% /var
/dev/hd3 128.00 126.36 2% 40 1% /tmp
/dev/hd1 64.00 63.63 1% 7 1% /home
/dev/hd11admin 128.00 127.63 1% 5 1% /admin
/proc - - - - - /proc
/dev/hd10opt 64.00 46.29 28% 163 2% /opt
/dev/livedump 256.00 255.64 1% 4 1% /var/adm/ras/livedump
/ahafs - - - 36 1% /aha
#
# lspv
hdisk0 00c05040dedcf51e rootvg active
hdisk1 00c05040df17d653 bkupvg active
hdisk2 none None
取得しておいたmksysbファイルを新規インストールしたOSに見せる
# varyonvg bkupvg
# mkdir /bkup
# mount /bkup
Replaying log for /dev/fslv00.
# ls -ltr /bkup
total 6790320
drwxr-xr-x 2 root system 256 Feb 7 15:28 lost+found
-rw-r--r-- 1 root system 1738291200 Feb 10 11:04 mksysb_20250210
#
alt_disk_mksysb機能で、取得しておいたシステムバックアップから、ブランクのディスクにリストア
# alt_disk_mksysb -m /bkup/mksysb_20250210 -d hdisk2
Restoring /image.data from mksysb image.
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 logical volume alt_fslv02.
Creating logical volume alt_fslv01.
Creating /alt_inst/ file system.
Creating /alt_inst/admin file system.
Creating /alt_inst/cd_images file system.
Creating /alt_inst/home file system.
Creating /alt_inst/opt file system.
Creating /alt_inst/test 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.
Restoring mksysb image to alternate disk(s).
Linking to 64bit kernel.
Changing logical volume names in volume group descriptor area.
Fixing LV control blocks...
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/test
forced unmount of /alt_inst/test
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/cd_images
forced unmount of /alt_inst/cd_images
forced unmount of /alt_inst/admin
forced unmount of /alt_inst/admin
forced unmount of /alt_inst
forced unmount of /alt_inst
Fixing file system superblocks...
Bootlist is set to the boot disk: hdisk2 blv=hd5
代替ディスクへのリストア直後
hdisk2は"altinst_rootvg"となっています。
hdisk2からブートされるようになっているので、再起動します。
# lspv
hdisk0 00c05040dedcf51e rootvg active
hdisk1 00c05040df17d653 bkupvg active
hdisk2 00c05040ee029d0d altinst_rootvg
#
# bootlist -m normal -o
hdisk2 blv=hd5 pathid=0
hdisk2 blv=hd5 pathid=1
hdisk2 blv=hd5 pathid=2
hdisk2 blv=hd5 pathid=3
hdisk2 blv=hd5 pathid=4
再起動後は、hdisk2がrootvgとなっており、一時的に作成したhdisk0上のOSは、old_rootvgに変更されました。
# lspv
hdisk0 00c05040dedcf51e old_rootvg
hdisk1 00c05040df17d653 bkupvg active
hdisk2 00c05040ee029d0d rootvg active
#
mksysb取得前に作成した/test/AAAも存在することも確認できました。
# oslevel -s
7300-02-02-2420
# df -m
Filesystem MB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 128.00 74.23 43% 2889 15% /
/dev/hd2 2432.00 213.27 92% 45621 47% /usr
/dev/hd9var 192.00 157.07 19% 650 2% /var
/dev/hd3 128.00 121.59 6% 106 1% /tmp
/dev/hd1 64.00 63.63 1% 7 1% /home
/dev/hd11admin 128.00 127.64 1% 5 1% /admin
/proc - - - - - /proc
/dev/hd10opt 64.00 46.29 28% 165 2% /opt
/dev/livedump 256.00 255.64 1% 4 1% /var/adm/ras/livedump
/dev/fslv01 10240.00 10198.12 1% 4 1% /cd_images
/dev/fslv02 2048.00 2039.37 1% 5 1% /test
/dev/fslv00 20480.00 17080.98 17% 6 1% /bkup
/ahafs - - - 36 1% /aha
# ls -ltr /test
total 0
-rw-r--r-- 1 root system 0 Feb 10 11:02 AAA
drwxr-xr-x 2 root system 256 Feb 10 12:59 lost+found
#
あとがき:
仮の新規インストールの手間や、仮の新規インストール用のディスク領域は必要になりますが、テープやRDXのメディアを使用せずに、mksysbをディスク上にファイルで取得しておいて、それをリストアする一つの方法になりますね。
メディアの使えないPowerVSでは、便利な方法として認知されていますが、オンプレでもこの方法はありですね。
参考資料):alt_disk_mksysbコマンド
https://www.ibm.com/docs/ja/aix/7.3?topic=alt-disk-mksysb-command