Become superuser or assume an equivalent role.
(Optional) Write-protect the tape for safety.
Insert the volume 1 tape into the tape drive.
Change to a directory that will be used to restore files to temporarily.
# cd /var/tmp |
Restore the file or files.
# ufsrestore xvf /dev/rmt/n filename |
x |
Tells ufsrestore to copy specific files or directories in the filename argument. |
v |
Displays the file names as they are restored. |
f /dev/rmt/n |
Identifies the tape device name. |
filename |
Specifies one or more file names or directory names, separated by spaces. For example: ./export/home/user1/mail ./export/home/user2/mail. |
Type the volume number where files are located. Press Return.
Specify next volume #: 1 |
The file or files are restored to the current working directory.
To maintain the mode of the current directory, type n and press Return at the set owner/mode prompt.
set owner/mode for '.'? [yn] n |
Verify the restored files.
Move the files to the proper directories.
The following example shows how to noninteractively restore the passwd and shadow files to the /var/tmp directory.
# cd /var/tmp # ufsrestore xvf /dev/rmt/0 ./etc/passwd ./etc/shadow Verify volume and initialize maps Media block size is 126 Dump date: Mon Oct 06 12:36:10 2003 Dumped from: the epoch Level 9 dump of / on starbug:/dev/dsk/c0t0d0s0 Label: none Extract directories from tape Initialize symbol table. Make node ./etc Extract requested files You have not read any volumes 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 extract file ./etc/passwd extract file ./etc/shadow Add links Set directory mode, owner, and times. set owner/mode for `.'? [yn] n # cd etc # mv passwd /etc # mv shadow /etc # ls -l /etc |
You can restore files from a remote tape drive by adding remote-host: to the front of the tape device name, when using the ufsrestore command.
The following example shows how to restore files by using a remote tape drive /dev/rmt/0 on the system venus.
# ufsrestore xf venus:/dev/rmt/0 ./etc/hosts |