Backing Up the Operating System in AIX 4.1


Contents

About this document
mksysb tape images
mksysb file image
Options in creating a mksysb
Verifying a system backup will correctly restore
Restoring

About this document

This document details the commands for creating, verifying, and restoring a system backup in AIX Version 4.1.

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 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.


mksysb tape images

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.


mksysb file image

Creating a mksysb to a file will create a nonbootable, backbyname archive containing only rootvg JFS mounted file systems.


Options in creating a mksysb

Creating to a tape drive

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

  1. Using SMIT:

    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) 
    
  2. Execute:
    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.

Creating a mksysb

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

  2. Unmount all nonessential file systems to reduce the size of the mksysb backup. Try to limit the mksysb to only system file systems if possible.
  3. Be sure to record how many volume groups, what disks they are located on, and the location of each disk. Hdisk#'s are not retained.
        lsvg 
        lsvg -p vgname 
        lsdev -Cc disk 
    

Creating to a file

  1. From SMIT:

    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) 
    
  2. Execute:
    mksysb -i /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 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.

Data verification

    tctl -f /dev/rmt# rewind 
    restore -s4 -Tvqf /dev/rmt#.1 > /tmp/mksysb.log 

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.

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.

  1. Check PROMPT.

    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. 
    
  2. Boot in SERVICE mode
    1. If the system has a key, turn it to service. If the system is keyless, consult the model's documentation.
    2. Insert the mksysb tape into tape drive.
    3. Reboot the system (shutdown -Fr).

  3. The system should now boot from the mksysb 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.

  4. Press F1 or 1 for Console. Press the F1 key for a graphics display and the 1 key for ascii display, and press Enter.

  5. Press 1 for English, if asked.

  6. The Installation and Maintenance menu should display. The system has booted successfully.

  7. Turn the key to normal, or follow the non-key instructions for rebooting into normal mode, and reboot.

Restoring

Restoring a mksysb

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 
  1. Boot in SERVICE mode
    1. If the system has a key, turn it to service. If the system is keyless, consult the model's documentation.
    2. Insert the mksysb tape into the tape drive.

    3. Reboot the system by running the command shutdown -Fr or by pressing the Reset button twice.

  2. The system should now boot from the mksysb tape.

    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.

  3. A message should state, press F1 or 1 for Console. Press the F1 key for a graphics display and the 1 key for ascii display, and press Enter.

  4. Press 1 for English, if asked.

  5. The Installation and Maintenance menu should display. If the system was booted from media other than the mksysb tape, the tape can now be inserted into the tape drive. Follow the steps listed in the subsection, "Restore menus".

  6. After the restore is complete, turn the key to Normal. If the system is keyless, this is automatic.

  7. The system will reboot once. The system events system events from inittab and a login prompt should appear.

    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.

  8. If there are other disks which contain other volume groups, they will need to be imported into the newly created ODM. No references to the other volume groups exist prior to this step. This can be done by completing the following steps:

    1. Match the newly labeled hdisk#'s to the appropriate SCSI location IDs. Do not assume that the hdisks will be at the same location. The disks are re-numbered 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 vg 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, by executing:
          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.

    5. A login prompt should now be displayed.

Restore menus

  1. Installation and Maintenance Menu, select (3)
        1)  Start Installation Now with Default Settings 
        2)  Change/ Show Installation Settings and Install 
        3)  Start Maintenance Mode for System Recovery 
    
  2. Maintenance Menu, select (4)
        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 
    
  3. Choose a Tape Drive, select (# of tape)
            Tape Drive              Path Name 
        1. tape /scsi/8mm         /dev/rmt# 
    
  4. Select a Language, if asked, select (# for language)
        1)  Type 1 and press Enter to have English during install. 
    
  5. Installation and Maintenance Menu, select (2)
        1)  Start Installation Now with Default Settings 
        2)  Change/ Show Installation Settings and Install 
        3)  Start Maintenance Mode for System Recovery 
    
  6. System Backup Installation and Settings, select (1)
           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. 
    
  7. Change Disk(s) Where You Want to Install, select (# of disk(s)),(0)

    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 
    
  8. To shrink the file systems to reclaim free space allocated to the file systems, select option 2 so that the setting is set to Yes. To restore file systems with the same allocated space as the original system, then make sure option 2 is set to No.

  9. System Backup Installation and Settings, select (0 to continue)
           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. 
    
  10. There will then be a message stating, select Y to continue.
WARNING: All data on the selected disks will be destroyed. Do you wish to continue? Y/N

Restoring individual files from a mksysb tape

  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 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
    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 ]