This chapter 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. References to CD in this chapter also apply to DVD.
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:
AND
The Web-based System Manager and SMIT both use the mksysb command to create a backup image, stored either on CD, on tape, or in a file. If you choose CD or tape, the backup program by default writes a boot image, which makes the medium suitable for installing. (For AIX 5.1, the Web-based System Manager interface does not support backups to DVD.) For more information, see Creating System Backups on CD-ROM.
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 either Creating a Root Volume Group Backup to Tape or File or Creating a User Volume Group Backup.
If the lslpp command does not list the bos.sysmgt.sysbr fileset, install it before continuing with the backup procedure. Refer to Chapter 4, 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. Booting from tape is not supported on Itanium-based platforms.
CD/DVD instructions are slightly different. See Creating System Backups on CD-ROM.
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.1 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 CD/DVD is similar to making a backup tape for your personal use, but with some noticeable differences.
Note: For information about CD/DVD-R/DVD-RAM drives and CD/DVD-R creation software, refer to the following README file:
/usr/lpp/bos.sysmgt/mkcd.README.txt
The Web-based System Manager and SMIT both use the mkcd command, which calls the mksysb or savevg command, if needed. For system backups, the CDs can be created as:
Notes:
- Only CHRP systems support booting from DVD.
- Web-based System Manager does not support backups to DVD.
- POWER-based platform backups and Itanium-based platform backups are not interchangeable. For example, generic CD produced on a POWER-based platform cannot be used to install or recover an Itanium-based platform.
There are two types of backup CDs that can be created. The first is called a personal backup CD, which is similar to a backup tape. A personal backup CD can only boot and install the machine on which it was created.
The second type of CD is a generic backup CD. A generic backup CD created on one POWER-based machine can boot any other POWER-based machine. It contains three boot images and all the device and kernel packages necessary to install any system. The mksysb image that is stored on the CD does not require that all the devices be installed in it, because the installation process installs the needed devices for that machine from the packages on the CD. A generic backup CD can be used to install (clone) a large number of machines in a customer's environment, which is particularly convenient when each machine in the system environment needs to have the same image installed, but all machines might not have the same hardware configuration.
Web-based System Manager and SMIT interfaces are available for the mkcd command. Online help can guide you through the required steps.
Another option available with the mkcd command is the ability to create a savevg CD. This CD has a copy of a non-rootvg volume group on it, and is useful for volume groups that contain user data. The mkcd command currently supports saving one volume group at a time to a CD. A new -L flag allows the creation of DVD sized images. However, 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/usr/sys/inst.images/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 if the name of the image is savevg_image. If you save the non-rootvg backup on a CD with a different filename, you can insert that CD and use the full path to the filename as the device for the restvg command.
You must obtain the hardware and software necessary to create a
CD/DVD. The command for this process, mkcd, requires that you already have the software
to create a CD or DVD-ROM file system in Rock Ridge format and to
burn or write the CD. Hardware and software that has been
tested with this command includes:
Software | Hardware |
---|---|
GNU and Free Software Foundation, Inc.
cdrecord version 1.8a5
| Yamaha CRW4416SX
Ricoh MP6201SE 6XR-2X Panasonic Cw-7502-B |
GNU and Free Software Foundation, Inc.
readcd version 1.9
| Matsushita LF-D291 DVD-RAM |
Jodian Systems and Software, Inc.
CDWrite version 1.3
| Yamaha CRW4416SX
Ricoh MP6201SE 6XR-2X Panasonic Cw-7502-B |
Young Minds, Inc.
MakeDisc version 1.3-Beta2 | CD Studio
Turbo Studio DVD-R |
Note: For more information about CD/DVD-R/DVD-RAM drives and CD/DVD-R creation software, refer to the following README file:
/usr/lpp/bos.sysmgt/mkcd.README.txt
Note: For information on using the mkcd command with Itanium-based platforms, refer to the following README file:
/usr/lpp/bos.sysmgt/mkcd.README.txt
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:
/mkcd/mksysb_images
/mkcd/cd_fs
/mkcd/cd_images
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). The /mkcd/cd_fs directory needs 645 megabytes (up to 4.38 GB for DVD). The /mkcd/mksysb_images directory's space requirement depends on the size of the mksysb image that is to be created. The mkcd process attempts to calculate this space and verify that adequate space is available before starting the mksysb image. The /mkcd/cd_image directory needs at least 645 megabytes (up to 4.38 GB for DVD) of space. If the -R or -S flags are used to specify not removing the images and there are multiple volumes required, then more space must be provided.
If you do not have space on your machine, you might want to use NFS to mount some space from another server system, however, the file systems must be writeable. You can create a /mkcd file system that is very large (1.5 gig for CD or 9 GB for DVDs) and then create subdirectories for cd_fs, mksysb_images, and cd_images under /mkcd. Then /mkcd can be mounted onto the clients when they want to create a backup CD/DVD for their systems. When creating very large backups (larger than 2 GB) for DVD with the mkcd command, the file system must be large-file enabled and the ulimit values must be set to unlimited.
To create a root volume group backup:
OR
Refer to steps 3 and 4 of Creating a Generic Backup CD/DVD Using SMIT . The mkcd command always calls the mksysb command with the flags to extend /tmp, to create an image.data file, and to use software packing for the backup.
/../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 CD. If this option is used, you must also specify the location of installation images in the next step.
/../filename
To use SMIT for creating a generic backup CD/DVD, follow these steps:
/../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 CD. If this option is used, you must also specify the location of installation images in the next step.
/../filename
Use either Web-based System Manager or SMIT to back up user volume groups. In AIX 4.3.3 and later versions, you can back up a user volume group to CD.
Use Web-based System Manager and select System backup to writable CD. This method creates a non-bootable CD that contains only a volume group backup image of a user volume group.
To back up a user volume group to tape or file using SMIT, type smit savevg on the command line. Back up a user volume group to CD by typing smit savevgcd on the command line.
When the Save a Volume Group screen displays, use the steps for backing up the root volume group as a guide for backing up user volume groups. There is one exception to this procedure. If you want to exclude files in a user volume group from the backup image, create a file named /etc/exclude.volume_group_name, where volume_group_name is the name of the volume group you want to backup.
Next, edit the /etc/exclude.volume_group_name file and enter the patterns of file names that you do not want included in your backup image. The patterns in this file are input to the pattern-matching conventions of the grep command to determine which files are excluded from the back up.
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. To verify all the boot images on a generic CD, try to boot from the CD on each different platform on which you are installing the backup.