There’s a really handy way of cloning an AIX operating system straight from a mksysb backup. Even if you don’t need to clone an OS, it’s a pretty handy way of testing that your mksysb backup will actually be suitable for rebuilding your AIX root volume group.
As you know, the mksysb command creates a backup of rootvg, so it captures the OS itself. Historically, mksysb backups were done to physical media, such as to a tape drive. It can also be done using the Network Installation Manager (NIM). But there’s a pretty easy way of creating a bootable disk without NIM or tape or CD: clone it from a mksysb backup.
From mksysb to boot disk
This method can be handy if you need to clone an AIX LPAR when you don’t have network access to the original.
The method uses the AIX command alt_disk_mksysb, but be careful! There are some gotchas. These are covered in more detail in the IBM Technote on Introduction to alt_cloning on AIX 6.1 and 7.1, but essentially here they are:
• The mksysb backup needs to have all the device and kernel support for the system you’re cloning to.
• We’re keeping both source and target servers at the same AIX version, release and technology level.
• You’ll need the fileset bos.alt_disk_install.boot_images on the server where the cloning is going to take place.
About that bos.alt_disk_install.boot_images fileset: it would be smart to install this as a part of your normal AIX builds. You never know when you’ll need it.
You can check if it’s installed using the command:
lslpp -l bos.alt_disk_install.boot_images
Fileset Level State Description
188.8.131.52 COMMITTED Alternate Disk Installation
Disk Boot Images
Alright, so we’ve ticked all the boxes for the prereqs. We’ve got the mksysb backup sitting in a file system. We’ve got a spare disk called hdisk1 that’s not in a volume group, and is large enough to hold the original rootvg.
alt_disk_mksysb -m /usr/sys/inst.images/lpar1_mksysb -d hdisk1
Restoring /image.data from mksysb image.
A few points worth noting
Be sure to put the absolute path in for the location of the mksysb backup that you point to with the –m flag. I ran this using a relative path and the process seemed to hang. It was only when I looked at the contents of /tmp/.alt_disk_inst.tmp.msg that I saw this error:
restore: 0511-158 Cannot open ./lpar1_mksysb: A file or directory in the path name does not exist.
Please mount volume 1 on ./lpar1_mksysb.
Press the Enter key to continue.
By default, the alt_disk_mksysb will change the bootlist, so that the new disk will be used for future booting of this OS. If you want to keep the original disk as the primary boot disk, use the –B flag when you run alt_disk_mksysb, or run the bootlist command after the alt_disk_mksysb command has completed.
You may want to run alt_disk_mksysb with the verbose flag enabled (-V) so that you get to see the files as they are getting restored.
You can turn on debugging to watch the progress even more closely. To do that, use the –D flag.
And if you want to resize the logical volumes and file systems to make them different from the original rootvg, you can create a new version of the file /image.data and point to it using the –i flag. This also allows you to break the mirrors on the rootvg, if you’re backing up a mirrored rootvg environment and restoring it to a single disk.
Test your mksysb
It’s not always easy to test that a mksysb backup is really ready to use for building and booting a new rootvg, so alt_disk_mksysb is a way of giving you more confidence that it really will restore all you need for the AIX OS.
There are a number of other ways of cloning an AIX operating system. In fact, there is a whole suite of commands that can be very handy alternatives to a traditional backup and restore. Check the IBM Technote on alt_cloning to find out more.
Command documentation for alt_disk_mksysb on AIX 7.2:
Create a mksysb backup