This document details the commands for creating, verifying, and restoring a system backup in AIX Version 4.1.
The IBM AIX UNIX is different from other UNIXs for two main reasons: the Object Database Manager (ODM) and the Logical Volume Manager (LVM). It is because of the ODM and the LVM, as well as the ability to have multiple volume groups, that complete system archive made with cpio or tar will not restore properly. Attempting to restore such an archive on a running system can potentially crash the machine.
Creating a mksysb to a tape drive will create a bootable tape. There will be four images on the tape. The fourth image will contain only rootvg JFS mounted file systems. The target tape drive must be local to create a bootable tape.
The following is a description of mksysb's four images.
--------------------------------------------------------- | Bosboot | Mkinsttape | Dummy TOC | rootvg | | Image | Image | Image | data | |----------- -------------- ------------- ----------------| |<----------- Block size 512 ----------->| Blksz defined | | | by the device. | ---------------------------------------------------------
Image #1: The bosboot image contains a copy of the system's kernel and specific device drivers allowing the system to boot from this tape.
blocksize: 512 format: raw image files: kernel device drivers
Image #2: The mkinsttape image contains files to be loaded into the ram file system when booting in maintenance.
blocksize: 512 format: backbyname files: ./image.data, ./tapeblksz, ./bosinst.data and commands
Image #3: The dummy image contains a single file containing the words dummy toc. This image is used to make the mksysb tape contain the same number of images as a BOS Install tape.
Image #4: The rootvg image contains data from the rootvg volume group (mounted JFS file systems only).
blocksize: determined by tape drive configuration on create format: backbyname files: rootvg, mounted JFS file systems
WARNING: If the device blocksize is set to 0, mksysb will use a hardcoded value of 512 for the fourth image. This can cause the create and restore to take 5-10 times longer than expected.
Creating a mksysb to a file will create a nonbootable, backbyname archive containing only rootvg JFS mounted file systems.
NOTE: A mksysb tape is only bootable when it is created to a tape drive.
Fill in the correct device name to be used. Press Enter to start the backup. If more than one tape is required, SMIT will give a prompt to change the tape.
smit mksysb Backup DEVICE or FILE [/dev/rmt#] Create MAP files? no EXCLUDE files? no Make BOOTABLE backup? yes (Applies only to tape) EXPAND /tmp if needed? yes (Applies only to bootable tape) Number of BLOCKS to write in a single output [ ] (Leave blank to use a system default)
mksysb -i /dev/rmt# 2>/tmp/mksysb.err
WARNING: If the device blocksize is set to 0, mksysb will use a hardcoded value of 512 for the fourth image. This can cause the create and restore to take 5-10 times longer than expected.
lsvg lsvg -p vgname lsdev -Cc disk
A mksysb image file is created in the same manner as the bootable tape described in the section, Creating to a tape Drive. The only difference is as d follows:
smit mksysb Backup DEVICE or FILE [/path/file] Make BOOTABLE backup? no (Applies only to tape)
mksysb -i /path/file 2>/tmp/mksysb.err
The only method to verify that a system backup will correctly restore with no problems is to actually restore the mksysb onto another machine. This should be done following the company's Disaster Recovery Plan.
To minimize problems due to tape media damage, the following tests may be performed:
WARNING: These tests only verify that the tape media can be read on this machine and will not guarantee that a mksysb will be restored successfully.
smit lsmksysb DEVICE or FILE [/dev/rmt#] Number of BLOCKS to read in a single input [ ] (Leave blank to use a system default)
Type or select values and press Enter only AFTER making the desired changes.
tctl -f /dev/rmt# rewind restore -s4 -Tvqf /dev/rmt#.1 > /tmp/mksysb.log
The only way to verify that the mksysb tape will successfully boot is to bring the machine down and boot from the tape. No data needs to be restored.
NOTE: To boot a keyless system or a system with multiprocessors in service mode, consult the model's documentation.
WARNING: Having the PROMPT field in the bosint.data file set to no causes the system to begin the mksysb restore automatically using preset values with no user intervention.
If the state of PROMPT is unknown, this can be set during the boot process. After answering the prompt to select a console during the boot up, a rotating character will be seen in the lower left of the screen. As soon as this character appears, type 000 and press Enter. This will set the prompt variable to yes.
To check a mksysb tape to see how the PROMPT is set, run the following while in normal mode:
chdev -l rmt# -a block_size=512 tctl -f /dev/rmt# rewind cd /tmp restore -s2 -xvqf /dev/rmt#.1 ./bosinst.data cat bosinst.data Check the PROMPT field in the control_flow stanza.
NOTE: Multiprocessor systems display a maintenance menu called a BUMP MENU. This is a hardware menu. For more information, consult the model's documentation.
Be sure to select all physical volumes required for the root volume group. This is especially important if there is mirroring. Mirrored disks must be selected at the time of installation or an error message will be displayed. For example:
not enough physical volumes
If the tape will not boot, remove the tape and boot from install media such as a cdrom or tape.
NOTE: Multiprocessor systems display a maintenance menu called a BUMP MENU. This is a hardware menu. For more information, consult the model's documentation.
NOTE: If there are volume groups other than rootvg, there may be error messages prior to a login prompt. Ignore these messages unless they prevent the prompt from appearing.
NOTE: Total restore time varies from system to system. A good rule of thumb, providing the device blocksize is not set to 0, is twice the amount of time it took to create the mksysb.
If the blocksize of the source tape drive was 0, the mksysb would have been created with a blocksize of 512. In this case, there is a restore time of 5-10 times longer than is normally expected.
Execute:
lsdev -Cc disk
Execute:
importvg -y vgname hdisk#
For example, if there is another vg named "data" and it resides on "hdisk3" and "hdisk4", execute:
importvg -y data hdisk3
varyonvg vgname
shutdown -Fr
NOTE: If the system is not to be rebooted again, use mount -a in place of shutdown. This will mount all the new file systems. A system reboot should be scheduled as soon as possible to be sure that everything is in sync.
1) Start Installation Now with Default Settings 2) Change/ Show Installation Settings and Install 3) Start Maintenance Mode for System Recovery
1) Access a Root Volume Group 2) Copy a System Dump to Removable Media 3) Access Advanced Maintenance Functions 4) Install from a System Backup
Tape Drive Path Name 1. tape /scsi/8mm /dev/rmt#
1) Type 1 and press Enter to have English during install.
1) Start Installation Now with Default Settings 2) Change/ Show Installation Settings and Install 3) Start Maintenance Mode for System Recovery
Setting: Current Choice(s): 1. Disk(s) where you want to install......... hdisk0 Use Maps.................................. No 2. Shrink File Systems....................... No 0. Install with the settings listed above.
Type the numbers for the disk to be used for installation and press Enter. The current choice is indicated by >>>. To deselect a choice, type the corresponding number and press Enter. At least one bootable disk must be selected. Choose the location by SCSI ID.
Name Location Code Size (MB) VG Status Bootable 1. hdisk0 00-01-00-0,0 305 rootvg yes 2. hdisk1 00-01-00-1,0 400 rootvg yes 0. Continue with the choices indicated above
Setting: Current Choice(s): 1. Disk(s) where you want to install......... hdisk0 2. Use Maps.................................. No 3. Shrink File Systems....................... No 0. Install with the settings listed above.
cd /tmp tctl -f /dev/rmt# rewind (# to be replaced by a number) chdev -l rmt# -a block_size=512 restore -s2 -xqdvf /dev/rmt#.1 ./tapeblksz cat ./tapeblksz
The output given will be the blocksize the tape drive was set to when the mksysb was made.
chdev -l rmt# -a block_size=[number in the ./tapeblksz file]
cd / (if the file is to be restored to its original place)
tctl -f /dev/rmt# rewind
restore -s4 -xqvf /dev/rmt#.1 ./dir/filename (for one file)
Or
restore -s4 xqdvf /dev/rmt#.1 ./dir   (for all files in the directory).
[ Doc Ref: 90605209414758 Publish Date: May. 19, 2000 4FAX Ref: 8165 ]