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