Silicon Graphics

IRIX Advanced Site and Server Administration Guide

[Previous Section] [Back to Table of Contents] [Next Section]

IRIX Advanced Site and Server Administration Guide

[Collapse Level] Chapter 6 Backing Up and Restoring Files


Restoring Files and File Systems

The principal reason to make backups of system files is to protect those files from loss in the event of human error or hardware failure. When a file is lost, it must then be restored from a backup. Sometimes entire file systems are lost and must be reconstructed from backups.

Restoring File Systems

You restore an entire file system if there has been data corruption (for example, due to bad tracks); if you remade the file system (for example, if you replaced a disk drive); or if all the files have been accidentally removed.

Restoring a File System From the System Maintenance Menu

If your root file system is damaged and your system cannot boot, you will need to restore your system from the System Maintenance Menu. This is the menu that appears when you interrupt the boot sequence before the operating system takes over the machine. To perform this recovery, you need two different tapes: your system backup tape and a bootable tape with the miniroot.

To be used with the System Recovery option of the System Maintenance Menu, the backup tape must have been created with the System Manager or with the Backup(1) command and must be a full system backup (beginning in the root directory (/) and containing all the files and directories on your system). Although the Backup(1) command is a front-end interface to the bru(1) command, Backup also writes the disk volume header on the tape so that the System Recovery option can reconstruct the boot blocks, which are not written to the tape using other backup tools.

For information on creating the system backup, see "Backing Up File Systems". For information on creating the bootable tape, see "Making a Bootable Tape".

If you do not have a full system backup made with the Backup command or System Manager, you will have to reinstall your system if your root or usr file systems are so badly damaged that the operating system cannot boot.

If you need to reinstall the system to read your tapes, install a minimal system configuration and then read your full system backup (made with any backup tool you prefer) over the freshly installed software. Existing files of the same path name on the disk are overwritten during a restore operation, even if they are more recent than the files on tape. This procedure should restore your system to its former state.

  1. When you first start up your machine, you see the following prompt:

    Starting up the system....
    To perform system maintenance instead, press <Esc>
  2. Press the <Esc> key. You see the following menu:

    System Maintenance Menu
    1   Start System
    2   Install System Software
    3   Run Diagnostics
    4   Recover System
    5   Enter Command Monitor
  3. Enter the numeral 4, and press <Return>. You see the message:

    System Recovery...
    Press Esc to return to the menu.

    After a few moments, you see the message:

    Insert the installation tape, then press <enter>: 
  4. Insert your bootable tape or your original distribution (CD or tape) and press the <Enter> key. You see some messages while the miniroot is loaded. Next you see the message:

    Copying installation program to disk....

    Several lines of dots appear on your screen while this copy takes place.

  5. You see the message:

    CRASH RECOVERY
    You may type sh to get a shell prompt at most questions.
    Remote or local restore: ([r]emote, [l]ocal): [l]
  6. Press <Enter> for a local restoration. If your tape drive is on another system accessible by the network, press r and then the <Enter> key. You are prompted for the name of the remote host and the name of the tape device on that host. If you press <Enter> to select a local restoration, you see the message:

    Enter the name of the tape device: [/dev/tape] 

    You may need to enter the exact device name of the tape device on your system, since the miniroot may not recognize the link to the convenient /dev/tape file name. As an example, if your tape drive is drive #2 on your integral SCSI bus (bus 0), the most likely device name is /dev/rmt/tps0d2nr. If it is drive #3, the device is /dev/rmt/tps0d3nr.

  7. The system prompts you to insert the backup tape. When the tape has been read back onto your system disks, you are prompted to reboot your system.

Procedure for System Recovery from a Remote Tape Drive

Ensure that you have a Silicon Graphics distribution tape with installation tools on it. It will say, ContainsInstallationTools.

  1. Determine the remote tape drive you are using.

  2. Insert the tape in the remote drive.

  3. Execute the mtret command on all backup tapes you will be using.

  4. You must edit the /usr/etc/inetd.conf file on the remote system with the tape drive before continuing (each entry below will appear on one continuous line with commands separated by tabs):

    Find this entry:

    tftp dgram udp wait guest /usr/etc/tftpd tftpd -s /usr/local/boot

    And change it to read as follows:

    tftp dgram udp wait guest /usr/etc/tftpd tftpd 
  5. Bring the system you are recovering to the System Maintenance Menu.

  6. Select option 5) Command Monitor from the System Maintenance Menu.

  7. Enter the commands:

    setenv netaddraddress (address = your internet address)

    init

    exit 
  8. Select 4) Recover System from the System Maintenance Menu.

  9. Follow the directions for recovering from the backup tapes.

  10. When done, exit the program and bring up the system.

Restoring a File System with bru

Complete information on using the bru command and all its options is available in the bru(1) reference page. This command extracts the entire contents of a backup tape:

bru -x 

Restoring a File System with Restore

