.\" SUCH DAMAGE.
.\"
.\" @(#)restore.8 8.4 (Berkeley) 5/1/95
-.\" $Id: restore.8,v 1.2 1999/10/11 12:53:24 stelian Exp $
+.\" $Id: restore.8,v 1.3 1999/10/11 12:59:20 stelian Exp $
.\"
.Dd May 1, 1995
.Dt RESTORE 8
.in -\\n(iSu
(The
.Bx 4.3
-option syntax is implemented for backward compatibility, but
+option syntax is implemented for backward compatibility but
is not documented here.)
.Sh DESCRIPTION
The
(unless the
.Fl h
flag is specified on the command line).
-Files that are on the extraction list are prepended with a ``*''
+Files that are on the extraction list are prepended with a
+.Dq \&*
when they are listed by
.Ic ls .
.It Ic \&cd Ar arg
is to add the directory to the extraction list and then delete
those files that are not needed.
.It Ic extract
-All the files that are on the extraction list are extracted
+All files on the extraction list are extracted
from the dump.
.Nm Restore
will ask which volume the user wishes to mount.
The fastest way to extract a few files is to
-start with the last volume, and work towards the first volume.
+start with the last volume and work towards the first volume.
.It Ic help
List a summary of the available commands.
.It Ic \&ls Op Ar arg
List the current or specified directory.
-Entries that are directories are appended with a ``/''.
+Entries that are directories are appended with a
+.Dq \&* .
Entries that have been marked for extraction are prepended with a ``*''.
If the verbose
-flag is set the inode number of each entry is also listed.
+flag is set, the inode number of each entry is also listed.
.It Ic pwd
Print the full pathname of the current working directory.
.It Ic quit
Restore immediately exits,
even if the extraction list is not empty.
.It Ic setmodes
-All the directories that have been added to the extraction list
+All directories that have been added to the extraction list
have their owner, modes, and times set;
nothing is extracted from the dump.
This is useful for cleaning up after a restore has been prematurely aborted.
.El
.It Fl R
.Nm Restore
-requests a particular tape of a multi volume set on which to restart
+requests a particular tape of a multi-volume set on which to restart
a full restore
(see the
.Fl r
flag below).
This is useful if the restore has been interrupted.
.It Fl r
-Restore (rebuild a file system).
+Restore (rebuild) a file system.
The target file system should be made pristine with
.Xr newfs 8 ,
-mounted and the user
+mounted, and the user
.Xr cd Ns 'd
into the pristine file system
before starting the restoration of the initial level 0 backup. If the
The
.Fl r
flag precludes an interactive file extraction and can be
-detrimental to one's health if not used carefully (not to mention
-the disk). An example:
+detrimental to one's health (not to mention the disk) if not used carefully.
+An example:
.Bd -literal -offset indent
newfs /dev/rrp0g eagle
mount /dev/rp0g /mnt
The names of the specified files are listed if they occur
on the backup.
If no file argument is given,
-then the root directory is listed,
+the root directory is listed,
which results in the entire content of the
backup being listed,
unless the
The owner, modification time,
and mode are restored (if possible).
If no file argument is given,
-then the root directory is extracted,
+the root directory is extracted,
which results in the entire content of the
backup being extracted,
unless the
.Ar file
may be a special device file
like
-.Pa /dev/rmt12
+.Pa /dev/st0
(a tape drive),
.Pa /dev/rsd1c
(a disk drive),
.Ql Fl
(the standard input).
If the name of the file is of the form
-.Dq host:file ,
+.Dq host:file
or
.Dq user@host:file ,
.Nm restore
Always try to skip over the bad block(s) and continue.
.El
.Sh DIAGNOSTICS
-Complaints if it gets a read error.
+Complains if it gets a read error.
If
.Fl y
has been specified, or the user responds
.Pp
There are numerous consistency checks that can be listed by
.Nm restore .
-Most checks are self-explanatory or can ``never happen''.
+Most checks are self-explanatory or can
+.Dq never happen .
Common errors are given below.
.Pp
.Bl -tag -width Ds -compact
-.It Converting to new file system format.
+.It 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.
.Pp
This can occur when using a dump created on an active file system.
.Pp
.It Incremental dump too low
-When doing incremental restore,
+When doing an incremental restore,
a dump that was written before the previous incremental dump,
or that has too low an incremental level has been loaded.
.Pp
.It Incremental dump too high
-When doing incremental restore,
+When doing an incremental restore,
a dump that does not begin its coverage where the previous incremental
dump left off,
or that has too high an incremental level has been loaded.
.It Tape read error while trying to resynchronize
A tape (or other media) read error has occurred.
If a file name is specified,
-then its contents are probably partially wrong.
+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,
+no extracted files have been corrupted,
though files may not be found on the tape.
.Pp
.It resync restore, skipped <num> blocks
This message lists the number of blocks that were skipped over.
.El
.Sh ENVIRONMENT
-.Bl -tag -width Fl
+If the following environment variable exists it will be utilized by
+.Nm restore :
+.Pp
+.Bl -tag -width "TMPDIR" -compact
.It Ev TAPE
If no -f option was specified,
.Nm
.Ev TAPE
may be of the form
.Qq tapename ,
-.Qq host:tapename ,
+.Qq host:tapename
or
.Qq user@host:tapename .
+.It Ev TMPDIR
+The directory given in
+.Ev TMPDIR
+will be used
+instead of
+.Pa /tmp
+to store temporary files.
.It Ev RMT
The environment variable
.Ev RMT
program.
.Sh FILES
.Bl -tag -width "./restoresymtable" -compact
-.It Pa /dev/rmt?
+.It Pa /dev/st0
the default tape drive
.It Pa /tmp/rstdir*
-file containing directories on the tape.
+file containing directories on the tape
.It Pa /tmp/rstmode*
-owner, mode, and time stamps for directories.
+owner, mode, and time stamps for directories
.It Pa \&./restoresymtable
-information passed between incremental restores.
+information passed between incremental restores
.El
.Sh SEE ALSO
.Xr dump 8 ,
can get confused when doing incremental restores from
dumps that were made on active file systems.
.Pp
-A level zero dump must be done after a full restore.
-Because restore runs in user code,
+A level 0 dump must be done after a full restore.
+Because
+.Nm restore
+runs in user code,
it has no control over inode allocation;
thus a full dump must be done to get a new set of directories
reflecting the new inode numbering,
-even though the contents of the files is unchanged.
+even though the content of the files is unchanged.
+.Pp
+The temporary files
+.Pa /tmp/rstdir*
+and
+.Pa /tmp/rstmode*
+are generated with a unique name based on the date of the dump
+and the process ID (see
+.Xr mktemp 3 ),
+except when
+.Fl r
+or
+.Fl R
+is used.
+Because
+.Fl R
+allows you to restart a
+.Fl r
+operation that may have been interrupted, the temporary files should
+be the same across different processes.
+In all other cases, the files are unique because it is possible to
+have two different dumps started at the same time, and separate
+operations shouldn't conflict with each other.
.Pp
To do a network restore, you have to run restore as root. This is due
to the previous security history of dump and restore. (restore is