DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Creating and using emergency recovery media

Creating and using emergency recovery media

Emergency recovery media enable you to recover your system if your hard disk experiences an unrecoverable error. You should create emergency recovery media immediately after you install your system, and again each time you add or change system hardware and software.

The emergency recovery media consist of:

The emergecny recovery boot media and tapes are usually created right after you install your system, and do not need to be re-created unless you change your system configuration. Additional backups should be taken periodically, so that user and application data can be preserved.

The following topics describe:

Keys to recovering your system

To ensure that you always have a set of emergency recovery media and data backups, we strongly recommend that you:

The emergency recovery boot media contains a small, bootable image from which you can boot your system.

The emergency recovery tapes contain an image of critical filesystems.

By first booting your system with the emergency boot media and then restoring it from the emergency tapes, you restore all the system software and filesystems. that existed when you created the boot media.


NOTE: If your system does not have a tape drive, you should still create emergency recovery boot media and then back up the entire system onto other media or across the network.

Performing regular system backups ensures that data added to your system after the creation of the emergency recovery media can also be restored. Data created after the most recent backup may be lost if your hard disk fails.

The system owner can back up the entire system on a regular basis. Individual users without owner privileges can perform backups of their own directories.

To ensure that you back up not only data but also any extended file attributes (such as privileges and ACLs), use cpio.

See the cpio manual page for more information.

Creating emergency recovery boot media

For instructions on creating an emergency recovery boot CD, see the emergency_disk(ADM) manual page. The following is an example of creating boot diskettes.

  1. Use the format(ADM) command to create two formatted diskettes. For example, this command creates a formatted, 1.44MB diskette in the primary diskette drive:

    format -v /dev/rdsk/f03ht

  2. Label the diskettes with the name of the system, date created, and their name and number. For example:
    mymachine		mymachine
    22 June 2001		22 June 2001
    Emergency Recovery	Emergency Recovery
    Diskette 1 		Diskette 2
    


    NOTE: Emergency recovery disks are customized for a particular system and only work on that system.

  3. Switch from the graphical environment to the system console, by pressing <Ctrl><Alt><Esc>. Log in to the system console as root.

  4. Ensure that /var is mounted.

  5. Make sure there are no active users on the system. Enter:

    who

  6. If root is the only user logged in, bring the system to single-user mode with this command:

    shutdown -y -g0 -i1

    If other users are listed, bring the system to single-user mode with this command:

    shutdown -y -g300 -i1

    The -g300 flag in this command allows users 5 minutes (300 seconds) to close their files and log out. A broadcast message from root provides warnings that the system is coming down.

  7. After the system enters single-user mode, determine in which filesystem you will create the recovery media. The filesystem must contain at least 30 MB of free space.

    To determine which filesystems have enough space, enter:

    /sbin/dfspace

    For example, you might see:

    /        : Disk space:  195.10 MB of  429.00 MB available (45.48%)
    /stand   : Disk space:    5.82 MB of    9.99 MB available (58.28%)
    /home    : Disk space:  238.86 MB of  479.00 MB available (49.87%)
    /tmp     : Disk space:    7.98 MB of    8.00 MB available (99.85%)
    /var/tmp : Disk space:    9.99 MB of    8.99 MB available (90.00%)
    

    In this example, only the root (/) and /home filesystems have enough space to be used in creating the emergency recovery media.

  8. Enter:

    /sbin/emergency_disk -d pathname diskette

    pathname is the filesystem you selected. diskette is the diskette drive where you will insert the diskette (either diskette1 or diskette2).

    The following example creates an emergency recovery diskette on the first diskette drive, using the /home filesystem as its working directory:

    /sbin/emergency_disk -d /home diskette1

  9. When prompted, insert the first formatted disk into the appropriate diskette drive.

    Creating each emergency recovery disk takes about fifteen minutes.

  10. When prompted, remove the first diskette, insert the second diskette and press <Enter>.

  11. When prompted, remove the diskette from the diskette drive.

    Store the emergency recovery disks in a secure location.


NOTE: When you try to create a set of emergency floppies, you may fail and encounter messages stating that modules such as /dev/dsk/c0b0t0d0s? and /home2 could not be found. If this occurs, you should comment out the /home2 line in /etc/vfstab.

After you create the emergency recovery diskettes, do one of the following:

Creating emergency recovery tapes