The Restore command is a shell script that uses bru to extract files from a backup. Tapes made using the graphical System Manager can also be read from the System Maintenance Menu, using Restore. The following are examples of the Restore command:

Restore 

You are prompted to insert the tape into the drive. You can recover multi-volume backups with Restore.

To extract a single file, use this command:

Restore file1 

With the -h option, you can specify the tape drive on a different host workstation:

Restore -h guest@alice.cbs.tv.com file1 

You must have guest login privileges in order to use files from a remote drive.

Files are restored into the current directory if the backup was made with relative path names. Relative path names are those that do not begin with a slash (/) character. Path names that begin with a slash are known as absolute path names. For example, /usr/bin/vi is an absolute path name. The leading slash indicates that the path name begins at the root directory of the system. In contrast, work/special.project/chapter1 is a relative path name since the lack of a leading slash indicates that the path begins with a directory name in the current directory.

Existing files of the same path name on the disk are overwritten during a restore operation even if they are more recent than the files on tape.

Restoring a File System with restore

Use restore to recover files and file systems made with the dump program. There are two ways to use restore:

Use the interactive option to recover moderate numbers of files from a dump archive. With the interactive feature of restore, you can browse the contents of a tape to locate and extract specific files.

Use the non-interactive mode to recover an entire backup. For example, place the backup in the drive and enter:

restore -x 

Note that you cannot restore an active root file system. If your root file system is damaged and needs to be completely restored, you should probably reinstall the system, then rebuild it by extracting selected files from backup tapes.

Restoring Individual Files

The most common type of restoration you can perform is replacing single files that have been removed due to human error.

Restoring Individual Files with bru

To restore an individual file, type:

bru -x filename 

If the file already exists on the file system, bru compares its modification date with that of the copy on tape. If the version of the file in the file system is more recent than the one on tape, bru does not extract the archived file.

To overwrite a file no matter what the modification dates are, use the -u option. With -u, you must specify what kinds of files to overwrite:

For example, to force updating of any regular files on the archive, enter:

bru -xur 

Restoring Individual Files with tar and cpio

To recover individual files from a tar archive, specify the name of the files on the command line:

tar xv file1 file2 directory/file3 

The cpio command works much the same way; for example, enter:

cpio -id file1 directory/file2 < /dev/tape 

The -i option causes cpio to read input from the tape drive, and the -d option causes it to create the directory it is extracting, if it doesn't already exist.

Restoring Individual Files with restore

To recover individual files from a dump archive, follow these steps:

  1. Place the tape in the tape drive. Make sure it is write protected.

  2. Enter:

    restore vi 

    You see something like this:

    Verify tape and initialize maps
    Tape block size is 32
    Dump  date: Wed Feb 13 10:18:59 1991
    Dumped from: the epoch
    Level 0 dump of an unlisted file system on ralph:/dev/rusr
    Label: none
    Extract directories from tape
    Initialize symbol table.
    restore >>
  3. You are now at the restore> prompt. You can browse the tape with cd and ls:

    restore > ls 

    You see something like this:

    2      *./          973     source        1502  net/
    2      *../         149     d2/           1445  os/
    10     .cshrc       155016  debug/        1437  proto3.5/
    1463   .gamma       69899   dev/          1494  revE
    1464   .gamtables   696     etc/          2122  stand/
    160    .kshrc       137     bin/          3     tmp/
    1540   .lastlogin   1311412 jake/         128   unix
    819    .login       424     lib/          128   unix.debug
    820    .profile     9       lost+found/   4     usr/

    To continue browsing, enter the following commands to the restore prompt:

    restore > cd etc 
    restore > pwd 
    /etc
  4. Start building a list of files that you want to extract. Use the add command to add the names of the files you want to the extract list:

    restore > add fstab 
    restore > add fsck 

    If you enter ls at this point, you see a list of files, and fsck and fstab are marked with an asterisk to show they will be extracted.

    If you want to remove a file from the list of those to be extracted, use the delete command:

    restore > delete fstab 
  5. To restore the specified files, use the extract command:

    restore > extract 
    Extract requested files
    You have not read any tapes yet.
    Unless you know which volume your file(s) are on you should
    start with the last volume and work towards the first.
    Specify next volume #: 1 
    Mount tape volume 1
    then enter tape name (default: /dev/tape) <Return> 
    extract file ./etc/fsck
    Add links
    Set directory mode, owner, and times.
    set owner/mode for '.'? [yn] n 
    restore > q 

To recover only a few files, you may wish to use the non-interactive options of restore. For example, enter:

restore -x ./usr/people/ralph/bus.schedule ./etc/passwd 

This recovers the files bus.schedule and passwd from the archive.


[Previous Section] [Back to Table of Contents] [Next Section]
[Collection] [Book] [Expand] [Collapse]

[Previous Hit] [Next Hit] [Clear Search]


Help Home Summary


Send feedback to Technical Publications.

Copyright © 1997, Silicon Graphics, Inc. All Rights Reserved. Trademark Information