Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

dump(8)

mkfs(8)

mount(8)

rrestore(8c)

restore(8)

Name

restore − incremental file system restore

Syntax

/etc/restore key [ name... ]

Description

The restore command reads from magnetic tapes, disks, a file, or a pipe created by the dump() command.  The default dump media from which files are read is /dev/rmt0h.

This utility supports EOT handling which allows the use of multiple media.  The utility prompts for the next volume when it encounters the end of the current volume. 

This utility supports the TA90 style sequential stacker loader device.  The device ejects a cartridge when it is taken off line.  This utility performs the device ejection on behalf of the user when it encounters a multivolume boundary during write or read operations involving tape.  The device then automatically loads the next available tape (if there is one).  The utility then attempts to access this next tape for a reasonable amount of time (approximately three minutes) before prompting the user for a manual reload operation. 

You can request another dump device or dump image file by using the f key modifier.  The key is a character string containing one function letter and possibly one or more function modifiers.  Other arguments to the command are file or directory names specifying the files to be restored.  Unless the h key is specified, the appearance of a directory name refers to all files and, recursively, the subdirectories of that directory.  The function portion of the key is specified by one of the following letters:

Keys

L Permits the program to treat the tape drive as a sequential loader device even though it is not represented as such in the system driver tables. 

i This key allows interactive restoration of files from the dump media.  After reading in the directory information from the dump media, restore lets the user move around the directory tree selecting or deselecting files to be extracted. Only the first letter of the interactive commands are parsed. The available interactive commands are:

ls [arg] List the specified directory.  If no directory is specified, the user’s current directory is listed.  Entries that are directories are appended with a slash (/).  Entries that have been marked for extraction are prepended with an asterisk (*).  If the verbose key is set, the inode number of each entry is also listed. 

cd arg Change the current working directory to the directory specified. 

pwd Print the full pathname of the current working directory. 

add [arg] The current directory or the specified argument (a directory or file) is added to the extraction list (the list of files to be extracted).  If a directory is specified, then it and all its descendents are added to the extraction list, unless the h key is specified on the command line.  Files that are on the extraction list are prepended with an asterisk (*) when they are listed by ls. 

delete [arg] The current directory or specified argument is deleted from the extraction list (the list of files to be extracted).  If a directory is specified, then it and all its descendents are deleted from the extraction list, unless the h key modifier is specified on the command line.  The easiest way to extract most of the files from a directory is to add the directory to the extraction list and then delete those files that are not needed. 

extract All the files on the extraction list are extracted from the dump media.  The restore command asks which volume the user wishes to mount.

verbose The verbose ( v ) key is toggled.  Entering the command turns on verbose.  Entering the command again turns off verbose.  When used, the verbose key causes the ls command to list the inode numbers of all entries.  It also causes restore to print out information about each file as it is extracted.

help List a summary of the available commands. 

quit The restore utility immediately exits, even if the extraction list is not empty. A synonym exists for this command: x. Do not confuse this interactive command with the extract key, x, described below.

R The restore utility prompts for a particular volume of a multivolume set on which to restart a full restore. This option lets restore be interrupted and then restarted.

r The dump media’s data is read into the current directory.  You should use this function key only to restore the complete dump media onto a newly created file system, or to restore incremental dump media after a full level-0 restore.  See the Examples section for a typical sequence to restore complete dump media.  Note that restore leaves a file, restoresymtab, in the root directory to pass information between incremental restore passes.  Remove this file after the last incremental dump media has been restored. A dump() followed by a newfs() and a restore() can be used to change the size of a file system.

t The names of the specified files are listed if they occur on the dump media.  If no name argument is given, then the root directory is listed.  This results in the entire contents of the dump media being listed, unless the h key modifier has been specified. 

x The files specified by the name argument are extracted from the dump media.  If a named file matches a directory whose contents had been written onto the dump media and the h key modifier is not specified, the directory is recursively extracted.  The owner, modification time, and mode are restored, if possible.  If no name argument is given, the root directory is extracted.  This results in the extraction of the entire contents of the dump media unless the h key modifier has been specified. 

You can use any of the following characters in addition to the letter that selects the function desired:

