AIX OS Image Backups

Methods

AIX OS Images are created in two ways:

For VIO servers, they are done with the backupios command.

For normal AIX LPARs, they are done with the mksysb command.

This is industry standard and “by the book” method of AIX OS image backups. These images can be used to restore an OS on the same or different hardware using a Network Installation Manager (NIM) server. Creating a mksysb backup is a basic AIX admin skill. Restoring a mksysb backup using a NIM server requires AIX and NIM admin skills.

The script /usr/local/admin/osbackup:

LOGFILE=/usr/local/logs/osbackup.log
ERRFILE=/usr/local/logs/osbackup.err
HOST=`hostname`
OSLEVEL=`oslevel -s | tr '-' '_'`
MKSYSBFILE=`echo /mksysbs/mksysb.$HOST.$OSLEVEL | tr '.' '_'`
date > $LOGFILE
MOUNT=`df | grep mksysbs | awk '{print $7}'`
if [ -n $MOUNT = "/mksysbs" ]; then
echo "/mksysbs is mounted - continuing with mksysb" >> $LOGFILE
rm /mksysbs/mksysb* > /dev/null 2>&1
echo "/usr/bin/mksysb -eimv $MKSYSBFILE -X" >> $LOGFILE 2>$ERRFILE &
/usr/bin/mksysb -eimv $MKSYSBFILE -X >> $LOGFILE 2>$ERRFILE &
else
echo "/mksysbs is not mounted - mksysb will not be run" >> $LOGFILE
fi
exit 0

Problem Fix

Sometimes a mksysb will fail because a filesystem is too full. That is an easy one. Either clear space or add disk.

Ensure appropriate rootvg directories are excluded in /etc/rootvg.exclude. This is the file that excludes directories/filesystems in the rootvg volume group from mksysb backups such as /tmp and /mksysbs. Look around for examples. Remember to make a backup of the file first. Also remember that some rootvg only systems do not exclude much intentionally. Ask for help if you have questions.