Emergency recovery tapes allow you to restore your system and its data to the configuration stored on the media. To create emergency recovery tapes:

  1. Locate and label tapes for this procedure. Include the system name, date the tapes were created, and sequence number.

    The number of tapes needed varies according to the size and configuration of your system.

  2. Switch from the graphical environment to the system console, by pressing <Ctrl><Alt><Esc>. Log in to the system console as root.

  3. If the system is already in single-user mode, skip to step 5. Otherwise, make sure there are no active users on the system. Enter:

    who

  4. If root is the only user logged in, bring the system to single-user mode with this command:

    shutdown -y -g0 -i1

    If other users are listed, bring the system to single-user mode with this command:

    shutdown -y -g300 -i1

    The -g300 flag in this command allows users 5 minutes (300 seconds) to close their files and log out. A broadcast message from root provides warnings that the system is coming down.

  5. At the single-user prompt (#), insert the first emergency recovery tape into the appropriate cartridge tape drive.

  6. Create the emergency recovery tapes using either step a or step b.

    a.
    Use this step only if only one hard disk is installed, and this disk also contains partitions for other operating systems. Enter:

    /sbin/emergency_rec -e tape tapesize

    The -e option tells emergency_rec to back up the entire primary hard disk.

    tape is the tape drive location of your inserted tape (ctape1 or ctape2).

    tapesize is the size of the tape specified either as a number of 512-byte blocks or as a number with a suffix of k, M or G to indicate kilobytes, megabytes or gigabytes. For example, a tapesize of 512000 or 250M would indicate that the tape can hold 250MB of data. If the hard disk is larger than the capacity of a single tape, you are prompted to insert additional tapes as needed.


    NOTE: You can omit tapesize if the capacity of a single tape is larger than the size of the entire hard disk.

    Wait for this command to finish processing and then go to Step 7.


    b.
    Use this step for a multiple hard disk system or a single disk system that does not meet the conditions in Step 8a.

    Enter:

    /sbin/emergency_rec tape

    tape is the tape drive location of your inserted tape (ctape1 or ctape2).

    The emergency_rec command (without the -e option) backs up:

    • all active partitions on your primary hard disk

    • the /home, /home2, /var, and /usr filesystems from the secondary hard disk, if they exist there


      NOTE: The emergency_rec command does not back up any other filesystems on the secondary disk, nor any filesystems on additional hard disks.

      To back up these filesystems and volumes, see ``After creating emergency recovery tapes''.


      You are prompted to insert additional tapes as needed.

  7. Remove the last tape from the tape drive.

  8. Store the emergency recovery tapes with the emergency recovery floppy disks in a secure location.

Handling tape error messages

The following error messages may appear when you create emergency recovery tapes:

After creating emergency recovery tapes

After you create the emergency recovery tapes, either:

Emergency recovery with an encapsulated or mirrored root disk

There are three phases to performing an emergency recovery with an encapsulated or mirrored root disk:

  1. ``Creating the Emergency Recovery boot media and tapes''

  2. ``Bringing the system back after emergency media is created''

  3. ``Performing recovery when the primary and mirrored root disks fail''


WARNING: If the following procedures are not adhered to exactly, it may result in your system entering an unrecoverable state.

During the following process, use the vxprint(ADM) command to obtain information about the encapsulated root disk and the disk to which it is mirrored. In this example, an initial install was done with all additional filesystems created, and mirrored onto another disk. Your installation may differ, so you may have a different number of partitions on the root disk. This procedure is valid for recovering from a disaster where the primary and mirror disks both fail, and ODM was used only to encapsulate the root disk and mirror it. Information on any other ODM disks should be saved so that they may later be restored.

Creating the Emergency Recovery boot media and tapes

  1. Bring the machine down to init state 1 and log in as root

  2. Run vxconfigd(ADM) to start up the ODM configuration daemon

  3. Use vxplex(ADM) to disconnect the mirrored root plexes, for example:

    vxplex dis home-02
    vxplex dis home2-02
    vxplex dis rootvol-02
    vxplex dis standvol-02
    vxplex dis swapvol-02
    vxplex dis tmp-02
    vxplex dis var-02

  4. Set up the kernel to ignore the ODM configuration:

  5. Rebuild the kernel:

    /etc/conf/bin/idbuild -B

  6. Reboot using the init 6 command.

    If you changed the initdefault entry in Step 4, then you do not need to interrupt the reboot. If you did not change the initdefault entry, when you see the system logo appear, immediately press <Space> to enter the Bootstrap Command Processor. Enter the command initstate=1, followed by boot. This will cause the machine to boot into single-user mode.

  7. If you edited the initdefault entry in Step 4, change the initdefault entry back to ``3''.

  8. Run the emergency_disk(ADM) and emergency_rec(ADM) commands.

Bringing the system back after emergency media is created

  1. Undo the steps in step 4 of the previous procedure to restore the ODM configuration. When you use mknod(ADM) to create the /.io/bootdisk/*root nodes, use the major and minor numbers listed by the following command:

    ls -l /dev/vx/dsk/rootvol

  2. Rebuild the kernel again:

    /etc/conf/bin/idbuild -B

  3. Reboot using the init 6 command. When you see the system logo appear, immediately press <Space> to enter the Bootstrap Command Processor. Enter the command initstate=1, followed by ``'boot'''. This will cause the machine to boot into single-user mode.

  4. When the system comes back up, log in as root, and run vxconfigd(ADM) to start the ODM configuration daemon

  5. Re-attach the plexes disconnected earlier, for the mirrored disk.

    For example:

    vxplex att home home-02
    vxplex att home2 home2-02
    vxplex att rootvol rootvol-02
    vxplex att standvol standvol-02
    vxplex att swapvol swapvol-02
    vxplex att tmp tmp-02
    vxplex att var var-02

    You should also remove the comments from other ODM-defined slices you previously commented out.

  6. Reboot using init 6 and let the machine boot all the way into multiuser mode.

Performing recovery when the primary and mirrored root disks fail

  1. Boot from the Emergency Recovery diskettes or CD.

    A message should be displayed indicating that the system is not sane.

    Continue to the Emergency Recovery menu and perform the Restore Disk(s) process.

  2. After the recovery has completed, select the option to Reboot. When you see the system logo appear, immediately press <Space> to enter the Bootstrap Command Processor. Enter the command initstate=1, followed by ``boot''. This will cause the machine to boot into single-user mode.

  3. Enter the following command:

    rm /etc/vx/reconfig.d/state.d/install-db

  4. Run vxconfigd to remove all information about the mirrored disk:

    vxplex -o rm dis home-02
    vxplex -o rm dis home2-02
    vxplex -o rm dis rootvol-02
    vxplex -o rm dis standvol-02
    vxplex -o rm dis swapvol-02
    vxplex -o rm dis tmp-02
    vxplex -o rm dis var-02
    vxedit rm disk01

  5. Run /etc/vx/bin/vxunroot.

  6. Remove the VOLPUBLIC partition from both the root disk and the mirrored disk, if they exist:

    prtvtoc -f /tmp/vtoc /dev/rdsk/c0b0t0d0s0

    Edit the /tmp/vtoc file and change the line that is similar to this:

    14	0xe	0x201	2048	2064384
    
    to:
    14	0x0	0x0	0	0
    
    Then rewrite the VTOC:

    edvtoc -f /tmp/vtoc /dev/rdsk/c0b0t0d0s0

    Reboot using the init 6 command. When you see the system logo appear, immediately press <Space> to enter the Bootstrap Command Processor. Enter the command initstate=1, followed by ``boot''. This will cause the machine to boot into single-user mode. Ignore the vxconfigd errors.

  7. Run vxinstall to re-install ODM and re-encapsulate root. After the three reboots take place, you can re-mirror the root disk, add any other ODM disks, and restore the data to them. The machine will be running in multiuser mode.

Recovering an unusable system

If your system will not boot, your system software is corrupted beyond repair, or your hard disk has been reformatted or replaced, you can use your emergency recovery boot media, tapes, and incremental backups to restore your system.

Before attempting to restore the system, ensure that your motherboard, hard disks, memory, and peripherals are in good working order. Do so by running any hardware diagnostics included with your system by the manufacturer. While this recovery procedure restores all the system software, applications, and data on the recovery media to your hard disk, it does not ensure proper operation of the system hardware.

To recover the system:

  1. Boot the system using the emergency recovery boot media (diskettes or CD). Enter your licensing information when prompted.

  2. Correct the system damage or restore data from the emergency recovery tapes.

    The emergency recovery main menu provides options to start a limited command-line shell to restore data from emergency recovery tapes, to mount or unmount all filesystems (if data is accessible on the hard disk), and to reboot the system.

  3. Use the up or down arrow keys or the <Tab> key to select the desired choice and then press <Enter>.

  4. Remove the emergency recovery boot media. If you restored the system from the emergency recovery tapes, you can remove the last tape from the tape drive at this time.

  5. Press <Esc> to reboot your system.

    You may notice error messages similar to the following:

    UX: initprivs: WARNING: File ``file'' fails validation: entry ignored
    UX: initprivs: WARNING: X entries ignored in ``/etc/security/tcb/privs''
    
    This is because the date stamp for the inode was changed during the restore process.

    You can fix these errors after your system boots into multi-user mode, by logging in as root and entering the following command:

    /etc/security/tools/setpriv -x

  6. If you created any full or incremental backups of your system after creating the emergency recovery tapes, restore those backups using the restore method corresponding to the backup method you used to create them.

    For example, if you created backups using the cpio(C) command, use the same method to restore the archive.


© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 02 June 2005