- 论坛徽章:
- 0
|
Script started on Tue 30 May 2006 06:16:32 PM CST
# man mt
Reformatting page. Please Wait... done
User Commands mt(1)
NAME
mt - magnetic tape control
SYNOPSIS
mt [-f [4mtapename[m] [4mcommand[m... [[4mcount[m]
DESCRIPTION
The mt utility sends commands to a magnetic tape drive. If
-f [4mtapename[m is not specified, the environment variable TAPE
is used. If TAPE does not exist, mt uses the device
/dev/rmt/0n.
OPTIONS
The following option is supported:
-f [4mtapename[m
Specifies the raw tape device.
OPERANDS
The following operands are supported:
[4mcount[m The number of times that the requested operation is to
be performed. By default, mt performs [4mcommand[m once.
Multiple operations of [4mcommand[m may be performed by
specifying [4mcount[m.
[4mcommand[m
Available commands that can be sent to a magnetic tape
drive. Only as many characters as are required to
uniquely identify a [4mcommand[m need be specified.
eof, weof
Write [4mcount[m EOF marks at the current position on the
tape.
fsf Forward space over [4mcount[m EOF marks. The tape is posi-
tioned on the first block of the file.
fsr Forward space [4mcount[m records.
bsf Back space over [4mcount[m EOF marks. The tape is posi-
tioned on the beginning-of-tape side of the EOF mark.
bsr Back space [4mcount[m records.
nbsf Back space [4mcount[m files. The tape is positioned on the
[1;7m--More--(34%)[m
first block of the file. This is equivalent to [4mcount[m+[4m1[m
bsf's followed by one fsf.
asf Absolute space to [4mcount[m file number. This is
equivalent to a rewind followed by a fsf [4mcount[m.
SunOS 5.9 Last change: 13 Nov 1996 1
User Commands mt(1)
If [4mcount[m is specified with any of the following commands,
the [4mcount[m is ignored and the command is performed only once.
eom Space to the end of recorded media on the tape. This
is useful for appending files onto previously written
tapes.
rewind
Rewind the tape.
offline, rewoffl
Rewind the tape and, if appropriate, take the drive
unit off-line by unloading the tape. It cycles
through all four tapes.
status
Print status information about the tape unit.
retension
Rewind the cartridge tape completely, then wind it
forward to the end of the reel and back to beginning-
of-tape to smooth out tape tension.
reserve
Allow the tape drive to remain reserved after closing
the device. The drive must then be explicitly
released.
release
Re-establish the default behavior of releasing at
close.
forcereserve
Break the reservation of the tape drive held by
another host and then reserve the tape drive. This
command can be executed only with super-user
privileges.
erase Erase the entire tape. Erasing a tape may take a long
[1;7m--More--(71%)[m
time depending on the device and/or tape. Refer to the
device specific manual for time details.
EXIT STATUS
0 All operations were successful.
1 Command was unrecognized or mt was unable to open the
specified tape drive.
2 An operation failed.
SunOS 5.9 Last change: 13 Nov 1996 2
User Commands mt(1)
FILES
/dev/rmt/*
magnetic tape interface
ATTRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|_____________________________[4m|[m_____________________________[4m|[m
| Availability | SUNWcsu |
|_____________________________[4m|[m_____________________________[4m|[m
SEE ALSO
tar(1), tcopy(1), ar(3HEAD), environ(4), attributes(5),
mtio( 7I), st(7D)
BUGS
Not all devices support all options. Some options are
hardware-dependent. Refer to the corresponding device manual
page.
mt is architecture sensitive. Heterogeneous operation (that
is, SPARC to x86 or the reverse) is not supported.
SunOS 5.9 Last change: 13 Nov 1996 3
# man ufsdump
Reformatting page. Please Wait... done
System Administration Commands ufsdump(1M)
NAME
ufsdump - incremental file system dump
SYNOPSIS
/usr/sbin/ufsdump [[4moptions[m] [[4marguments[m] [4mfiles[m_[4mto[m_[4mdump[m
DESCRIPTION
ufsdump backs up all files specified by [4mfiles[m_[4mto[m_[4mdump[m (nor-
mally either a whole file system or files within a file sys-
tem changed after a certain date) to magnetic tape,
diskette, or disk file. When running ufsdump, the file sys-
tem must be inactive; otherwise, the output of ufsdump may
be inconsistent and restoring files correctly may be impos-
sible. A file system is inactive when it is unmounted or the
system is in single user mode. A file system is not con-
sidered inactive if one tree of the file system is quiescent
while another tree has files or directories being modified.
[4moptions[m is a single string of one-letter ufsdump options.
[4marguments[m may be multiple strings whose association with the
options is determined by order. That is, the first argument
goes with the first option that takes an argument; the
second argument goes with the second option that takes an
argument, and so on.
[4mfiles[m_[4mto[m_[4mdump[m is required and must be the last argument on
the command line. See OPERANDS for more information.
With most devices ufsdump can automatically detect the
end-of-media. Consequently, the d, s, and t options are not
necessary for multi-volume dumps, unless ufsdump does not
understand the way the device detects the end-of-media, or
the files are to be restored on a system with an older ver-
sion of the restore command.
OPTIONS
The following options are supported:
0-9 The "dump level." All files specified by [4mfiles[m_[4mto[m_[4mdump[m
that have been modified since the last ufsdump at a
lower dump level are copied to the [4mdump[m_[4mfile[m destina-
tion (normally a magnetic tape device). For instance,
if a "level 2" dump was done on Monday, followed by
a "level 4" dump on Tuesday, a subsequent "level 3"
dump on Wednesday would contain all files modified or
[1;7m--More--(11%)[m
added since the "level 2" (Monday) backup. A "level
0" dump copies the entire file system to the
[4mdump[m_[4mfile[m.
a [4marchive[m_[4mfile[m
Archive file. Archive a dump table-of-contents in the
SunOS 5.9 Last change: 15 Aug 2000 1
System Administration Commands ufsdump(1M)
specified [4marchive[m_[4mfile[m to be used by ufsrestore(1M)
to determine whether a file is in the dump file that
is being restored.
b [4mfactor[m
Blocking factor. Specify the blocking factor for tape
writes. The default is 20 blocks per write for tapes
of density less than 6250BPI (bytes-per-inch). The
default blocking factor for tapes of density 6250BPI
and greater is 64. The default blocking factor for
cartridge tapes (c option) is 126. The highest block-
ing factor available with most tape drives is 126.
Note: the blocking factor is specified in terms of
512-byte blocks, for compatibility with tar(1).
c Cartridge. Set the defaults for cartridge instead of
the standard half-inch reel. This sets the density to
1000BPI and the blocking factor to 126. Since ufsdump
can automatically detect the end-of-media, only the
blocking parameter normally has an effect. When car-
tridge tapes are used, and this option is [4mnot[m speci-
fied, ufsdump will slightly miscompute the size of the
tape. If the b, d, s or t options are specified with
this option, their values will override the defaults
set by this option.
d [4mbpi[m Tape density. Not normally required, as ufsdump can
detect end-of-media. This parameter can be used to
keep a running tab on the amount of tape used per
reel. The default density is 6250BPI except when the
c option is used for cartridge tape, in which case it
is assumed to be 1000BPI per track. Typical values for
tape devices are:
1/2 inch tape
6250 BPI
1/4 inch cartridge
[1;7m--More--(23%)[m
1000 BPI The tape densities and other options
are documented in the st(7D) man page.
D Diskette. Dump to diskette.
f [4mdump[m_[4mfile[m
Dump file. Use [4mdump[m_[4mfile[m as the file to dump to,
instead of /dev/rmt/0. If [4mdump[m_[4mfile[m is specified as -,
dump to standard output.
If the name of the file is of the form [4mmachine[m:[4mdevice[m,
the dump is done from the specified machine over the
network using rmt(1M). Since ufsdump is normally run
SunOS 5.9 Last change: 15 Aug 2000 2
System Administration Commands ufsdump(1M)
by root, the name of the local machine must appear in
the /.rhosts file of the remote machine. If the file
is specified as [4muser[m@[4mmachine[m:[4mdevice[m, ufsdump 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.
l Autoload. When the end-of-tape is reached before the
dump is complete, take the drive offline and wait up
to two minutes 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 [4mstring[m
Sets the tape label to [4mstring[m, instead of the default
none. [4mstring[m may be no more than sixteen characters
long. If it is longer, it is truncated and a warning
printed; the dump will still be done. The tape label
is specific to the ufsdump tape format, and bears no
resemblance to IBM or ANSI-standard tape labels.
n Notify all operators in the sys group that ufsdump
requires attention by sending messages to their termi-
nals, in a manner similar to that used by the
wall(1M) command. Otherwise, such messages are sent
only to the terminals (such as the console) on which
the user running ufsdump is logged in.
[1;7m--More--(36%)[m
[K
N [4mdevice[m_[4mname[m
Use [4mdevice[m_[4mname[m when recording information in
/etc/dumpdates (see the u option) and when comparing
against information in /etc/dumpdates for incremental
dumps. The [4mdevice[m_[4mname[m provided can contain no white
space as defined in scanf(3C) and is case-sensitive.
o Offline. Take the drive offline when the dump is com-
plete or the end-of-media is reached and rewind the
tape, or eject the diskette. In the case of some auto-
loading 8mm drives, the tape is removed from the drive
automatically. This prevents another process which
rushes in to use the drive, from inadvertently
overwriting the media.
s [4msize[m
Specify the [4msize[m of the volume being dumped to. Not
normally required, as ufsdump can detect end-of-media.
When the specified size is reached, ufsdump waits for
you to change the volume. ufsdump interprets the
SunOS 5.9 Last change: 15 Aug 2000 3
System Administration Commands ufsdump(1M)
specified size as the length in feet for tapes and
cartridges, and as the number of 1024-byte blocks for
diskettes. The values should be a little smaller than
the actual physical size of the media (for example,
425 for a 450-foot cartridge). Typical values for tape
devices depend on the c option, for cartridge devices,
and the D option for diskettes:
1/2 inch tape
2300 feet
60-Mbyte 1/4 inch cartridge
425 feet
150-Mbyte 1/4 inch cartridge
700 feet
diskette
1422 blocks (Corresponds to a 1.44-Mbyte
diskette, with one cylinder reserved for bad
block information.)
S Size estimate. Determine the amount of space that is
[1;7m--More--(47%)[m
needed to perform the dump without actually doing it,
and display the estimated number of bytes it will
take. This is useful with incremental dumps to deter-
mine how many volumes of media will be needed.
t [4mtracks[m
Specify the number of tracks for a cartridge tape. Not
normally required, as ufsdump can detect end-of-media.
The default is 9 tracks. The t option is not compati-
ble with the D option. Values for Sun-supported tape
devices are:
60-Mbyte 1/4 inch cartridge
9 tracks
150-Mbyte 1/4 inch cartridge
18 tracks
T [4mtime[m_[4mwait[m[hms]
Sets the amount of time to wait for an autoload com-
mand to complete. This option is ignored unless the l
option has also been specified. The default time
period to wait is two minutes. Specify time units
with a trailing h ( for hours), m (for minutes), or s
(for seconds). The default unit is minutes.
u Update the dump record. Add an entry to the file
SunOS 5.9 Last change: 15 Aug 2000 4
System Administration Commands ufsdump(1M)
/etc/dumpdates, for each file system successfully
dumped that includes the file system name (or
[4mdevice[m_[4mname[m as specified with the N option), date, and
dump level.
v Verify. After each tape or diskette is written, verify
the contents of the media against the source file sys-
tem. If any discrepancies occur, prompt for new media,
then repeat the dump/verification process. The file
system [4mmust[m be unmounted. This option cannot be used
to verify a dump to standard output.
w Warning. List the file systems that have not been
backed up within a day. This information is gleaned
from the files /etc/dumpdates and /etc/vfstab. When
the w option is used, all other options are ignored.
After reporting, ufsdump exits immediately.
[1;7m--More--(58%)[m
[K
W Warning with highlight. Similar to the w option,
except that the W option includes all file systems
that appear in /etc/dumpdates, along with information
about their most recent dump dates and levels. File
systems that have not been backed up within a day are
highlighted.
OPERANDS
The following operand is supported:
[4mfiles[m_[4mto[m_[4mdump[m
Specifies the files to dump. Usually it identifies a
whole file system by its raw device name (for example,
/dev/rdsk/c0t3d0s6). Incremental dumps (levels 1 to 9)
of files changed after a certain date only apply to a
whole file system. Alternatively, [4mfiles[m_[4mto[m_[4mdump[m can
identify individual files or directories. All named
directories that may be examined by the user running
ufsdump, as well as any explicitly-named files, are
dumped. This dump is equivalent to a level 0 dump of
the indicated portions of the filesystem, except that
/etc/dumpdates is not updated even if the -u option
has been specified. In all cases, the files must be
contained in the same file system, and the file system
must be local to the system where ufsdump is being
run.
[4mfiles[m_[4mto[m_[4mdump[m is required and must be the last argu-
ment on the command line.
If no [4moptions[m are given, the default is 9uf /dev/rmt/0
[4mfiles[m_[4mto[m_[4mdump[m.
SunOS 5.9 Last change: 15 Aug 2000 5
System Administration Commands ufsdump(1M)
USAGE
See largefile(5) for the description of the behavior of ufs-
dump when encountering files greater than or equal to 2
Gbyte ( 2**31 bytes).
EXAMPLES
Example 1: A sample display of the ufsdump command.
To make a full dump of a root file system on c0t3d0, on a
150-MByte cartridge tape unit 0, use:
[1;7m--More--(69%)[m
example# ufsdump 0cfu /dev/rmt/0 /dev/rdsk/c0t3d0s0
To make and verify an incremental dump at level 5 of the
usr partition of c0t3d0, on a 1/2 inch reel tape unit 1,
use:
example# ufsdump 5fuv /dev/rmt/1 /dev/rdsk/c0t3d0s6
EXIT STATUS
While running, ufsdump emits many verbose messages. ufsdump
returns the following exit values:
0 Normal exit.
1 Startup errors encountered.
3 Abort - no checkpoint attempted.
FILES
/dev/rmt/0
default unit to dump to
/etc/dumpdates
dump date record
/etc/group
to find group sys
/etc/hosts
to gain access to remote system with drive
/etc/vfstab
list of file systems
ATTRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
SunOS 5.9 Last change: 15 Aug 2000 6
System Administration Commands ufsdump(1M)
____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|_____________________________[4m|[m_____________________________[4m|[m
| Availability | SUNWcsu |
|_____________________________[4m|[m_____________________________[4m|[m
SEE ALSO
[1;7m--More--(76%)[m
cpio(1), tar(1), dd(1M), devnm(1M), prtvtoc(1M), rmt(1M),
shutdown(1M), ufsrestore(1M), volcopy(1M), wall(1M),
scanf(3C), attributes(5), largefile(5), st(7D)
NOTES
Read Errors
Fewer than 32 read errors on the file system are ignored.
Process Per Reel
Because each reel requires a new process, parent processes
for reels that are already written hang around until the
entire tape is written.
Operator Intervention
ufsdump requires operator intervention on these conditions:
end of volume, end of dump, volume write error, volume open
error or disk read error (if there are more than a threshold
of 32). In addition to alerting all operators implied by the
n option, ufsdump interacts with the operator on ufsdump's
control terminal at times when ufsdump can no longer
proceed, or if something is grossly wrong. All questions
ufsdump poses [4mmust[m be answered by typing yes or no, as
appropriate.
Since backing up a disk can involve a lot of time and
effort, ufsdump checkpoints at the start of each volume. If
writing that volume fails for some reason, ufsdump will,
with operator permission, restart itself from the checkpoint
after a defective volume has been replaced.
Suggested Dump Schedule
It is vital to perform full, "level 0", dumps at regular
intervals. When performing a full dump, bring the machine
down to single-user mode using shutdown(1M). While prepar-
ing for a full dump, it is a good idea to clean the tape
drive and heads. Incremental dumps should be performed with
the system running in single-user mode.
Incremental dumps allow for convenient backup and recovery
of active files on a more frequent basis, with a minimum of
media and time. However, there are some tradeoffs. First,
the interval between backups should be kept to a minimum
(once a day at least). To guard against data loss as a
result of a media failure (a rare, but possible occurrence),
SunOS 5.9 Last change: 15 Aug 2000 7
System Administration Commands ufsdump(1M)
[1;7m--More--(87%)[m
capture active files on (at least) two sets of dump volumes.
Another consideration is the desire to keep unnecessary
duplication of files to a minimum to save both operator time
and media storage. A third consideration is the ease with
which a particular backed-up version of a file can be
located and restored. The following four-week schedule
offers a reasonable tradeoff between these goals.
Sun Mon Tue Wed Thu Fri
Week 1: Full 5 5 5 5 3
Week 2: 5 5 5 5 3
Week 3: 5 5 5 5 3
Week 4: 5 5 5 5 3
Although the Tuesday through Friday incrementals contain
"extra copies" of files from Monday, this scheme assures
that any file modified during the week can be recovered from
the previous day's incremental dump.
Process Priority of ufsdump
ufsdump uses multiple processes to allow it to read from the
disk and write to the media concurrently. Due to the way it
synchronizes between these processes, any attempt to run
dump with a nice (process priority) of `-5' or better will
likely make ufsdump run [4mslower[m instead of faster.
Overlapping Partitions
Most disks contain one or more overlapping slices because
slice 2 covers the entire disk. The other slices are of
various sizes and usually do not overlap. For example, a
common configuration places root on slice 0, swap on slice
1, /opt on slice 5 and /usr on slice 6.
It should be emphasized that ufsdump dumps one ufs file sys-
tem at a time. Given the above scenario where slice 0 and
slice 2 have the same starting offset, executing ufsdump on
slice 2 with the intent of dumping the entire disk would
instead dump only the root file system on slice 0. To dump
the entire disk, the user must dump the file systems on each
slice separately.
BUGS
The /etc/vfstab file does not allow the desired frequency of
backup for file systems to be specified (as /etc/fstab did).
Consequently, the w and W options assume file systems should
be backed up daily, which limits the usefulness of these
options.
SunOS 5.9 Last change: 15 Aug 2000 8
[1;7m--More--(99%)[m
[K
# man ufsrestore
Reformatting page. Please Wait... done
System Administration Commands ufsrestore(1M)
NAME
ufsrestore - incremental file system restore
SYNOPSIS
/usr/sbin/ufsrestore i | r | R | t | x [abcdfhlmostvyLT]
[[4marchive[m_[4mfile[m] [[4mfactor[m] [[4mdumpfile[m] [[4mn[m] [[4mlabel[m] [[4mtimeout[m] [
[4mfilename[m...]
DESCRIPTION
The ufsrestore utility restores files from backup media
created with the ufsdump command. ufsrestores's actions are
controlled by the [4mkey[m argument. The [4mkey[m is exactly one func-
tion [4mletter[m (i, r, R , t, or x) and zero or more [4mfunction[m
[4mmodifier[ms (letters). The [4mkey[m string contains no SPACE char-
acters. Function modifier arguments are listed on the com-
mand line in the same order as their corresponding function
modifiers appear in the [4mkey[m string.
[4mfilename[m arguments which appear on the command line, or as
arguments to an interactive command, are treated as shell
glob patterns by the x and t functions; any files or direc-
tories matching the patterns are selected. The metacharac-
ters *, ?, and [ ] must be protected from the shell if they
appear on the command line. There is no way to quote these
metacharacters to explicitly match them in a filename.
The temporary files rstdir* and rstmode* are placed in /tmp
by default. If the environment variable TMPDIR is defined
with a non-empty value, that location is used instead of
/tmp.
OPTIONS
Function Letters
You must specify one (and only one) of the function letters
listed below. Note that i, x, and r are intended to restore
files into an empty directory. The R function is intended
for restoring into a populated directory.
i Interactive. After reading in the directory informa-
tion from the media, ufsrestore invokes a shell-like
interface that allows you to browse through the dump
file's directory hierarchy and select individual files
to be extracted. Restoration has the same semantics as
x (see below). See Interactive Commands, below, for a
description of available commands.
[1;7m--More--(10%)[m
r Recursive. Starting with an empty directory and a
level 0 dump, the r function recreates the filesystem
relative to the current working directory, exactly as
it appeared when the dump was made. Information used
to restore incremental dumps on top of the full dump
(for example, restoresymtable) is also included.
SunOS 5.9 Last change: 24 Sep 2002 1
System Administration Commands ufsrestore(1M)
Several ufsrestore runs are typical, one for each
higher level of dump (0, 1, ..., 9). Files that were
deleted between the level 0 and a subsequent incremen-
tal dump will not exist after the final restore. To
completely restore a file system, use the r function
restore the level 0 dump, and again for each incremen-
tal dump. Although this function letter is intended
for a complete restore onto a new file system (one
just created with newfs(1M)), if the file system con-
tains files not on the backup media, they are
preserved.
R Resume restoring. If an r-mode ufsrestore was inter-
rupted, this function prompts for the volume from
which to resume restoring and continues the restora-
tion from where it was left off. Otherwise identical
to r.
t Table of contents. List each [4mfilename[m that appears on
the media. If no [4mfilename[m 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 a
function modifier is used. The a function modifier is
mutually exclusive with the x and r function letters.
x Extract the named files from the media. Files are
restored to the same relative locations that they had
in the original file system.
If the [4mfilename[m argument matches a directory whose
contents were written onto the media, and the h modif-
ier is not in effect, the directory is recursively
extracted, relative to the current directory, which is
expected to be empty. For each file, the owner, modif-
ication time, and mode are restored (if possible).
[1;7m--More--(22%)[m
If you omit the [4mfilename[m argument or specify ., the
root directory is extracted. This results in the
entire tape being extracted, unless the h modifier is
in effect. . With the x function, existing files are
overwritten and ufsrestore displays the names of the
overwritten files. Overwriting a currently-running
executable can have unfortunate consequences.
Use the x option to restore partial file system dumps,
as they are (by definition) not entire file systems.
Function Modifiers
a [4marchive[m_[4mfile[m
Read the table of contents from [4marchive[m_[4mfile[m instead
SunOS 5.9 Last change: 24 Sep 2002 2
System Administration Commands ufsrestore(1M)
of the media. This function modifier can be used in
combination with the t, i, or x function letters, mak-
ing 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 [4mfactor[m
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.
c Convert the contents of the media in 4.1BSD format to
the new ufs file system format.
d Debug. Turn on debugging output.
f [4mdump[m_[4mfile[m
Use [4mdump[m_[4mfile[m instead of /dev/rmt/0 as the file to
restore from. Typically [4mdump[m_[4mfile[m specifies a tape or
diskette drive. If [4mdump[m_[4mfile[m is specified as `-',
ufsrestore reads from the standard input. This allows
ufsdump(1M) and ufsrestore to be used in a pipeline to
copy a file system:
[1;7m--More--(33%)[m
[K
example# ufsdump 0f - /dev/rdsk/c0t0d0s7 \
| (cd /home;ufsrestore xf -)
If the name of the file is of the form [4mmachine[m:[4mdevice[m,
the restore is done from the specified machine over
the network using rmt(1M). Since ufsrestore is nor-
mally 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 [4muser[m@[4mmachine[m:[4mdevice[m, ufsre-
store 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 subtrees from the tape.
SunOS 5.9 Last change: 24 Sep 2002 3
System Administration Commands ufsrestore(1M)
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 [4mlabel[m
The label that should appear in the header of the dump
file. If the labels do not match, ufsrestore issues a
diagnostic and exits. The tape label is specific to
the ufsdump tape format, and bears no resemblance to
IBM or ANSI-standard tape labels.
m Extract by inode 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 inode number. This is useful if
only a few files are being extracted.
o Offline. Take the drive off-line when the restore is
complete or the end-of-media is reached and rewind the
[1;7m--More--(44%)[m
tape, or eject the diskette. In the case of some auto-
loading 8mm drives, the tape is removed from the drive
automatically.
s [4mn[m Skip to the [4mn[m'th file when there are multiple dump
files on the same tape. For example, the command:
example# ufsrestore 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 [4mn[m"
value is specified.
If "s [4mn[m" is specified, the backup media must be at BOT
(beginning of tape). Otherwise, the initial position-
ing to read the table of contents will fail, as it is
performed by skipping the tape forward [4mn[m-1 files
rather than by using absolute positioning. This is
because on some devices absolute positioning is very
time consuming.
T timeout [hms]
SunOS 5.9 Last change: 24 Sep 2002 4
System Administration Commands ufsrestore(1M)
Sets the amount of time to wait for an autoload com-
mand to complete. This function modifier is ignored
unless the l function modifier has also been speci-
fied. 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. ufsrestore displays the name and inode number
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. ufsrestore tries to skip over the bad
tape block(s) and continue as best it can.
Interactive Commands
ufsrestore enters interactive mode when invoked with the i
function letters. Interactive commands are reminiscent of
the shell. For those commands that accept an argument, the
default is the current directory. The interactive options
[1;7m--More--(54%)[m
are:[K
add [[4mfilename[m]
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 extrac-
tion list (unless the h modifier is in effect).
cd [4mdirectory[m
Change to [4mdirectory[m (within the dump file).
delete [[4mfilename[m]
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
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. ufsrestore 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. If "s [4mn[m" is given on the command line,
volume 1 will automatically be positioned to file [4mn[m
when it is read.
help Display a summary of the available commands.
SunOS 5.9 Last change: 24 Sep 2002 5
System Administration Commands ufsrestore(1M)
ls [[4mdirectory[m]
List files in [4mdirectory[m 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, inode numbers are also
listed.
marked [[4mdirectory[m]
Like ls, except only files marked for extraction are
listed.
pager Toggle the pagination of the output from the ls and
[1;7m--More--(64%)[m
marked commands. The pager 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 direc-
tory.
quit ufsrestore 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. Nor-
mally, 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 res-
toring part of a dump to a directory other than the
one from which the files were dumped.
setpager [4mcommand[m
Sets the command to use for paginating output instead
of the default or that inherited from the environment.
The [4mcommand[m string may include arguments in addition
to the command itself.
verbose
Toggle the status of the v modifier. While v is in
effect, the ls command lists the inode numbers of all
entries, and ufsrestore displays information about
each file as it is extracted.
what Display the dump header on the media.
SunOS 5.9 Last change: 24 Sep 2002 6
System Administration Commands ufsrestore(1M)
OPERANDS
The following operands are supported.
[4mfilename[m
Specifies the pathname of files (or directories) to be
restored to disk. Unless the h function modifier is
[1;7m--More--(74%)[m
also used, a directory name refers to the files it
contains, and (recursively) its subdirectories and the
files they contain. [4mfilename[m is associated with either
the x or t function letters, and must come last.
USAGE
See largefile(5) for the description of the behavior of
ufsrestore when encountering files greater than or equal to
2 Gbyte ( 2**31 bytes).
EXIT STATUS
The following exit values are returned:
0 Successful completion.
1 An error occurred. Verbose messages are displayed.
ENVIRONMENT VARIABLES
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
Selects the directory for temporary files. Defaults to
/tmp if not defined in the environment.
FILES
/dev/rmt/0
the default tape drive
$TMPDIR/rstdir*
file containing directories on the tape
$TMPDIR/rstmode*
owner, mode, and timestamps for directories
./restoresymtable
information passed between incremental restores
ATTRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
SunOS 5.9 Last change: 24 Sep 2002 7
System Administration Commands ufsrestore(1M)
____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
[1;7m--More--(81%)[m
|_____________________________[4m|[m_____________________________[4m|[m
| Availability | SUNWcsu |
|_____________________________[4m|[m_____________________________[4m|[m
SEE ALSO
more(1), mkfs(1M), mount(1M), rmt(1M), ufsdump(1M), attri-
butes(5), largefile(5)
DIAGNOSTICS
ufsrestore complains about bad option characters.
Read errors result in complaints. If y has been specified,
or the user responds y, ufsrestore will attempt to continue.
If the dump extends over more than one tape, ufsrestore asks
the user to change tapes. If the x or i function letter has
been specified, ufsrestore also asks which volume the user
wishes to mount. If the s 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
ufsrestore. Most checks are self-explanatory or can "never
happen". Common errors are given below.
Converting to new file system format
A dump tape created from the old file system has been
loaded. It is automatically converted to the new file
system format.
[4mfilename[m: not found on tape
The specified file name was listed in the tape direc-
tory, but was not found on the tape. This is caused by
tape read errors while looking for the file, using a
dump tape created on an active file system, or restor-
ing a partial dump with the r function.
expected next file [4minumber[m, got [4minumber[m
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
[1;7m--More--(91%)[m
[K
SunOS 5.9 Last change: 24 Sep 2002 8
System Administration Commands ufsrestore(1M)
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
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 inode 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 ufsrestore, skipped [4mnum[m
After a tape read error, ufsrestore may have to resyn-
chronize itself. This message lists the number of
blocks that were skipped over.
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.
NOTES
ufsrestore 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
ufsrestore runs in user mode, it has no control over inode
allocation. This means that ufsrestore 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.
SunOS 5.9 Last change: 24 Sep 2002 9
[1;7m--More--(99%)[m
[K
# exit
script done on Tue 30 May 2006 06:16:59 PM CST
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/11327/showart_120521.html |
|