make 'R' into a real mode
[unix-history] / usr / src / sbin / restore / restore.8
CommitLineData
85d07773
KM
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
da406866 5.\" @(#)restore.8 6.1 (Berkeley) %G%
85d07773 6.\"
da406866 7.TH RESTORE 8 ""
85d07773
KM
8.UC 4
9.SH NAME
95c6920e 10restore \- incremental file system restore
85d07773 11.SH SYNOPSIS
95c6920e
KM
12.B /etc/restore
13key [ name ... ]
85d07773 14.SH DESCRIPTION
95c6920e
KM
15.PP
16.I Restore
17reads tapes dumped with the
18.IR dump (8)
85d07773 19command.
95c6920e
KM
20Its actions are controlled by the
21.I key
22argument.
85d07773
KM
23The
24.I key
95c6920e
KM
25is a string of characters containing
26at most one function letter and possibly
27one or more function modifiers.
28Other arguments to the command are file or directory
29names specifying the files that are to be restored.
30Unless the
31.B h
32key is specified (see below),
33the appearance of a directory name refers to
34the files and (recursively) subdirectories of that directory.
85d07773 35.PP
95c6920e
KM
36The function portion of
37the key is specified by one of the following letters:
38.TP 5n
39.B r
40The tape
41is read and loaded into the current directory.
42This should not be done lightly; the
85d07773 43.B r
95c6920e 44key should only be used to restore
85d07773 45a complete dump tape onto a clear file system
95c6920e 46or to restore an incremental dump tape after a full level zero restore.
85d07773 47Thus
95c6920e
KM
48.IP "" 5n
49 /etc/newfs /dev/rrp0g eagle
85d07773 50.br
95c6920e
KM
51 /etc/mount /dev/rp0g /mnt
52.br
53 cd /mnt
54.br
55 restore r
56.IP "" 5n
85d07773
KM
57is a typical sequence to restore a complete dump.
58Another
95c6920e 59.I restore
85d07773
KM
60can be done to get an incremental dump
61in on top of this.
95c6920e
KM
62Note that
63.I restore
64leaves a file
65.I restoresymtab
66in the root directory to pass information between incremental
67restore passes.
68This file should be removed when the last incremental tape has been
69restored.
70.br
85d07773 71A
95c6920e 72.IR dump (8)
85d07773 73followed by a
95c6920e 74.IR newfs (8)
85d07773 75and a
95c6920e
KM
76.I restore
77is used to change the size of a file system.
78.TP 5n
79.B R
80.I Restore
81requests a particular tape of a multi volume set on which to restart
82a full restore
83(see the
84.B r
85key above).
86This allows
87.I restore
88to be interrupted and then restarted.
89.TP 5n
90.B x
91The named files are extracted from the tape.
92If the named file matches a directory whose contents
93had been written onto the tape,
94and the
95.B h
96key is not specified,
97the directory is recursively extracted.
98The owner, modification time,
99and mode are restored (if possible).
100If no file argument is given,
101then the root directory is extracted,
102which results in the entire content of the
103tape being extracted,
104unless the
105.B h
106key has been specified.
107.TP 5n
108.B t
109The names of the specified files are listed if they occur
110on the tape.
111If no file argument is given,
112then the root directory is listed,
113which results in the entire content of the
114tape being listed,
115unless the
116.B h
117key has been specified.
118Note that the
119.B t
120key replaces the function of the old
121.I dumpdir
122program.
123.TP 5n
124.B i
125This mode allows interactive restoration of files from a dump tape.
126After reading in the directory information from the tape,
127.I restore
128provides a shell like interface that allows the user to move
129around the directory tree selecting files to be extracted.
130The available commands are given below;
131for those commands that require an argument,
132the default is the current directory.
133.IP "" 10n
134.ti -5n
85d07773 135.br
95c6920e
KM
136.B ls
137[arg] \-
138List the current or specified directory.
139Entries that are directories are appended with a ``/''.
140Entries that have been marked for extraction are prepended with a ``*''.
141If the verbose key is set the inode number of each entry is also listed.
142.ti -5n
143.sp
144.B cd
145arg \-
146Change the current working directory to the specified argument.
147.ti -5n
148.sp
149.B pwd
150\-
151Print the full pathname of the current working directory.
152.ti -5n
153.sp
154.B add
155[arg] \-
156The current directory or specified argument is added to the list of
157files to be extracted.
158If a directory is specified, then it and all its descendents are
159added to the extraction list
160(unless the
161.B h
162key is specified on the command line).
163Files that are on the extraction list are prepended with a ``*''
164when they are listed by
165.BR ls .
166.ti -5n
167.sp
168.B delete
169[arg] \-
170The current directory or specified argument is deleted from the list of
171files to be extracted.
172If a directory is specified, then it and all its descendents are
173deleted from the extraction list
174(unless the
175.B h
176key is specified on the command line).
177The most expedient way to extract most of the files from a directory
178is to add the directory to the extraction list and then delete
179those files that are not needed.
180.ti -5n
181.sp
182.B extract
183\-
184All the files that are on the extraction list are extracted
185from the dump tape.
186.I Restore
187will ask which volume the user wishes to mount.
188The fastest way to extract a few files is to
189start with the last volume, and work towards the first volume.
190.ti -5n
191.sp
192.B verbose
193\-
194The sense of the
195.B v
196key is toggled.
197When set, the verbose key causes the
198.B ls
199command to list the inode numbers of all entries.
200It also causes
201.I restore
202to print out information about each file as it is extracted.
203.ti -5n
204.sp
205.B help
206\-
207List a summary of the available commands.
208.ti -5n
209.sp
210.B quit
211\-
212Restore immediately exits,
213even if the extraction list is not empty.
214.sp
215.PP
216The following characters may be used in addition to the letter
217that selects the function desired.
218.TP 5n
219.B v
220Normally
221.I restore
222does its work silently.
223The
224.B v
225(verbose)
226key causes it to type the name of each file it treats
227preceded by its file type.
228.TP 5n
229.B f
230The next argument to
231.I restore
232is used as the name of the archive instead
233of /dev/rmt?.
234If the name of the file is ``\-'',
235.I restore
236reads from standard input.
237Thus,
238.IR dump (8)
239and
240.I restore
241can be used in a pipeline to dump and restore a file system
242with the command
243.IP "" 5n
244 dump 0f - /usr | (cd /mnt; restore xf -)
245.TP 5n
246.B y
247.I Restore
248will not ask whether it should abort the restore if gets a tape error.
249It will always try to skip over the bad tape block(s) and continue as
250best it can.
251.TP 5n
252.B m
253.I Restore
254will extract by inode numbers rather than by file name.
255This is useful if only a few files are being extracted,
256and one wants to avoid regenerating the complete pathname
257to the file.
258.TP 5n
259.B h
260.I Restore
261extracts the actual directory,
262rather than the files that it references.
263This prevents hierarchical restoration of complete subtrees
264from the tape.
85d07773 265.SH DIAGNOSTICS
95c6920e
KM
266Complaints about bad key characters.
267.PP
268Complaints if it gets a read error.
269If
270.B y
271has been specified, or the user responds ``y'',
272.I restore
273will attempt to continue the restore.
85d07773
KM
274.PP
275If the dump extends over more than one tape,
95c6920e
KM
276.I restore
277will ask the user to change tapes.
278If the
279.B x
280or
281.B i
282key has been specified,
283.I restore
284will also ask which volume the user wishes to mount.
285The fastest way to extract a few files is to
286start with the last volume, and work towards the first volume.
287.PP
288There are numerous consistency checks that can be listed by
289.IR restore .
290Most checks are self-explanatory or can ``never happen''.
291Common errors are given below.
292.IP "Converting to new file system format." 5n
293.br
294A dump tape created from the old file system has been loaded.
295It is automatically converted to the new file system format.
296.IP "<filename>: not found on tape" 5n
297.br
298The specified file name was listed in the tape directory,
299but was not found on the tape.
300This is caused by tape read errors while looking for the file,
301and from using a dump tape created on an active file system.
302.IP "expected next file <inumber>, got <inumber>" 5n
303.br
304A file that was not listed in the directory showed up.
305This can occur when using a dump tape created on an active file system.
306.IP "Incremental tape too low" 5n
307.br
308When doing incremental restore,
309a tape that was written before the previous incremental tape,
310or that has too low an incremental level has been loaded.
311.IP "Incremental tape too high" 5n
312.br
313When doing incremental restore,
314a tape that does not begin its coverage where the previous incremental
315tape left off,
316or that has too high an incremental level has been loaded.
317.IP "Tape read error while restoring <filename>" 5n
318.ti -5n
319.br
320Tape read error while skipping over inode <inumber>
321.ti -5n
322.br
323Tape read error while trying to resynchronize
324.br
325A tape read error has occurred.
326If a file name is specified,
327then its contents are probably partially wrong.
328If an inode is being skipped or the tape is trying to resynchronize,
329then no extracted files have been corrupted,
330though files may not be found on the tape.
331.IP "resync restore, skipped <num> blocks" 5n
332.br
333After a tape read error,
334.I restore
335may have to resynchronize itself.
336This message lists the number of blocks that were skipped over.
337.SH FILES
338/dev/rmt? the default tape drive
339.br
340/tmp/rstdir* file containing directories on the tape.
341.br
342/tmp/rstmode* owner, mode, and time stamps for directories.
343.br
344\&./restoresymtab information passed between incremental restores.
345.SH SEE ALSO
346rrestore(8C) dump(8), newfs(8), mount(8), mkfs(8)
85d07773 347.SH BUGS
95c6920e
KM
348.I Restore
349can get confused when doing incremental restores from
350dump tapes that were made on active file systems.
351.PP
352A level zero dump must be done after a full restore.
353Because restore runs in user code,
354it has no control over inode allocation;
355thus a full restore must be done to get a new set of directories
356reflecting the new inode numbering,
357even though the contents of the files is unchanged.