Restoring backed-up files
After the data has been correctly backed up, there are several different methods of restoring the data based upon the type of backup command you used.
You need to know how your backup or archive was created to restore it correctly. Each backup
procedure gives information about restoring data. For example, if you use the backup command, you can
specify a backup either by file system or by name. That backup must be restored the way it was done,
by file system or by name.
Several commands restore backed up data, such as:
Item | Description |
---|---|
restore | Copies files created by the backup command. For more information about using this command, see the "Restoring files using the restorecommand' section below. |
rrestore | Copies file systems backed up on a remote machine to the local machine. |
cpio | Copies files into and out of archive storage. |
tar | Creates or manipulates tar archives. |
pax | (POSIX-conformant archive utility) Reads and writes tar and cpio archives. |
The following sections discuss the restore and smit commands.
Note:
- Files must be restored using the same method by which they were backed up. For example, if a file system was backed up by name, it must be restored by name.
- When more than one diskette is required, the restore command reads the diskette that is mounted, prompts you for a new one, and waits for your response. After inserting the new diskette, press the Enter key to continue restoring files.
- Restoring files using the restore command
-
Use the restore command to read files written by the backup command and restore them on your local system.
See the following examples:- To list the names of files previously backed up, type the following:
Information is read from the /dev/rfd0 default backup device. If individual files are backed up, only the file names are displayed. If an entire file system is backed up, the i-node number is also shown.restore -T
- To restore files to the main file system, type the following:
The -x flag extracts all the files from the backup media and restores them to their proper places in the file system. The -v flag displays a progress report as each file is restored. If a file system backup is being restored, the files are named with their i-node numbers. Otherwise, only the names are displayed.restore -x -v
- To copy the /home/mike/manual/chap1 file, type the
following:
This command extracts the /home/mike/manual/chap1 file from the backup medium and restores it. The /home/mike/manual/chap1 file must be a name that the restore -T command can display.restore -xv /home/mike/manual/chap1
- To copy all the files in a directory named manual,
type the following:
This command restores the manual directory and the files in it. If the directory does not exist, a directory named manual is created in the current directory to hold the files being restored.restore -xdv manual
- To list the names of files previously backed up, type the following:
- Restoring files using the smit command
-
Use the smit command to run the restore command, which reads files written by the backup command and restores them on your local system.
- At the prompt, type the following:
smit restore
- Make your entry in the Target DIRECTORY field. This is the directory where you want the restored files to reside.
- Proceed to the BACKUP device or FILE field
and enter the output device name, as in the following example for a raw magnetic
tape device:
/dev/rmt0
If the device is not available, a message similar to the following is displayed:
This message indicates that the system cannot reach the device driver because there is no file for rmtX in the /dev directory. Only items in theCannot open /dev/rmtX, no such file or directory.
available
state are in the /dev directory. - For the NUMBER of blocks to read in a single input field, the default is recommended.
- Press Enter to restore the specified file system or directory.
- At the prompt, type the following: