Backing Up the Operating System AIX 3.2.5


Contents

About this document
mksysb tape images
mksysb file image
Creating to a tape drive
Creating to a file
Verifying a system backup will correctly restore
Restoring
Tips on creating a mksysb

About this document

This document details the commands for creating, verifying, and restoring a system backup in AIX Version 3.2.5. It is only applicable to version 3.2.5. This document should only be used as a supplement to the AIX System Management Guide.

Why a mksysb

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 archives made with cpio or tar will not restore properly. Attempting to restore such an archive on a running system can potentially crash the machine.


mksysb tape images

Creating a mksysb to a tape drive will create a bootable tape, four images on the tape, and 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:                     ./.fs.size, ./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 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:                 defined by SMIT device on create 
    format:                    tar 
    files:                     rootvg, mounted jfs file systems 

mksysb file image

Creating a mksysb to a file will create a non-bootable, tar archive containing only rootvg jfs mounted file systems.


Creating to a tape drive

NOTE: A mksysb tape is ONLY bootable when it is created to a local tape drive.

    mkszfile && mksysb /dev/rmt# 2>/tmp/mksysb.err 

Creating to a file

NOTE: A mksysb created to a file is NOT bootable.

    mkszfile && mksysb /path/file 2>/tmp/mksysb.err 

Verifying a system backup will correctly restore

The only method to verify that a system backup will correctly restore without 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 can be performed.

WARNING:These tests only verify that the tape media can be read on this machine and will not guarantee that the mksysb will be restored successfully.

Data verification

    tctl -f /dev/rmt# rewind 
    tctl -f /dev/rmt#.1 fsf 3 
    tar -tvf /dev/rmt# > /tmp/log 

Let the table of contents run to completion to be sure that there are no "bad spots" on the tape.

Boot verification

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.

  1. To set the system up for reboot, turn the key to service.

  2. Insert the mksysb tape into tape drive.

  3. Reboot the system, shutdown -Fr.

  4. The system should now "boot" from the mksysb tape.

  5. A message should display stating, "press F1 or 1 for Console". Press the F1 key for a graphics display or the 1 key for an ASCII display, and press Enter.

  6. The Installation and Maintenance menu should display.

  7. If no error messages are displayed, the system has booted.

  8. Turn the key to normal and reboot the system.

Restoring

WARNING: A mksysb at AIX 3.2.5 can ONLY be restored back to the original system with the exact hardware which existed on the system at the time the mksysb was created. It can be restored to the same system or a different system as long as the mksysb contains ALL device driver support for the hardware located on the target system.

  1. Turn the key to service, insert the mksysb tape, and reboot the system by pressing the Reset button two times. If the system is up in normal, it will need to be rebooted with shutdown -Fr.

  2. A message should be seen stating, "press F1 or 1 for Console". Press the F1 key for a graphics display or the 1 key for an ASCII display, and press Enter.

  3. The Installation and Maintenance menu should display. Follow the screens in the Restore Menu section below. If booting from media other than the mksysb tape, reinsert the tape into the tape drive.

    NOTE: At AIX 3.2, certain information is "assumed" upon system restoration. To be sure that the target system will have enough disk space, the following information can be assumed:

        Paging Space (PAGING) 
        /dev/hd6 
    

    Paging space for the target system is calculated from the amount of RAM present on the target system. Paging is spread over all rootvg disks, and should never take more than 20% of any one physical volume.

          < 64mb of ram on target system    paging = ram * 2mb 
          >=64mb of ram on target system    paging = ram + 16mb 
    Boot Logical Volume (BLV) 
    /dev/hd5 
          2PP's = 8mb 
    System Dump Device (SYSDUMP) 
    /dev/hd7 
          2PP's = 8mb 
    Rootvg JFS Log Device (JFSLOG) 
    /dev/hd8 
          1PP   = 4mb 
    
  4. After the restore is complete, turn the key to normal.

  5. The system will reboot once. There may be some error messages. Ignore these messages. The system will then resync and reboot a second time. A login prompt should appear.

    NOTE: If there are volume groups other than rootvg, error messages may display 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, provided 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 device is 0, expect to see a restore time of 5-10 times that it took to create the mksysb.

  6. If there are other disks which contain other volume groups, these will need to be imported into the newly created ODM. No references to other volume groups exist prior to this step. This can be done by:
    1. Match the newly labeled hdisk#'s to the appropriate SCSI location ID's. DO NOT ASSUME that the hdisks will be at the same location. The disks are renumbered from lowest to highest location number and labeled accordingly.

      Execute:

          lsdev -Cc disk 
      
    2. Import each volume group into the new ODM. The following must be run for each non-rootvg volume group. However, only one disk per volume group need be selected.

      Execute:

          importvg -y vgname hdisk# 
      

      For example, if there is another volume group named "data" and it resides on hdisk3 and hdisk4, execute:

          importvg -y data hdisk3 
      
    3. Activate each non-root volume group by entering:
          varyonvg vgname 
      
    4. Restart the system to resync the ODM and mount all file systems.
          shutdown -Fr 
      

      NOTE: In order not to reboot the system again, the command mount -a can be used in place of shutdown. This will mount all the new file systems. However, a system reboot should be schedule as soon as possible to be sure that everything is in sync.

    5. The login prompt should be displayed.