B The next argument to restore is a number giving the size, in 1024-byte blocks, of a fixed-size storage medium, such as diskettes or removable disks (see the Examples section). The restore command does not ask whether it should abort the restore if there is a dump media read error.  It always tries to skip over the bad block(s) and continue.

f The next argument to restore is used as the name of the archive instead of /dev/rmt0h. If the argument is a dash (−), restore reads from standard input (see the Examples section).

h The restore command extracts the actual directory, rather than the files that it references.  This prevents hierarchical restoration of complete subtrees from the dump media:

m The restore command extracts by inode numbers rather than by file name.  This is useful if only a few files are being extracted, and you want to avoid typing the complete pathname to the file.

s The next argument identifies, by number, which dump file on the dump media is to be used by restore. This is useful when the dump media has more than one dump image on it and not all of them will be restored.

v Normally, restore does its work silently. The v (verbose) key modifier causes it to display the name of each file it treats, preceded by its file type. 

Examples

The following example shows a typical sequence of commands to restore complete dump media. 

/etc/newfs /dev/rra0g ra60
/etc/mount /dev/ra0g /mnt
cd /mnt
restore r

Another restore can be done to get an incremental dump.

The following example shows how dump() and restore() can be used in a pipeline to dump and restore a file system:

dump 0f - /usr | (cd /mnt; restore xf -)

The following example shows how to restore files interactively from a dump on RX50 diskettes:

restore iBf 400 /dev/ra2a

The following example shows how to obtain a log after dumping multiple file systems to the no-rewind device:

 dump 0uf /dev/nrmt1h /junkd
dump 0uf /dev/nrmt1h /junke
dump 0uf /dev/nrmt1h /junkf
mt -f /dev/rmt1h rew
restore tvf /dev/nrmt1h
restore tvfs /dev/nrmt1h 2
restore tvfs /dev/nrmt1h 2
 

The following example shows how to restore the fifth file system from a multiarchive dump:

restore rvfs /dev/rmt1h 5

Restrictions

The restore utility can make errors when doing incremental restores from dump media that were made on active file systems.

You must do a level 0 dump after a full restore.  Because restore runs in user code, it has no control over inode allocation; thus, you must do a full restore to get a new set of directories that reflects the new inode numbering, even though the contents of the files are unchanged.

Tape position following a t command is before the end of archive tape mark.  Tape position after the r command is after the end of archive tape mark.

The utility requires that the initial tape position is at the start of an archive, unless the s option is used.

Diagnostics

Complains about bad key characters. 

Complains if it gets a dump media read error.  If the user responds with a y, restore attempts to continue the restore.

If the dump extends over more than one dump volume, restore will ask the user to change volumes. If the x or i function key has been specified, restore also asks which volume the user wishes to mount.

There are numerous consistency checks that can be listed by restore. Most checks are self-explanatory. Some common errors are:

Converting to new file system format
If dump media created from the Fast File System (FFS) has been loaded. It is automatically converted to the Berkeley Version 4.2 file system format.

<filename>: not found on tape{disk}
The specified file name was listed in the dump media directory, but was not found on the media. This is caused by dump media read errors while looking for the file or from using dump media created on an active file system. Expected next file <inumber>, got <inumber>
A file that was not listed in the directory was found on the media. This can occur when using dump media created on an active file system.

Incremental tape{disk} too low
When doing incremental restore, dump media was loaded that was written before the previous incremental media or has too low an incremental level.

Incremental tape{disk} too high
When doing incremental restore, dump media that does not begin its coverage where the previous incremental dump media left off, or that has too high an incremental level has been loaded.

Tape{Disk} read error while restoring <filename>
Dump media read error while skipping over inode <inumber>
Dump media read error while trying to resynchronize
A dump media 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 restore is trying to resynchronize, then no extracted files have been corrupted, although files may not be found on the dump media.

resync restore, skipped <num> blocks
After a dump media read error, restore may have to resynchronize itself. This message lists the number of blocks that were skipped.

Files

/dev/rmt0h Default tape drive

/tmp/rstdir File containing directories on the dump media

/tmp/rstmode*
Owner, mode, and time stamps for directories

/restoresymtab
Information passed between incremental restores

/dev/tty Required for user interface

See Also

dump(8), mkfs(8), mount(8), rrestore(8c)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026