PRIMECLUSTER Global File Services Configuration and Administration Guide 4.2 (Solaris(TM) Operating Environment)
Contents Index PreviousNext

Appendix F Reference Manual> F.2 Management Commands Specific to the GFS Shared File System

F.2.25 sfcrestore(1M) Restores from the dump created with sfcdump

[SYNOPSIS]

sfcrestore I | r | t | x [ abdefhlmosvyLT ] [ archive_file ] [ factor ] [ e_opt ] [ dump_file ] [ n ] [ filename... ]

[DESCRIPTION]

The sfcrestore utility restores files from backup media created with the sfcdump command. sfcrestore'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 sfcrestore also operates on a system other than the GFS Shared File System. For information about the operations to be performed when the dump created with sfcdump is restored on a file system other than GFS Shared File System or the relationships between sfcrestore and ufsrestore(1M), see NOTES below.

[OPTIONS]

[Function letters]

One (and only one) of the following function letters is required:

i

Interactive. After reading in the directory information from the media, sfcrestore 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 operand 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 operand 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 file extension attribute information or it cannot satisfy the conditions required to set the attribute (e.g. 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:
force
Fails to restore files if extent attribute information could not be set.
ignore
Ignores to extent attribute information entirely.
warn
Issues 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 '-', sfcrestore reads from the standard input. This allows sfcdump(1M) and sfcrestore to be used in a pipeline to copy a file system:
# sfcdump 0f - /dev/sfdsk/gfs/rdsk/volume1 | (cd /home; sfcrestore xf -)

If the name of the dump_file is of the form machine:device, the restore is done from the specified machine over the network using rmt(1M). Since sfcrestore is normally run by root, the name of the local machine must appear in the /.rhosts file of the remote machine. If dump_file is specified as user@machine:device, sfcrestore 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, sfcrestore issues a diagnostic and exits. The tape label is specific to the sfcdump tape format, and bears no resemblance to IBM or ANSI-standard tape labels.

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:
# sfcrestore 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. sfcrestore 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. sfcrestore tries to skip over the bad tape block(s) and continue as best it can.

[Interactive Commands]

sfcrestore 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. sfcrestore 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

sfcrestore 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 sfcrestore displays information about each file as it is extracted.

what

Display the dump header on the media.

[OPERAND]

The following operand can be specified:

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.

[EXIT STATUS]

The following exit values are returned:

0 Successful completion.

1 An error occurred. Verbose messages are displayed.

[FILES]

/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.

[ENVIRONMENT]

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

sfcrestore 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 sfcrestore will use /tmp).

[SEE ALSO]

sfcdump(1M).

mkfs(1M), mount(1M), rmt(1M) in the "Solaris X Reference Manual Collection."

[DIAGNOSTICS]

sfcrestore complains about bad option characters.

Read errors result in complaints. If y has been specified, or the user responds y, sfcrestore will attempt to continue.

If the dump extends over more than one tape, sfcrestore asks the user to change tapes. If the x or i function letter has been specified, sfcrestore 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 sfcrestore. 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.

Incorrect tape label. Expected `foo' got `bar'

The L option was specified, and its value did not match what was recorded in the header of the dump file.

resync restore, skipped num

After a tape read error, sfcrestore may have to resynchronize itself. This message lists the number of blocks that were skipped over.

[NOTES]


Contents Index PreviousNext

All Rights Reserved, Copyright(C) FUJITSU LIMITED 2004