Restoring menus

  1. Installation and Maintenance Menu, select (2)
        1)  Install AIX 
        2)  Install a system that was created with SMIT 
            "Backup the System" or the "mksysb" command. 
        3)  Install the system for use with a "/usr" server. 
        4)  Start a limited function maintenance shell 
    
  2. Current System Settings, select (1)
        1)  INPUT Installation Device 
        2)  DESTINATION Disks 
        3)  STARTUP (Boot) Disks 
            0. Continue 
    
  3. Change Input Device, select (# of tape), (99)
           DEVICE TYPE     PATHNAME        LOCATION CODE 
        1. 8mm Tape:      /dev/rmt#       00-01-00-40 
        99. Return to previous menu 
    
  4. Current System Settings, select (2)
        1)  INPUT Installation Device 
        2)  DESTINATION Disks 
        3)  STARTUP (Boot) Disks 
            0. Continue 
    
  5. Change the Destination Hard Disk(s), select (# of disk(s)), (99)

    Type one or more numbers for the disk(s) to be used for installation and press Enter. The current choice is indicated by >>>. To de-select a choice, type the corresponding number and press Enter. At least one bootable disk must be selected.

    NOTE: Be sure to know the disk by SCSI ID. Hdisk#'s will not be present. Selecting the wrong disk will cause data on those disks to be lost.

          LOCATION CODE   SIZE (MB) VOLUME GROUP ID   BOOTABLE DISK 
        1. 00-01-00-00       320     00032471ba62a672      YES 
        2. 00-01-00-10       400     00032471ba62a672      YES 
        99. Return to previous menu 
    
  6. Current System Settings, select (3)
        1)  INPUT Installation Device 
        2)  DESTINATION Disks 
        3)  STARTUP (Boot) Disks 
            0. Continue 
    
  7. Change Startup Disk, select (# of disk(s))

    Type one number for the disk to be used to boot and press Enter. Be sure and choose the disk by the SCSI ID. Hdisk# will not be present.

           STARTUP DISK 
        1. 00-01-00-00 
        2. 00-01-00-10 
    
  8. Current System Settings select (0)
        1)  INPUT Installation Device 
        2)  DESTINATION Disks 
        3)  STARTUP (Boot) Disks 
            0. Continue 
    
  9. A message stating, select "Y" to continue, will be seen.
WARNING: All data on the selected disks will be destroyed. Do you wish to continue? Select "Y/N".

Restoring individual files and directories from mksysb in normal mode

  1. To restore individual files or directories from a mksysb tape, obtain the blocksize of the fourth image. To obtain this information, enter:
    	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 that is given will be the blocksize the tape drive was set to when the mksysb was made.

  2. The blocksize of the tape drive needs to be set accordingly by entering:
      chdev -l rmt# -a block_size=[number in the ./tapeblksz file] 
    
  3. The files or directories need to be restored by entering:
        cd /   (if the file is to be restored to its original place) 
        tctl -f /dev/rmt# rewind 
        tctl -f /dev/rmt#.1 fsf3 
        tar -xvf /dev/rmt#.1 ./dir/filename  (for one file) 
    

    Or

        tar -xvf /dev/rmt#.1 ./dir  (for all files in directory) 
    

Tips on creating a mksysb

  1. The file system /tmp must have at least 8MB free just prior to creating the mksysb.

  2. mksysb DOES NOT preserve mirroring. Break all mirrors.

  3. Be sure to record how many volume groups there are, what disks they are located on, and the location of each disk. Hdisk#'s are NOT retained.
        lsvg 
        lsvg -p <vgname> 
        lsdev -Cc disk 
    
  4. If the ksh option noclobber is set in either the /etc/environment file or in /.kshrc, the mksysb will fail in the BOSboot section of the script.



[ Doc Ref: 90605209214756     Publish Date: Jul. 02, 1999     4FAX Ref: 7469 ]