Next | Prev | Up | Top | Contents | Index

Restoring dump Archives With restore

This section describes how to use the restore command to restore files and filesystems backed up with the dump command.


Restoring a Filesystem With restore

Use restore to recover files and filesystems 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

If your root filesystem is damaged and needs to be completely restored, you should probably reinstall the system, then rebuild it by extracting selected files from backup tapes. You can also restore the root filesystem by booting the miniroot, unmounting the root filesystem, and then using restore in the miniroot to restore the root filesystem.


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


Next | Prev | Up | Top | Contents | Index