8.2.2 How to Backup the Current Directory

8.3 Restoring Information from Backup Media

When you restore information, you are taking information that you backed up in the previous section and using one of the restore methods discussed in the following sections.

8.3.1 How to Restore a File

For this example, you will restore the file /etc/hosts from a tape device /dev/rmt0.

You can use one of the following commands depending on what command was used to do the backup:

8.3.2 How to Restore a Directory

For this example, you will restore the directory /var and its contents from a tape device /dev/rmt0.

You can use one of the following commands depending on what command was used to do the backup.

8.3.3 Errors on Restore, Incorrect Block Size

When you need to restore from tape, but the backup was made using an unknown block size, then you need to pipe dd into the restore command.

The error displayed is:

Media Read Error - I/O Error

The following is an example for the file name restore:

# dd if=/dev/rmt0 bs=51200 | restore -xvqf-
x      1062769 ./ausnames
x      1833056 ./backuplistand
57+0 records in.
57+0 records out.

or

restore -xvqf- </dev/rmt0

This is the example for the i-node restore:

dd if=/dev/rmt0 bs=51200 | restore -xvqmf-

or

restore -xvqmf- </dev/rmt0

8.3.4 Using the rmfs Command

The rmfs command removes a file system. You can use this command once you have restored a backup to clean up file systems that are no longer required, or unintentionally mounted during backup time. To run, enter:

rmfs userfs

8.4 Cloning Your System