System Administration Guide: Devices and File Systems

Options and Arguments for the ufsrestore Command

The syntax of the ufsrestore command is as follows:


/usr/sbin/ufsrestore options arguments filenames
options

Is a single string of one-letter option names. You must choose one and only one of these options: i, r, R, t, or x. The additional options listed in Table 26–3 are optional.

arguments

Follows the option string with the arguments that match the options. The option letters and their associated arguments must be in the same order.

filenames

Specifies the file or files to be restored as arguments to the x or t options. These arguments must always come last, separated by spaces.

You must use one (and only one) of the ufsrestore command options described in the following table.

Table 26–2 One Required Option for the ufsrestore Command

Option 

Description 

i

Interactive. Runs the ufsrestore command in interactive mode. In this mode, you can use a limited set of shell-like commands to browse the contents of the media and select individual files or directories to restore. For a list of interactive commands, see Table 26–4.

r

Recursive. Restores the entire contents of the media into the current working directory (which should be the top level of the file system). Information used to restore incremental backups on top of the full backup (for example, restoresymtable) is also included. To completely restore a file system, use this option to restore the full (level 0) backup and each subsequent incremental backup. Although this option is intended for a new file system (that was just created with the newfs command), files not on the backup media are preserved.

R

Resume restoring. Prompts for the volume from which to resume restoring and restarts from a checkpoint. You rerun the ufsrestore command with this option after a full restore (r option) is interrupted.

x [filenames]

 

Extract. Selectively restores the files you specify by the filenames argument. filenames can be a list of files and directories, each separated by a space. All files under a specified directory are restored unless you also use the h option. If you omit filenames or enter “.” for the root directory, all files on all volumes of the media (or from standard input) are restored. Existing files are overwritten, and warnings are displayed.

t [filenames]

Table of contents. Checks the files that are specified in the filenames argument against the media. For each file, lists the full file name and the inode number (if the file is found) or indicates that the file is not on the “volume” (meaning any volume in a multivolume backup). If you do not enter the filenames argument, all files on all volumes of the media are listed (without distinguishing on which volume files are located).

If you also use the h option, only the directory files that are specified in filenames, not their contents, are checked and listed. The table of contents is read from the first volume of the media, or, if you use the a option, from the specified archive file. This option is mutually exclusive with the x and r options.

Additional ufsrestore options are described in the following table. These options are optional.

Table 26–3 Additional Options for the ufsrestore Command

Option 

Description 

a archive-file [filenames]

Archive file. Takes the backup table of contents from the specified archive-file instead of from the media (first volume). You can use this option with the t, i, or x options to see if files are on the media without having to mount any media. If you use this option with the x and interactive (i) extract options, you are prompted to mount the appropriate volume before extracting the file or files.

b factor

Blocking factor. Specifies number of 512-byte blocks read at a time from a tape. By default, the ufsrestore command tries to figure out the block size that was used when the tape was being written to.

d

Debug. Turns on debugging messages. 

f backup-file

Backup file. Reads the files from the source indicated by backup-file, instead of from the default device file /dev/rmt/0m. If you use the f option, you must specify a value for backup-file. When backup-file is of the form system:device, the ufsrestore command reads from the remote device. You can also use the backup-file argument to specify a file on a local or remote disk. If thebackup-file consistes of `-', the files are read from standard input.

h

Turns off directory expansion. Only the directory file you specify is extracted or listed. 

m

Restores specified files into the current directory on the disk, regardless of where they are located in the backup hierarchy. Also, renames the specified files with their inode number. For example, if the current working directory is /files, a file in the backup named ./dready/fcs/test with inode number 42 is restored as /files/42. This option is useful only when you are extracting a few files.

s n

Skip. Skips to the nth backup file on the media (first volume). This option is useful when you put more than one backup on a single tape.

v

Verbose. Displays the names and inode numbers of each file as it is restored. 

y

Specifies that the command continues when errors occur while reading the media, trying to skip over bad blocks instead of stopping and asking whether to continue. This option tells the command to assume a yes response. 

The following table describes ufsrestore's interactive commands.

Table 26–4 Commands for Interactive Restore

Option 

Description 

ls [directory-name]

Lists the contents of either the current directory or the specified directory. Directories are marked by a / suffix. Entries in the current list to be restored (extracted) are marked by an * prefix. Inode numbers are shown if the verbose option (v) is used.

cd directory-name

Changes to the specified directory in the backup hierarchy. 

add [filename]

Adds the current directory or the specified file or directory to the list of files to extract (restore). If you do not use the h option, all files in a specified directory and its subdirectories are added to the list. All the files you want to restore to a directory might not be on a single backup tape or diskette. You might need to restore from multiple backups at different levels to get the latest versions of all the files.

delete [filename]

Deletes the current directory or the specified file or directory from the list of files to extract (restore). If you do not use the h option, all files in the specified directory and its subdirectories are deleted from the list. The files and directories are deleted only from the extract list you are building. They are not deleted from the media or the file system.

extract

Extracts the files in the list and restores them relative to the current working directory on the disk. When you are asked for a volume number for a single-volume backup, specify 1. If you are doing a multiple tape or multiple diskette restore and restoring a small number of files, start instead with the last tape or diskette.

help

Displays a list of commands that you can use in interactive mode. 

pwd

Displays the path name of the current working directory in the backup hierarchy. 

q

Quits interactive mode without restoring any additional files. 

setmodes

Lets you set the mode for files to be restored to match the mode of the root directory of the file system from which they were backed up. You are prompted with: set owner/mode for '.' [yn]? Type y (for yes) to set the mode (permissions, owner, times) of the current directory to match the root directory of the file system from which they were backed up. Use this mode when you restore a complete file system.

Type n (for no) to leave the mode of the current directory unchanged. Use this mode when you restore part of a backup to a directory other than the directory from which the files were backed up.

verbose

Turns on or off the verbose option (which can also be typed as v on the command line outside of interactive mode). When verbose is on, the interactive ls command lists inode numbers, and the ufsrestore command displays information on each file as it is extracted.

what

Displays the backup header from the tape or diskette.