PRIMECLUSTER Global File Services Configuration and Administration Guide 4.2 (Solaris(TM) Operating Environment) |
Contents Index |
Appendix B Reference Manual | > B.2 Management Commands Specific to the GFS Local File System |
sfxrestore i|r|t|x [abcdefhmsvy] [archive_file] [factor] [e_opt] [dump_file] [n] [filename...]
The sfxrestore utility restores files from backup media created with sfxdump(1M). sfxrestore's actions are controlled by the key argument. The key is exactly one function letter (i, r, t, or x) and zero or more function modifiers (letters). The key string contains no SPACE characters. Function modifier arguments are listed on the command line in the same order as their corresponding function modifiers appear in the key string.
The sfxrestore also operates on a system other than the GFS Local File System. For information about the operations to be performed when the dump created with sfxdump(1M) is restored on a file system other than GFS Local File System or the relationships between sfxrestore and ufsrestore(1M), see NOTES below.
[Function letters]
One (and only one) of the following function letters is required:
i
Interactive. After reading in the directory information from the media, sfxrestore invokes an interactive interface that allows you to browse through the dump file's directory hierarchy and select individual files to be extracted. See Interactive commands, below, for a description of available commands.
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 function letter to restore the level 0 dump, and again for each incremental dump. Although, this function letter 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. List each filename that appears on the media. If no filename argument is given, the root directory is listed. This results in a list of all files on the media, unless the h function modifier is in effect. The table of contents is taken from the media or from the specified archive file, when the function modifier is used.
x
Extract the named files from the media. If a named file matches a directory whose contents were written onto the media, and the h function modifier is not in effect, the directory is recursively extracted. The owner, modification time, and mode are restored (if possible). Existing files are overwritten and a warning is given. If no filename argument is given, the root directory is extracted. This results in the entire tape being extracted unless the h function modifier is in effect.
[Function modifiers]
a archive_file
Read the table of contents from archive_file instead of the media. This function modifier can be used in combination with the t, i or x function letters, making it possible to check whether files are on the media without having to mount the media. When used with the x and interactive (i) function letters, it prompts for the volume containing the file(s) before extracting them.
b factor
Blocking factor. Specify the blocking factor for tape reads. For variable length SCSI tape devices, unless the data was written with the default blocking factor, a blocking factor at least as great as that used to write the tape must be used; otherwise, an error will be generated. Note that a tape block is 512 bytes. Refer to the man page for your specific tape driver for the maximum blocking factor.
d
Turn on debugging output.
e e_opt
Specifies how to handle files that have extent attribute information. It's impossible to set the information onto files if the destination file system does not support extent attribute information or lacks free extents appropriate to satisfy the extent attribute information requirements. This function modifier specifies the action in those cases. Valid values for e_opt are:
forceFails to restore files if extent attribute information could not be set.
ignoreIgnores to extent attribute information entirely.
warnIssues a warning message if extent attribute information could not be set to a file. The extent attribute information of the file is erased.
The default value for e_opt is warn.
f dump_file
Use dump_file instead of /dev/rmt/0 as the file to restore from. Typically dump_file specifies a tape or diskette drive. If dump_file is specified as '-', sfxrestore reads from the standard input. This allows sfxdump(1M) and sfxrestore to be used in a pipeline to copy a file system:
# sfxdump 0f - /dev/sfdsk/gfs/rdsk/vol0007 | (cd /home; sfxrestore xf -)
If the name of the file is of the form machine:device, the restore is done from the specified machine over the network using rmt(1M). Since sfxrestore is normally run by root, the name of the local machine must appear in the /.rhosts file of the remote machine. If the file is specified as user@system:device, sfxrestore will attempt to execute as the specified user on the remote machine. The specified user must have a .rhosts file on the remote machine that allows the user invoking the command from the local machine to access the remote machine.
h
Extract or list the actual directory, rather than the files that it references. This prevents hierarchical restoration of complete sub trees from the tape.
l (lower-case l)
Autoload. When the end-of-tape is reached before the restore is complete, take the drive off-line and wait up to two minutes (the default, see the T function modifier) for the tape drive to be ready again. This gives autoloading (stackloader) tape drives a chance to load a new tape. If the drive is ready within two minutes, continue. If it is not, prompt for another tape and wait.
L string
The string as label that should appear in the header of the dump file. If the labels do not match, sfxrestore issues a diagnostic and exits.
m
Extract by i-node numbers rather than by filename to avoid regenerating complete pathnames. Regardless of where the files are located in the dump hierarchy, they are restored into the current directory and renamed with their i-node number. This is useful if only a few files are being extracted.
o (lower-case o)
Offline. Take the drive off-line when the restore is complete or the end-of-media is reached and rewind the tape, or eject the diskette. In the case of some autoloading 8mm drives, the tape is removed from the drive automatically.
s n
Skip to the n'th file when there are multiple dump files on the same tape. For example, the command:
# sfxrestore xfs /dev/rmt/0hn 5
Would position you to the fifth file on the tape when reading volume 1 of the dump. If a dump extends over more than one volume, all volumes except the first are assumed to start at position 0, no matter what "s n" value is specified. If "s n" is specified, the backup media must be at BOT (beginning of tape). Otherwise, the initial positioning to read the table of contents will fail, as it is performed by skipping the tape forward n-1 files rather than by using absolute positioning. This is because on some devices absolute positioning is very time consuming.
T timeout [ hms ]
Sets the amount of time to wait for an autoload command to complete. This function modifier is ignored unless the l function modifier has also been specified. The default timeout period is two minutes. The time units may be specified as a trailing h (hours), m (minutes), or s (seconds). The default unit is minutes.
v
Verbose. sfxrestore displays the name of each file it restores, preceded by its file type.
y
Do not ask whether to abort the restore in the event of tape errors. sfxrestore tries to skip over the bad tape block(s) and continue as best it can.
[Interactive Commands]
sfxrestore enters interactive mode when invoked with the i function letter. Interactive commands are reminiscent of the shell. For those commands that accept an argument, the default is the current directory. The interactive options are:
add [filename]
Add the named file or directory to the list of files to extract. If a directory is specified, add that directory and its files (recursively) to the extraction list (unless the h function modifier is in effect).
cd directory
Change to directory (within the dump file).
delete [filename]
Delete the current directory, or the named file or directory from the list of files to extract. If a directory is specified, delete that directory and all its descendents from the extraction list (unless the h function modifier is in effect). The most expedient way to extract a majority of files from a directory is to add that directory to the extraction list, and then delete specific files to omit.
extract
Extract all files on the extraction list from the dump media. sfxrestore asks which volume the user wishes to mount. The fastest way to extract a small number of files is to start with the last volume and work toward the first.
help
Display a summary of the available commands.
ls [directory]
List files in directory or the current directory, represented by a `.' (period). Directories are appended with a `/' (slash). Entries marked for extraction are prefixed with a `*' (asterisk). If the verbose option is in effect, i-node numbers are also listed.
marked [directory]
Like ls(1), except only files marked for extraction are listed.
paginate
Toggle the pagination of the output from the ls and marked commands. The paginate used is that defined by the PAGER environment variable, or more(1) if that envar is not defined. The PAGER envar may include white-space-separated arguments for the pagination program.
pwd
Print the full pathname of the current working directory.
quit
sfxrestore exits immediately, even if the extraction list is not empty.
setmodes
Prompts: set owner/mode for `.' (period). Type y for yes to set the mode (permissions, owner, times) of the current directory `.' (period) into which files are being restored equal to the mode of the root directory of the file system from which they were dumped. Normally, this is what you want when restoring a whole file system, or restoring individual files into the same locations from which they were dumped. Type n for no, to leave the mode of the current directory unchanged. Normally, this is what you want when restoring part of a dump to a directory other than the one from which the files were dumped.
setpager command
Sets the command to use for paginating output instead of the default or that inherited from the environment. The command string may include arguments in addition to the command itself.
verbose
Toggle the status of the v function modifier. While v is in effect, the ls command lists the i-node numbers of all entries, and sfxrestore displays information about each file as it is extracted.
what
Display the dump header on the media.
filename
Specifies the pathname of files (or directories) to be restored to disk. Unless the h function modifier is also used, a directory name refers to the files it contains, and (recursively) its subdirectories and the files they contain. filename is associated with either the x or t function letters, and must come last.
The following exit values are returned:
0 Successful completion.
1 An error occurred. Verbose messages are displayed.
/dev/rmt/0
The default tape drive.
/tmp/rstdir*
File containing directories on the tape. The directory where this file is created can be specified by setting the environment variable TMPDIR.
/tmp/rstmode*
Owner, mode, and timestamps for directories. The directory where this file is created can be specified by setting the environment variable TMPDIR.
./restoresymtable
Information passed between incremental restores.
PAGER
The command to use as a filter for paginating output. This can also be used to specify the options to be used. Default is more(1).
TMPDIR
sfxrestore normally creates temporary files in the directory /tmp. You may specify another directory by setting the environment variable TMPDIR to your chosen directory. (If TMPDIR isn't a valid directory, then sfxrestore will use /tmp).
more(1), mkfs(1M), mount(1M), rmt(1M).
sfxrestore complains about bad option characters.
Read errors result in complaints. If y has been specified, or the user responds y, sfxrestore will attempt to continue.
If the dump extends over more than one tape, sfxrestore asks the user to change tapes. If the x or i function letter has been specified, sfxrestore also asks which volume the user wishes to mount. If the s function modifier has been specified, and volume 1 is mounted, it is automatically positioned to the indicated file.
There are numerous consistency checks that can be listed by sfxrestore. Most checks are self-explanatory or can "never happen." Common errors are given below.
filename: not found on tape
The specified file name was listed in the tape directory, but was not found on the tape. This is caused by tape read errors while looking for the file, or from using a dump tape created on an active file system.
expected next file inumber, got inumber
A file that was not listed in the directory showed up. This can occur when using a dump tape created on an active file system.
Incremental tape too low
When doing an incremental restore, a tape that was written before the previous incremental tape, or that has too low an incremental level has been loaded.
Incremental tape too high
When doing incremental restore, a tape that does not begin its coverage where the previous incremental tape left off, or one that has too high an incremental level has been loaded.
media read error: invalid argument
Blocking factor specified for read is smaller than the blocking factor used to write data.
Tape read error while restoring filename
Tape read error while skipping over inode inumber
Tape read error while trying to resynchronize
A tape read error has occurred
If a file name is specified, then its contents are probably partially wrong. If an i-node is being skipped or the tape is trying to resynchronize, then no extracted files have been corrupted, though files may not be found on the tape.
resync restore, skipped num
After a tape read error, sfxrestore may have to resynchronize itself. This message lists the number of blocks that were skipped over.
Incorrect tape label. Expected `foo' got `bar'
The L function modifier was specified, and its value did not match what was recorded in the header of the dump file.
sfxrestore can get confused when doing incremental restores from dump tapes that were made on active file systems.
A "level 0" dump must be done after a full restore. Because sfxrestore runs in user mode, it has no control over i-node allocation. This means that sfxrestore repositions the files, although it does not change their contents. Thus, a full dump must be done to get a new set of directories reflecting the new file positions, so that later incremental dumps will be correct.
Internal quotas file is not restored by sfxrestore. If the file system on which quota function is used, it's necessary to reflect the contents of external quotas file to internal quotas file by executing sfxquotadm(1M) with -i option. For details of the sfxquotadm(1M), see the reference manual.
sfxrestore fails if the file larger than 2 gigabytes is restored on the file system which does not support files larger than 2 gigabytes .
sfxrestore and ufsrestore(1M) are functionally compatible, though the backup formats are different. As a result, the sfxrestore cannot use the backup data created using the ufsdump(1M) for restoration. In the same way, ufsrestore(1M) cannot use the backup data created using sfxdump(1M) for restoration.
If files are restored on the file system that does not support extent attribute information such as UFS, extent attribute information is erased. If files are restored on the file system that does not support ACLs, ACLs are erased.
Contents Index |