Become superuser.
Write-protect the tape.
Put the backup tape in the tape drive.
Change to a directory that will be used to restore the files temporarily.
# cd /var/tmp |
If you want to restore the files to a different directory, substitute the directory name for /var/tmp in this step.
Use the ufsrestore command to start the interactive restoration.
Some informational messages and the ufsrestore> prompt are displayed.
# ufsrestore if /dev/rmt/n |
Create a list of files to be restored.
List the contents of a directory.
ufsrestore> ls directory |
Change to a directory.
ufsrestore> cd directory-name |
Create a list of files and directories you want to restore.
ufsrestore> add filename filename |
[Optional] If you need to remove a directory or file name from the list of files to be restored, use the delete command.
ufsrestore> delete filename |
Turn on verbose mode to display the file names as they are being restored.
ufsrestore> verbose |
Use the extract command after the list is complete.
ufsrestore> extract |
The ufsrestore command asks you which volume number to use.
Type the volume number and press Return. If you have only one volume, type 1 and press Return.
Specify next volume #: 1 |
The files and directories in the list are extracted and restored to the current working directory.
To keep the mode of the current directory unchanged, enter n at the set owner/mode prompt.
set owner/mode for `.'? [yn] n |
Quit the ufsrestore program.
ufsrestore> quit |
The shell prompt is displayed.
Verify the files are restored.
In this example, the files /etc/passwd and /etc/shadow are extracted from the backup tape.
# cd /var/tmp # ufsrestore if /dev/rmt/0 ufsrestore> ls .: .OWdefaults bin lib sbin/ .Xauthority dev/ lost+found/ shared/ .desksetdefaults devices/ misc/ tmp/ .fm/ etc/ mnt/ ufsboot .mailtool-init export/ net/ usr/ .openwin-init home/ nfs/ var/ .profile hsfsboot opt/ ws/ .wastebasket/ kadb proc/ .xsun.pluto:0 kernel/ ufsrestore> cd etc ufsrestore> add passwd shadow ufsrestore> verbose verbose mode on ufsrestore> extract 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/shadow extract file ./etc/passwd Add links Set directory mode, owner, and times. set owner/mode for `.'? [yn] n ufsrestore> quit # |