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