This section describes how to create and verify a bootable backup copy, or mksysb image, of your root volume group and how to make separate backup copies of user volume groups.
The root volume group is a hard disk or group of disks that contains:
A user volume group, also called the nonroot volume group, typically contains data files and application software.
A system backup does the following:
A backup transfers the following configurations from the source system to the target system:
Note: The use of map files is not recommended if you plan to reinstall the backup to target systems other than the source system, or the disk configuration of the source system is to be changed before reinstalling the backup.
Using the Web-based System Manager or the SMIT backup menu lets you preserve configuration information, thus avoiding some of the configuring tasks normally required after restoring a system backup. A backup preserves the configuration if the following are true:
AND
The Web-based System Manager and SMIT both use the mksysb command to create a backup image, stored either on CD, DVD, tape, or in a file. If you choose CD, DVD, or tape, the backup program by default writes a boot image, which makes the medium suitable for installing. For more information, see System Backup to CD-R, DVD-R, or DVD-RAM.
In AIX 5.2, all devices and kernels are installed by default when performing a base operating system installation. This allows you to be able to create a system backup that contains all devices and kernel types. Since the system backup contains all the devices and kernel support, the system backup can be used to install another system without the need for the AIX product media. This option is available in the Install Options menu in the BOS installation menus as follows:
Enable System Backups to install any system...................... Yes (Installs all devices and kernels)
If you change the default (yes) to no, then only the devices and kernel type for your system configuration will be installed.
This value is read from the ALL_DEVICES_KERNELS field in the /var/adm/ras/bosinst.data file on the product media you used to boot the system.
After the system is installed, you can check if all the devices and kernel types have been installed on the system as follows:
# grep ALL_DEVICES_KERNELS bosinst.data
Output similar to the following displays:
ALL_DEVICES_KERNELS = yes
Refer to Customized BOS Installations for more information about the bosinst.data file.
Before creating system backups, complete the following prerequisites:
Note: The mksysb command does not back up file systems mounted across an NFS network.
This backup procedure backs up files twice if a local directory is mounted over another local directory in the same file system. For example, if you mount /tmp over /usr/tmp, the files in the /tmp directory are then backed up twice. This duplication might exceed the number of files a file system can hold, which can cause a future installation of the backup image to fail.
Use the df command, which reports in units of 512-byte blocks, to determine the free space in the /tmp directory. Use the chfs command to change the size of the file system, if necessary.
For example, the following command adds 12 MB of disk space to the /tmp directory of a system with 4 MB partitions:
chfs -a size=+24000 /tmp
lslpp -l bos.sysmgt.sysbr
If your system has the bos.sysmgt.sysbr fileset installed, continue with one of the following procedures:
If the lslpp command does not list the bos.sysmgt.sysbr fileset, install it before continuing with the backup procedure. Refer to Optional Software Products and Service Updates for instructions, or enter the following command:
installp -agqXd device bos.sysmgt.sysbr
where device is the location of the software; for example, /dev/cd0 for CD-ROM drive.
You can use either the Web-based System Manager or SMIT to create a system backup. These backups can be stored to CD, DVD, tape, or in a file.
For instructions on how to backup to CD/DVD, see System Backup to CD-R, DVD-R, or DVD-RAM.
To create a root volume group backup:
OR
Map files match the physical partitions on a drive to its logical partitions. When installing from a backup image, the BOS installation program uses map files to position the logical volumes on the target drive in the same partitions they were on in the source system. If you do not create map files, the installation program relies on the logical volume manager (LVM) to determine placement for the logical volumes. For more information, see Using Map Files for Precise Allocation in AIX 5L Version 5.2 System Management Concepts: Operating System and Devices.
Note: If you plan to reinstall the backup to target systems other than the source system, or if the disk configuration of the source system might change before reinstalling the backup, do not create map files.
/scratch/
For another example, exclude the contents of the directory called /tmp and avoid excluding any other directories that have /tmp in the pathname by adding the following line to the exclude file:
^./tmp/
Note: All files are backed up relative to the current working directory. This directory is represented by a . (dot character). To exclude any file or directory for which it is important to have the search match the string at the beginning of the line, use a ^ (caret character) as the first character in the search string, followed by a . (dot character), and then followed by the filename or directory to be excluded.If the filename or directory being excluded is a substring of another filename or directory, use ^. (caret character followed by dot character) to indicate that the search should begin at the beginning of the line and/or use $ (dollar sign character) to indicate that the search should end at the end of the line.
If you chose tape as the backup medium, the system might prompt you to insert the next tape during the backup by displaying a message similar to the following:
Mount next Volume on /dev/rmt0 and press Enter.
If this message displays, remove the tape and label it, including the BOS version number. Then insert another tape and press Enter.
When the backup process finishes, the COMMAND: field changes to OK.
You have created the backup of your root volume group (rootvg). If you created bootable tapes, you can use these tapes to start your system if for some reason you cannot boot from hard disks.
Creating a backup on CD-R, DVD-R, or DVD-RAM media is similar to making a backup tape for your personal use, but with some noticeable differences. For DVD media, the following formats for creating backups are available:
Note: For information about CD-R, DVD-R, or DVD-RAM drives and CD-R, DVD-R, or DVD-RAM creation software, refer to the following readme file:/usr/lpp/bos.sysmgt/mkcd.README.txt
Both Web-based System Manager and SMIT use the mkcd command, which calls the mksysb or savevg command, if needed.
For system backups, the CDs or DVDs can be created as:
In AIX 5.2, a bootable system backup contains the chrp boot image and all the device and kernel packages necessary to install a system. A backup CD or DVD can be used to install (clone) a large number of machines, which is convenient when each machine in the system environment needs to have the same image installed.
Web-based System Manager and SMIT interfaces are available for the mkcd command. Online help can guide you through the required steps.
The mkcd command requires that you already have the software installed to create a CD/DVD file system in Rock Ridge format and to burn or write the CD/DVD. The GNU versions of cdrecord and mkisofs are installed with a BOS installation. Hardware and software that has been tested with this command includes the following:
Software | Hardware |
---|---|
GNU and Free Software Foundation, Inc.
readcd version
1.9
|
Matsushita LF-D291 DVD-RAM |
To run the mkcd command, you need extra working space. A separate file system or directory is required for each of the following:
The mkcd command creates the following file systems if they are not already present or if alternative file systems or directories have not been specified:
The space used in these file systems is only temporary (unless the -R or -S flag is specified to save the images). If the mkcd command creates the file systems, it also removes them. Each file system or directory might require over 645 megabytes (up to 4.38 GB for DVD).
If your machine does not have sufficient space, you can use NFS to mount some space from another server system; however, the file systems must be writable. You can create a /mkcd file system that is very large (1.5 GB for CD or 9 GB for DVDs). The /mkcd file system can then be mounted onto the clients when they want to create a backup CD or DVD for their systems. When creating very large backups (larger than 2 GB) with the mkcd command, the file system must be large-file enabled and the ulimit values must be set to unlimited.
The mkcd command with the -L flag allows the creation of ISO9660 DVD-sized images. The mkcd command with the -U flag allows the creation of UDF DVD images.
OR
The SMIT procedure is similar for CD and ISO9660 DVD.
The mkcd command always calls the mksysb command with the flags to extend /tmp.
You can specify an existing image.data file or supply a user-defined image.data file. See step 16.
/../usr/sys/inst.data/user_bundles/bundle_file_name
If you are planning to install one or more bundles after the mksysb image is restored, follow the directions in the previous step to specify the bundle file. You can thenuse this option to have packages listed in the bundle available on the CD. If this option is used, you must also specify the location of installation images in the next step.
/../filename
This section provides information on the Universal Disk Format (UDF) and how to create system backups using DVD-RAM media and UDF.
UDF allows you to manipulate files directly on the DVD-RAM media. The system backup image is an archived file composed of many files that can not be manipulated. However, the installation packages and any files that are not contained in the backup image, can be directly manipulated on the DVD-RAM. After the DVD is mounted the files can be changed by using an editor or new files can be copied to the DVD using the various copy and restore commands (cp, mv, restore, and such).
With UDF and DVD-RAM, system space is only needed for the backup image. A high-level description of the UDF backup process is as follows:
The mkcd command with the -U flag is used to create a UDF file system on the DVD-RAM.
As mentioned above, UDF allows for the possibility of changing files directly on the DVD-RAM media, such as a bosinst.data file and image.data or vgname.data file. Without UDF for example, in order to add a user-defined bosinst.data file to a backup image, you had to restore the backup image to a location, add the file, and then back up the files again.
Or, you had to create a supplemental diskette containing the changed bosinst.data file, and use the supplemental diskette in conjunction with the backup. However, some system configurations may ship without diskette drives, making this procedure more difficult.
To create a root volume group backup on DVD-RAM with UDF you can do the following:
OR
The mkcd command always calls the mksysb command with the flags to extend /tmp.
You can specify an existing image.data file or supply a user-defined image.data. See step 14.
/../usr/sys/inst.data/user_bundles/bundle_file_name
If you are planning to install one or more bundles after the mksysb image is restored, follow the directions in the previous step to specify the bundle file. Then you can use this option to have packages listed in the bundle available on the DVD. If this option is used, you must also specify the location of installation images in the next step.
/../filename
The savevg command provides the ability to create a user volume group backup to a CD, DVD, tape, or file. The savevg command finds and backs up all files belonging to a specified volume group. The volume group must be varied-on, and the file systems must be mounted.
This user backup has a copy of a non-rootvg volume group on it, and is useful for volume groups that contain user data.
The savevg command uses a data file created by the mkvgdata command. The data file created is as follows:
/tmp/vgdata/vgname/vgname.data
The vgname.data file contains information about a user volume group. The savevg command uses this file to create a backup image that can be used by the restvg command to remake the user volume group.
You can also use the mkcd command to create a user volume group backup to CD or DVD. The mkcd command currently supports saving one volume group at a time to a CD or DVD.
The mkcd command with the -L flag allows the creation of ISO9660 DVD sized images. The mkcd command with the -U flag allows the creation of UDF DVD images.
If your rootvg image and savevg image are small enough to fit on one CD, you can save them both by taking advantage of the -l (stacklist) and -z (customization_script) flags. The -l flag gives a list of images to copy to the CD. The -z flag lets you create a script to restore savevg backups. For example, if you make a copy of a non-rootvg volume group ahead of time, and then write a script that calls the restvg command, then your non-rootvg would be restored to hdisk2 at the end of the installation of rootvg, as shown by the following command:
restvg -d /SPOT/installp/ppc/savevg_image hdisk2
This procedure is recommended only if you know you want to restore the non-rootvg volume group every time you install. Otherwise, you might just want to store it on the CD/DVD, then use restvg to restore it after reboot. The restvg command can restore from CD or DVD if the name of the image is savevg_image. If you save the non-rootvg backup on a CD or DVD with a different filename, you can insert that CD or DVD and use the full path to the filename as the device for the restvg command.
Use either Web-based System Manager or SMIT to back up user volume groups to CD or DVD.
Use Web-based System Manager and select System backup wizard method. You can create a non-bootable CD or DVD that contains only a volume group backup image of a user volume group.
Once you have a system backup or a user volume group backup, you may want to verify the backup or list information about the backup image. This section provides information on the options you can perform on a backup image. The commands used to perform these operations are the lsmksysb command for system backups, and the lssavevg command for user volume groups. This section includes information on the following topics:
The preview option allows you to view volume group information, the date and time the backup was made, and the level of AIX.
You can use the lsmksysb command or the lssavevg command with the -l option to preview a backup image. For example, to preview a system backup file called /tmp/mybackup, type the following:
# lsmksysb -l -f /tmp/mybackup
The output similar to the following displays:
VOLUME GROUP: rootvg BACKUP DATE/TIME: Mon Jul 29 22:03:27 CDT 2002 UNAME INFO: AIX va08 2 5 000974AF4C00 BACKUP OSLEVEL: 5.2.0.0 none MAINTENANCE LEVEL: none BACKUP SIZE (MB): 1408 SHRINK SIZE (MB): 1242 rootvg: LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT hd5 boot 1 1 1 closed/syncd N/A hd6 paging 16 16 1 open/syncd N/A hd8 jfs2log 1 1 1 open/syncd N/A hd4 jfs2 1 1 1 open/syncd / hd2 jfs2 21 21 1 open/syncd /usr hd9var jfs2 1 1 1 open/syncd /var hd3 jfs2 1 1 1 open/syncd /tmp hd1 jfs2 1 1 1 open/syncd /home hd10opt jfs2 1 1 1 open/syncd /opt fslv00 jfs2 31 31 1 open/syncd /export/nim fslv01 jfs2 1 1 1 open/syncd /tftpboot
To preview a backup image in the SMIT, use the lsbackupinfo fast path.
To list the contents of a mksysb image on tape or CD, you can use either Web-based System Manager (type wsm on the command line, then choose the Backup and Restore application) or SMIT (type smit lsmksysb on the command line). The listing verifies most of the information on the tape or CD, but does not verify that the backup media can be booted for installations. The only way to verify that the boot image(s) on a mksysb tape or CD function properly is by booting from the media.
You can view the backup log that is created each time a volume group is backed up. The log file contains information on previous volume group and system backups.
You can use the lsmksysb command or the lssavevg command with the -B option to view the backup log file. For example, to view the backup log file, type the following:
# lsmksysb -B
Output similar to the following displays:
#Device;Command;Date;Shrink Size;Full Size;Maintenance Level /export/mksysb/generic_sysb;"mksysb -X -e /export/mksysb/generic_sysb";M on Jul 29 22:11:17 CDT 2002;1242;1408; /export/mksysb/generic_sysb;"mksysb -X -e /export/mksysb/generic_sys b";Tue Jul 30 16:38:31 CDT 2002;2458;2720;
To view the backup log in the SMIT, select View the Backup Log in the System Backup Manager menu.
You can view the filesets installed in a system backup using the lsmksysb command with the -L option. For example, to view the filesets installed in a system backup, type the following:
# lsmksysb -L -f generic_sysb
Output similar to the following displays:
Fileset Level State Description ---------------------------------------------------------------------------- Path: /usr/lib/objrepos IMNSearch.bld.DBCS 2.4.0.0 COMMITTED NetQuestion DBCS Buildtime Modules . . . bos.terminfo.wyse.data 5.2.0.0 COMMITTED Wyse Terminal Definitions bos.txt.spell.data 5.2.0.0 COMMITTED Writer's Tools Data bos.txt.tfs.data 5.2.0.0 COMMITTED Text Formatting Services Data
To view the filesets installed in a system backup in SMIT, use the lslppbackup fast path.
You can list all the files and file sizes in a backup using the lsmksysb command or the lssavevg command. For example, to view the files and file sizes in a system backup, type the following:
# lsmksysb -f generic_sysb
Output similar to the following displays:
. . . 353218 ./smit.log 252 ./smit.script 0 ./tftpboot 0 ./tmp 5 ./u 21 ./unix The total size is 629313078 bytes.
To view the files and file sizes in a system backup in SMIT, use the lsmksysb fast path.