Become superuser.
Write-protect the tape.
Insert the volume 1 tape into the tape drive.
Change to a directory that will be used to restore the files temporarily.
# cd /var/tmp |
To avoid conflicts with other users, you might want to create and change to a subdirectory, such as /var/tmp/restore, in which to restore the files.
If you are restoring a hierarchy, you should restore the files in a temporary directory on the same file system where the files will reside, so you can use the mv command to move the entire hierarchy where it belongs after it is restored.
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 |
(Optional) 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 |
You must wait while ufsrestore performs its final cleanup.
Quit the ufsrestore program.
ufsrestore> quit |
You then see the shell prompt.
Verify the restored files.
The following example extracts the files /etc/passwd and /etc/shadow from the backup tape.
# cd /var/tmp # ufsrestore if /dev/rmt/0 ufsrestore> ls .: .cpr_config etc/ lost+found/ sbin/ usr/ TT_DB/ export/ mnt/ sccs/ var/ b/ home/ net/ share/ vol/ bin kernel/ opt/ shared/ ws/ dev/ lib platform/ src/ xfn/ devices/ license/ proc/ tmp/ 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 # |