The ufsrestore command copies file systems from a tape to a hard disk. It can only copy file systems that were created with the ufsdump command.
You must use ufsrestore with one of these three options:
i (interactive) - After reading the directory information from the media, ufsrestore invokes an interactive interface that allows you to browse through the dump file's directory hierarchy and select individual files to be extracted.
r (recursive) - Restore the entire contents of the media into the current directory (which should be the top level of the file system). To completely restore a file system, use this option to restore the level 0 dump, and again for each incremental dump. Although, this option is intended for a complete restore onto a clear file system, if the file system contains files not on the media, they are preserved.
t (table of contents) - Provides a list of every file on a tape.
The following options are not mandatory:
b (blocking factor) - Specify the blocking factor for tape reads. This option must be followed by an integer. By default, the ufsrestore command attempts to determine the correct blocking factor to use.
f (dump file) - Specify the dump file to restore from. ufsrestore will use /dev/rmt/0 if no dump file is specified.
v (verbose mode) - Display path names as they are read from the tape.
Example:
The following example shows how to retrieve a file from tape interactively. The file will be written in the current directory (/disk2 in this example). A blocking factor of 96 is specified as well as the dump file (first tape drive) of /dev/rmt/0.
You must use the same blocking factor (or larger) when you retrieve or copy files from the tape to the hard disk as you did when you copied files from the hard disk to the tape.
example# cd /disk2 example# ufsrestore ibf 96 /dev/rmt/0 ufsrestore > ? Available commands are: ls [arg] - list directory cd arg - change directory pwd - print current directory add [arg] - add `arg' to list of files to be extracted delete [arg] - delete `arg' from list of files to be extracted extract - extract requested files setmodes - set modes of requested directories quit - immediately exit program what - list dump header information verbose - toggle verbose flag (useful with "ls") help or `?' - print this list IF no `arg' is supplied, the current directory is used
The system responds with a ufsrestore prompt. If you type a question mark, a list of available arguments is displayed.
List the directories that are resident on the tape by typing ls.
ufsrestore > ls 4lib/ dict mail openwin spool 5bin games man/ preserve src adm include/ net pub tmp
Now add the files or directories to the list of files to extract with the add command:
ufsrestore > add man mail
In this example the man and mail files are added to the list of files to extract from tape.
Now extract these files from the tape. They will be written to your current working directory (/disk2 in this example).
ufsrestore > extract
Once all the desired files are extracted, exit the ufsrestore command with q:
ufsrestore > q