Documente Academic
Documente Profesional
Documente Cultură
Patrick Laffey
Ann Wigginton
Andrew Wong
IBM
Making a Backup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Verifying a Backup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Restoring a Backup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Reinstall a System Backup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Reinstall a System Backup onto Another System (Cloning) . . . . . . . . . . . . . . . . . 10
Restore Nonrootvg Volume Groups . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Restore Individual Files from a Backup . . . . . . . . . . . . . . . . . . . . . . . . 11
Appendix A. References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Appendix B. Notices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
AIX makes the process of backing up more convenient by offering the following options:
v Exclude individual files or directories from a backup
v Back up to CD, available in AIX Version 4.3.2 with Authorized Program Analysis Report (APAR) IY03060
and all later AIX versions
v Back up to DVD, available in AIX Version 4.3.3 with APAR IY15536 and all later AIX versions
v Restore individual files or an entire backup
v Clone installations across multiple systems using Network Installation Management (NIM)
v Transfer installed software from one system to another
For detailed information about the AIX operating system, refer to the following Web address:
http://www.ibm.com/servers/aix/library. AIX library information is listed under Technical Publications.
There are different commands to back up each type of volume group. When you use these commands, it
is essential that you know what type of information is being backed up.
Types of Backups
You can create three types of backups, each with advantages for particular purposes:
Backup to Reinstall the Same System
Backs up the operating system (rootvg) in a form that is bootable only on the source system.
When this backup is made to a CD or DVD, it is called a personal backup. This type of backup
can be used to reinstall another system only if you use the original AIX media to retrieve the
different filesets needed for the second system’s platform and hardware, a process called cloning.
Backup to Reinstall Another System
Backs up the operating system (rootvg) on your current system so that it can be booted and
restored onto another system, without using the original AIX media. This type of backup contains
all the device packages and support for the different platform types and can be used to install
multiple machines, which is particularly convenient when each machine in the system environment
Note: AIX is now available on multiple platforms. Because of the inherent differences between the
architectures, a backup from a POWER-based system cannot be used to restore an
Itanium-based system, and vice versa.
Backup to Restore User Volume Groups
Backs up volume groups other than rootvg (the operating system). Although it can be used to back
up the rootvg, another backup type is usually used because a bootable rootvg backup is much
easier to restore.
Interface Alternatives
Depending on your preference, you can use any of the following to perform a backup or restore:
SMIT (smitty)
The System Management Interface Tool (SMIT) lets you use menus to do multiple system
administrator tasks, eliminating your need to know which commands actually accomplish each
task. If you are using a graphical console, you can run the graphical user interface version of this
tool by typing smit on the command line or you can opt for the faster ASCII version of SMIT by
typing smitty on the command line. If you are using an ASCII console, both smit and smitty start
the ASCII version of the tool. All versions of SMIT offer online help, prompts, lists, and fields to
facilitate your selections.
Command Line
When you know which type of backup you want to do, you can simply enter the appropriate
commands and flags at the system prompt to start a backup or restore. The commands are briefly
described in the following section. Detailed information is available in the related man pages.
Web-based System Manager
This application allows you to do multiple system administrator tasks through wizards, pull-down
menus, and multiple windows. Expanded help is available for each step in a task. You can start
the Web-based System Manager with the wsm command.
Commands
Regardless of whether you use the Web-based System Manager, SMIT, or the command line, AIX uses
the following commands to create backups:
mksysb
Backs up the operating system as part of the rootvg. If a system has been corrupted, for example,
you can use a root volume group backup to restore a system to its original state. If you create the
backup on tape, the tape is bootable and includes the installation programs needed to install from
the backup. The mksysb command creates an image onto tape or in a file. The mkcd command
is used when backing up to CD or DVD.
savevg
Backs up a volume group. The savevg command does not generate a bootable tape, even if the
volume group is the rootvg, so the mksysb command is usually used for the rootvg. The savevg
command creates an image onto tape or in a file for later use. The mkcd command is used when
backing up to CD or DVD.
mkcd Backs up a volume group to a writable CD (AIX Version 4.3.2 with APAR IY03060 and later). The
mkcd command can also back up to DVD media (AIX Version 4.3.3 with APAR IY15536 and later)
if you are using a chrp platform. (To determine whether you are using a chrp system, run bootinfo
-p as root user.) The mkcd command transfers a previously made mksysb image or savevg
When backing up to DVD, the mkcd command assumes the backup media is 4.7 GB. Smaller capacity
DVDs are available and these, too, work with the current software, provided the information being backed
up does not exceed the capacity of a single DVD. Multivolume DVD backups, however, must use 4.7 GB
media.
The file also contains other helpful hints and suggestions for creating CDs or DVDs. The README files
are:
v /usr/lpp/bos.sysmgt/README.oem_cdwriters
v /usr/lpp/bos.sysmgt/README.txt or /usr/lpp/bos.sysmgt/README.html
Notes:
1. If this is a bootable backup, also use the media to test whether it boots on the intended systems.
2. Verification of the backup checks the contents of the backup. It does not perform a bit-by-bit
comparison.
You must have root user authority to complete any of these procedures.
Note: If the system is currently shut down, the drive door might not open. When this is the case,
use the following procedure:
a. Turn on the system.
b. Insert the media in the appropriate drive.
c. Turn off the system and wait 30 seconds.
3. Shut down the system (if it is not already shut down). You can use the shutdown -F command to shut
down the system.
4. Turn the system key for the lock (if your system has one) to the Service position.
5. Turn on all attached external devices, such as terminals, CD-ROM drives, tape drives, monitors, and
external disk drives. (The external devices must be powered on first so that the system unit can detect
them during the startup process.)
6. If you are using a graphical console, skip to the next step. If you are using an ASCII terminal, use the
following criteria to set the communications, keyboard, and display options.
Note: If your terminal is an IBM 3151, 3161, or 3164, press the Ctrl+Setup keys to display the
Setup Menu and follow the on-screen instructions to set the following options. If you are using
some other ASCII terminal, refer to the appropriate hardware documentation to learn how to set
these options. Some terminals have different option names and settings from those listed here.
Communications Options
Option Setting
Line Speed (baud rate) 9600
Word Length (bits per character) 8
Parity no (none)
Number of Stop Bits 1
Interface RS-232C (or RS-422A)
Line Control IPRTS
7. Reboot the machine from the backup media. If you need details about this procedure, see the user’s
guide for your machine. User’s guides for POWER-based systems are available at the following Web
address: http://www.rs6000.ibm.com/resource/hardware_docs. Refer to Intel documentation for
information about Itanium-based systems.
8. Answer the installation questions that display. If the backup was created to use the nonprompted
installation option, no installation questions will display. For more information, see the Installation Guide
for the version of AIX that you are using.
9. When the installation is complete, turn the system key for the lock (if present) to the Normal position.
Note: If the system is currently shut down, the drive door might not open. When this is the case,
use the following procedure:
a. Turn on the system.
b. Insert the media in the appropriate drive.
c. Turn off the system and wait 30 seconds.
3. Shut down the system (if it is not already shut down). You can use the shutdown -F command to
shut down the system.
4. Turn the system key for the lock (if your system has one) to the Service position.
Restoring a Backup 11
12 Backing Up and Restoring Your AIX System
Examples of Command Flexibility
The AIX command structure allows almost infinite flexibility. The following examples show how to use the
command line interface to tailor your backup and restore options.
This example makes a backup of the operating system (rootvg) to the tape device named
/dev/rmt0. The -X flag automatically expands /tmp to whatever size the mksysb
then all the files in any directory named scratch are excluded.
v If the /etc/exclude.rootvg file contains the following:
|./tmp/
then all the files in /tmp/ are excluded, but any other directory named tmp is not
excluded.
Note: All files are backed up relative to the current working directory. This directory is
represented by a . (period). 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) as the
first character in the search string, followed by a . (period), and then the file name or
directory to be excluded.
Back up to a file
mksysb -X -i /mksysb_images/mksysb1
Makes a backup of the operating system (rootvg) to a file named /mksysb_images/mksysb1.
This file is not bootable but can be installed using Network Installation Management (NIM). The file
can be used by the mkcd command as the mksysb image to place onto a CD or DVD. The -X flag
automatically expands /tmp to whatever size the mksysb command requires. The -i option
creates a new image.data file, which contains information about the sizes of all the file systems
and logical volumes in your rootvg.
Back up to a CD-ROM or DVD
mkcd -d /dev/cd1 or mkcd -L d /dev/cd0
Makes a backup of the operating system (rootvg). The first example creates a bootable CD on the
CD-ROM device named /dev/cd1 that can be used to restore the system. The -L flag in the
second example indicates the backup is DVD. The DVD device name in the second example is
/dev/cd0. You must use the -L flag with the mkcd command to create a DVD backup.
Using a previously created mksysb image
mkcd -d /dev/cd1 -m /mksysb_images/mksysb1
Makes a backup of the operating system (rootvg) to the CD-ROM device named /dev/cd1.
This example creates a bootable CD that can be used to restore the system. The -m flag
instructs the mkcd command to use the previously created mksysb image named
/mksysb_images/mksysb1 instead of creating a new mksysb image.
Excluding a set of files
Specify which files are to be excluded in the /etc/exclude.rootvg file, and then type the
following command:
mkcd -d /dev/cd1 -e
This example makes a backup of the operating system (rootvg) to the CD-ROM device
named /dev/cd1. It creates a bootable CD that can be used to restore the system. The -e
option specifies to not back up the files listed in the /etc/exclude.rootvg file. This option
uses the same pattern-matching expressions as the exclude example under Backup to a
Tape Device earlier in this section.
This example makes a generic backup of the operating system (rootvg) to the CD-ROM
device named /dev/cd1. It creates a bootable CD that can be used to restore the
operating system on any system. The -G flag informs the mkcd command that this is a
generic backup. The -p flag informs the mkcd command where the product CD is located,
which in this case is /dev/cd0. The -e flag specifies to not back up the files listed in the
/etc/exclude.rootvg file. The -m flag instructs the mkcd command to use the previously
created mksysb image named /mksysb_images/mksysb1.
then all the files within any directory named scratch are excluded.
v If the /etc/exclude.rootvg file contains the following:
|./tmp/
then all the files in /tmp/ are excluded but any other directory named tmp are not
excluded.
Note: All files are backed up relative to the current working directory. This directory is
represented by a . (period). 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) as the
first character in the search string, followed by a . (period) and then the file name or
directory to be excluded.
This example makes a backup of the volume group named myvg to the tape device named
/dev/rmt1. The -X flag automatically expands the /tmp directory to whatever size the
savevg command requires. The -i flag creates a new myvg.data file, which contains
information about the sizes of all the file systems and logical volumes in the volume group
you are backing up. The -e option specifies to not back up the files listed in the file
/etc/exclude.volume_group_name. Each line in the file /etc/exclude.volume_group_name
is a pattern-matching expression in the grep command format that matches which files are
to be excluded. See the following examples:
v If the /etc/exclude.myvg file contains the following:
/scratch/
then all the files within any directory named scratch are excluded.
v If the /etc/exclude.myvg file contains the following:
|./examples/
then all the files in /examples/ are excluded, but any other directory named examples
is not excluded.
Note: All files are backed up relative to the current working directory. This directory is
represented by a . (period). 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) as the
first character in the search string, followed by a . (period), and then the file name or
directory to be excluded.
Back up to a file
savevg -X –i -f /savevg_images/savevg1 myvg
This example makes a backup of the volume group named myvg to the device named
/dev/cd1. This will create a nonbootable CD that can be used to restore the volume group.
The -e option specifies to not back up the files listed in the file
/etc/exclude.volume_group_name. Each line in the file /etc/exclude.volume_group_name
is a pattern-matching expression in the grep command format that matches which files are
to be excluded. See the following examples:
v If the /etc/exclude.myvg file contains the following:
/scratch/
then all the files within any directory named scratch are excluded.
v If the /etc/exclude.myvg file contains the following:
|./examples/
then all the files in /examples/ are excluded but any other directory named examples is
not excluded.
Note: All files are backed up relative to the current working directory. This directory is
represented by a . (period). 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) as the
first character in the search string, followed by a . (period), and then the file name or
directory to be excluded.
Verifying a Backup
Verifying a rootvg Backup
listvgbackup -f device_name
Lists the contents of a rootvg backup. For example:
listvgbackup -f /dev/rmt0
Restoring a Backup
Restoring a User Volume Group Backup
restvg -f backup_location
Remakes the user volume group and restores the contents of the backup. The following are two
examples:
restvg -f /dev/cd0
restvg -f /savevg_images/savevg1
Restoring a User Volume Group Backup Minimizing Space
restvg -s -f backup_location
Remakes the user volume group and restores the contents of the backup while minimizing the
space required. The following are two examples:
restvg -s -f /dev/cd0
restvg -s -f /savevg_images/savevg1
Restoring Files from a rootvg Backup
restorevgfiles -d restore_location -f backup_location list_of_files
Restores the specified files from a rootvg backup. The following are two examples:
restorevgfiles -d /tmp -f /dev/cd0 ./tmp/file1 ./tmp/file2 ./tmp/file3
restorevgfiles -d /tmp -f /images/rootvg_image1 ./tmp/file1 ./tmp/file2 ./tmp/file3
Restoring Files from a User Volume Group Backup
restorevgfiles -s -d /tmp -f backup_location list_of_files
Restores the specified files from a rootvg backup. The following are two examples:
restorevgfiles -s -d /tmp -f /dev/cd0 ./pictures/pic1 ./pictures/pic2
restorevgfiles -s -d /tmp -f /savevg_images/savevg1 ./pictures/pic1 ./pictures/pic2
For detailed information about the AIX operating system, refer to the following Web address:
http://www.ibm.com/servers/aix/library. AIX library information is listed under Technical Publications.
IBM may have patents or pending patent applications covering subject matter in this document. The
furnishing of this document does not give you any license to these patents. Send license inquires, in
writing, to IBM Director of Licensing, IBM Corporation, New Castle Drive, Armonk, NY 10504-1785 USA.
The information contained in this document has not been submitted to any formal IBM test and is
distributed ″AS IS″. While each item may have been reviewed by IBM for accuracy in a specific situation,
there is no guarantee that the same or similar results will be obtained elsewhere. The use of this
information or the implementation of any techniques described herein is a customer responsibility and
depends on the customer’s ability to evaluate and integrate them into the customer’s operational
environment. Customers attempting to adapt these techniques to their own environments do so at their
own risk.
IBM is not responsible for printing errors in this publication that result in pricing or information inaccuracies.
The information contained in this document represents the current views of IBM on the issues discussed
as of the date of publication. IBM cannot guarantee the accuracy of any information presented after the
date of publication.
Any performance data contained in this document was determined in a controlled environment. Therefore,
the results obtained in other operating environments may vary significantly. Some measurements quoted in
this document may have been made on development-level systems. There is no guarantee these
measurements will be the same on generally available systems. Some measurements quoted in this
document may have been estimated through extrapolation. Actual results may vary. Users of this
document should verify the applicable data for their specific environment.
The following terms are trademarks of International Business Machines Corporation in the United States
and/or other countries: AIX, IBM. A full list of U.S. trademarks owned by IBM can be found at
http://iplswww.nas.ibm.com/wpts/trademarks/trademar.htm. Itanium is a trademark of Intel Corporation in
the United States, other countries, or both. Other company, product and service names may be
trademarks or service marks of others.