]>
Commit | Line | Data |
---|---|---|
1227625a SP |
1 | .\" Copyright (c) 1985, 1991, 1993 |
2 | .\" The Regents of the University of California. All rights reserved. | |
3 | .\" | |
4 | .\" Redistribution and use in source and binary forms, with or without | |
5 | .\" modification, are permitted provided that the following conditions | |
6 | .\" are met: | |
7 | .\" 1. Redistributions of source code must retain the above copyright | |
8 | .\" notice, this list of conditions and the following disclaimer. | |
9 | .\" 2. Redistributions in binary form must reproduce the above copyright | |
10 | .\" notice, this list of conditions and the following disclaimer in the | |
11 | .\" documentation and/or other materials provided with the distribution. | |
e1abc9ce | 12 | .\" 3. Neither the name of the University nor the names of its contributors |
1227625a SP |
13 | .\" may be used to endorse or promote products derived from this software |
14 | .\" without specific prior written permission. | |
15 | .\" | |
16 | .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | |
17 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
18 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
19 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
20 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
21 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
22 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
23 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
24 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
25 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
26 | .\" SUCH DAMAGE. | |
27 | .\" | |
e1abc9ce | 28 | .\" $Id: restore.8.in,v 1.30 2003/03/30 15:40:39 stelian Exp $ |
1227625a | 29 | .\" |
153f9a83 SP |
30 | .TH RESTORE 8 "version __VERSION__ of __DATE__" BSD "System management commands" |
31 | .SH NAME | |
32 | restore \- restore files or file systems from backups made with dump | |
33 | .SH SYNOPSIS | |
34 | .B restore \-C | |
35 | [\fB\-cdklMvVy\fR] | |
36 | [\fB\-b \fIblocksize\fR] | |
37 | [\fB\-D \fIfilesystem\fR] | |
38 | [\fB\-f \fIfile\fR] | |
39 | [\fB\-F \fIscript\fR] | |
40 | [\fB\-L \fIlimit\fR] | |
41 | [\fB\-s \fIfileno\fR] | |
42 | [\fB\-T \fIdirectory\fR] | |
43 | .PP | |
44 | .B restore \-i | |
45 | [\fB\-acdhklmMNouvVy\fR] | |
46 | [\fB\-A \fIfile\fR] | |
47 | [\fB\-b \fIblocksize\fR] | |
48 | [\fB\-f \fIfile\fR] | |
49 | [\fB\-F \fIscript\fR] | |
50 | [\fB\-Q \fIfile\fR] | |
51 | [\fB\-s \fIfileno\fR] | |
52 | [\fB\-T \fIdirectory\fR] | |
53 | .PP | |
54 | .B restore \-P | |
55 | .I file | |
56 | [\fB\-acdhklmMNuvVy\fR] | |
57 | [\fB\-A \fIfile\fR] | |
58 | [\fB\-b \fIblocksize\fR] | |
59 | [\fB\-f \fIfile\fR] | |
60 | [\fB\-F \fIscript\fR] | |
61 | [\fB\-s \fIfileno\fR] | |
62 | [\fB\-T \fIdirectory\fR] | |
63 | [\fB\-X \fIfilelist\fR] | |
64 | [ \fIfile ... \fR] | |
65 | .PP | |
66 | .B restore \-R | |
67 | [\fB\-cdklMNuvVy\fR] | |
68 | [\fB\-b \fIblocksize\fR] | |
69 | [\fB\-f \fIfile\fR] | |
70 | [\fB\-F \fIscript\fR] | |
71 | [\fB\-s \fIfileno\fR] | |
72 | [\fB\-T \fIdirectory\fR] | |
73 | .PP | |
74 | .B restore \-r | |
75 | [\fB\-cdklMNuvVy\fR] | |
76 | [\fB\-b \fIblocksize\fR] | |
77 | [\fB\-f \fIfile\fR] | |
78 | [\fB\-F \fIscript\fR] | |
79 | [\fB\-s \fIfileno\fR] | |
80 | [\fB\-T \fIdirectory\fR] | |
81 | .PP | |
82 | .B restore \-t | |
83 | [\fB\-cdhklMNuvVy\fR] | |
84 | [\fB\-A \fIfile\fR] | |
85 | [\fB\-b \fIblocksize\fR] | |
86 | [\fB\-f \fIfile\fR] | |
87 | [\fB\-F \fIscript\fR] | |
88 | [\fB\-Q \fIfile\fR] | |
89 | [\fB\-s \fIfileno\fR] | |
90 | [\fB\-T \fIdirectory\fR] | |
91 | [\fB\-X \fIfilelist\fR] | |
92 | [ \fIfile ... \fR] | |
93 | .PP | |
94 | .B restore \-x | |
95 | [\fB\-adchklmMNouvVy\fR] | |
96 | [\fB\-A \fIfile\fR] | |
97 | [\fB\-b \fIblocksize\fR] | |
98 | [\fB\-f \fIfile\fR] | |
99 | [\fB\-F \fIscript\fR] | |
100 | [\fB\-Q \fIfile\fR] | |
101 | [\fB\-s \fIfileno\fR] | |
102 | [\fB\-T \fIdirectory\fR] | |
103 | [\fB\-X \fIfilelist\fR] | |
104 | [ \fIfile ... \fR] | |
105 | .PP | |
106 | (The 4.3BSD option syntax is implemented for backward compatibility but is not | |
107 | documented here.) | |
108 | .SH DESCRIPTION | |
1227625a | 109 | The |
153f9a83 | 110 | .B restore |
1227625a | 111 | command performs the inverse function of |
153f9a83 SP |
112 | .BR dump (8). |
113 | A full backup of a file system may be restored and subsequent incremental | |
114 | backups layered on top of it. Single files and directory subtrees may be | |
115 | restored from full or partial backups. | |
116 | .B Restore | |
117 | works across a network; to do this see the | |
118 | .B \-f | |
119 | flag described below. Other arguments to the command are file or directory | |
120 | names specifying the files that are to be restored. Unless the | |
121 | .B \-h | |
122 | flag is specified (see below), the appearance of a directory name refers to | |
1227625a | 123 | the files and (recursively) subdirectories of that directory. |
153f9a83 | 124 | .PP |
1227625a | 125 | Exactly one of the following flags is required: |
153f9a83 SP |
126 | .TP |
127 | .B \-C | |
1227625a | 128 | This mode allows comparison of files from a dump. |
153f9a83 SP |
129 | .B Restore |
130 | reads the backup and compares its contents with files present on the disk. It | |
131 | first changes its working directory to the root of the filesystem that was | |
132 | dumped and compares the tape with the files in its new current directory. See | |
133 | also the | |
134 | .B \-L | |
05f23c0c | 135 | flag described below. |
153f9a83 SP |
136 | .TP |
137 | .B \-i | |
138 | This mode allows interactive restoration of files from a dump. After reading in | |
139 | the directory information from the dump, | |
140 | .B restore | |
141 | provides a shell like interface that allows the user to move around the | |
142 | directory tree selecting files to be extracted. The available commands are | |
143 | given below; for those commands that require an argument, the default is the | |
144 | current directory. | |
145 | .RS | |
146 | .TP | |
147 | .B add \fR[\fIarg\fR] | |
148 | The current directory or specified argument is added to the list of files to be | |
149 | extracted. If a directory is specified, then it and all its descendents are | |
150 | added to the extraction list (unless the | |
151 | .B \-h | |
152 | flag is specified on the command line). Files that are on the extraction list | |
153 | are prepended with a \*(lq*\*(rq when they are listed by | |
154 | .BR ls . | |
155 | .TP | |
156 | .BI cd " arg" | |
1227625a | 157 | Change the current working directory to the specified argument. |
153f9a83 SP |
158 | .TP |
159 | .B delete \fR[\fIarg\fR] | |
160 | The current directory or specified argument is deleted from the list of files | |
161 | to be extracted. If a directory is specified, then it and all its descendents | |
162 | are deleted from the extraction list (unless the | |
163 | .B \-h | |
164 | flag is specified on the command line). The most expedient way to extract most | |
165 | of the files from a directory is to add the directory to the extraction list | |
166 | and then delete those files that are not needed. | |
167 | .TP | |
168 | .B extract | |
169 | All files on the extraction list are extracted from the dump. | |
170 | .B Restore | |
171 | will ask which volume the user wishes to mount. The fastest way to extract a f | |
172 | ew files is to start with the last volume and work towards the first volume. | |
173 | .TP | |
174 | .B help | |
1227625a | 175 | List a summary of the available commands. |
153f9a83 SP |
176 | .TP |
177 | .B ls \fR[\fIarg\fR] | |
178 | List the current or specified directory. Entries that are directories are | |
179 | appended with a \*(lq/\*(rq. Entries that have been marked for extraction are | |
180 | prepended with a \*(lq*\*(rq. If the verbose flag is set, the inode number of | |
181 | each entry is also listed. | |
182 | .TP | |
183 | .B pwd | |
1227625a | 184 | Print the full pathname of the current working directory. |
153f9a83 SP |
185 | .TP |
186 | .B quit | |
187 | .B Restore | |
188 | immediately exits, even if the extraction list is not empty. | |
189 | .TP | |
190 | .B setmodes | |
191 | All directories that have been added to the extraction list have their owner, | |
192 | modes, and times set; nothing is extracted from the dump. This is useful for | |
193 | cleaning up after a | |
194 | .B restore | |
195 | has been prematurely aborted. | |
196 | .TP | |
197 | .B verbose | |
1227625a | 198 | The sense of the |
153f9a83 SP |
199 | .B \-v |
200 | flag is toggled. When set, the verbose flag causes the | |
201 | .B ls | |
202 | command to list the inode numbers of all entries. It also causes | |
203 | .B restore | |
1227625a | 204 | to print out information about each file as it is extracted. |
153f9a83 SP |
205 | .RE |
206 | .TP | |
207 | .BI \-P " file" | |
208 | .B Restore | |
fe0e0285 | 209 | creates a new Quick File Access file |
153f9a83 | 210 | .I file |
fe0e0285 | 211 | from an existing dump file without restoring its contents. |
153f9a83 SP |
212 | .TP |
213 | .B \-R | |
214 | .B Restore | |
215 | requests a particular tape of a multi-volume set on which to restart a full | |
216 | restore (see the | |
217 | .B \-r | |
218 | flag below). This is useful if the restore has been interrupted. | |
219 | .TP | |
220 | .B \-r | |
221 | Restore (rebuild) a file system. The target file system should be made pristine | |
222 | with | |
223 | .BR mke2fs (8), | |
ddd2ef55 | 224 | mounted, and the user |
153f9a83 SP |
225 | .BR cd 'd |
226 | into the pristine file system before starting the restoration of the initial | |
227 | level 0 backup. If the level 0 restores successfully, the | |
228 | .B \-r | |
229 | flag may be used to restore any necessary incremental backups on top of the | |
230 | level 0. The | |
231 | .B \-r | |
232 | flag precludes an interactive file extraction and can be detrimental to one's | |
233 | health (not to mention the disk) if not used carefully. An example: | |
234 | .IP | |
235 | .RS 14 | |
236 | .B mke2fs /dev/sda1 | |
237 | .TP | |
238 | .B mount /dev/sda1 /mnt | |
239 | .TP | |
240 | .B cd /mnt | |
241 | .TP | |
242 | .B restore rf /dev/st0 | |
243 | .RE | |
244 | .IP | |
1227625a | 245 | Note that |
153f9a83 | 246 | .B restore |
1227625a | 247 | leaves a file |
153f9a83 SP |
248 | .I restoresymtable |
249 | in the root directory to pass information between incremental restore passes. | |
250 | This file should be removed when the last incremental has been restored. | |
251 | .IP | |
252 | .BR Restore , | |
1227625a | 253 | in conjunction with |
153f9a83 | 254 | .BR mke2fs (8) |
1227625a | 255 | and |
153f9a83 SP |
256 | .BR dump (8), |
257 | may be used to modify file system parameters such as size or block size. | |
258 | .TP | |
259 | .B \-t | |
260 | The names of the specified files are listed if they occur on the backup. If no | |
261 | file argument is given, the root directory is listed, which results in the | |
262 | entire content of the backup being listed, unless the | |
263 | .B \-h | |
264 | flag has been specified. Note that the | |
265 | .B \-t | |
1227625a | 266 | flag replaces the function of the old |
153f9a83 SP |
267 | .BR dumpdir (8) |
268 | program. See also the | |
269 | .B \-X | |
08db2b86 | 270 | option below. |
153f9a83 SP |
271 | .TP |
272 | .B \-x | |
273 | The named files are read from the given media. If a named file matches a | |
274 | directory whose contents are on the backup and the | |
275 | .B \-h | |
276 | flag is not specified, the directory is recursively extracted. The owner, | |
277 | modification time, and mode are restored (if possible). If no file argument is | |
278 | given, the root directory is extracted, which results in the entire content of | |
279 | the backup being extracted, unless the | |
280 | .B \-h | |
281 | flag has been specified. See also the | |
282 | .B \-X | |
08db2b86 | 283 | option below. |
153f9a83 | 284 | .SH OPTIONS |
1227625a | 285 | The following additional options may be specified: |
153f9a83 SP |
286 | .TP |
287 | .B \-a | |
40df6a0e | 288 | In |
153f9a83 | 289 | .B \-i |
40df6a0e | 290 | or |
153f9a83 | 291 | .B \-x |
40df6a0e | 292 | mode, |
153f9a83 SP |
293 | .B restore |
294 | does ask the user for the volume number on which the files to be extracted are | |
295 | supposed to be (in order to minimise the time by reading only the interesting | |
296 | volumes). The | |
297 | .B \-a | |
298 | option disables this behaviour and reads all the volumes starting with 1. This | |
299 | option is useful when the operator does not know on which volume the files to | |
300 | be extracted are and/or when he prefers the longer unattended mode rather than | |
301 | the shorter interactive mode. | |
302 | .TP | |
303 | .BI \-A " archive_file" | |
e51470bf | 304 | Read the table of contents from |
153f9a83 | 305 | .I archive_file |
e51470bf | 306 | instead of the media. This option can be used in combination with the |
153f9a83 SP |
307 | .BR \-t , |
308 | .BR \-i , | |
e51470bf | 309 | or |
153f9a83 SP |
310 | .B \-x |
311 | options, making it possible to check whether files are on the media without | |
312 | having to mount the media. | |
313 | .TP | |
314 | .BI \-b " blocksize" | |
315 | The number of kilobytes per dump record. If the | |
316 | .B \-b | |
1227625a | 317 | option is not specified, |
153f9a83 | 318 | .B restore |
b45f51d6 | 319 | tries to determine the media block size dynamically. |
153f9a83 SP |
320 | .TP |
321 | .B \-c | |
1227625a | 322 | Normally, |
153f9a83 SP |
323 | .B restore |
324 | will try to determine dynamically whether the dump was made from an old | |
325 | (pre-4.4) or new format file system. The | |
326 | .B \-c | |
327 | flag disables this check, and only allows reading a dump in the old format. | |
328 | .TP | |
329 | .B \-d | |
fceb4f25 | 330 | The |
153f9a83 SP |
331 | .B \-d |
332 | (debug) flag causes | |
333 | .B restore | |
fceb4f25 | 334 | to print debug information. |
153f9a83 SP |
335 | .TP |
336 | .BI \-D " filesystem" | |
1227625a | 337 | The |
153f9a83 | 338 | .B \-D |
1227625a | 339 | flag allows the user to specify the filesystem name when using |
153f9a83 | 340 | .B restore |
1227625a | 341 | with the |
153f9a83 | 342 | .B \-C |
1227625a | 343 | option to check the backup. |
153f9a83 SP |
344 | .TP |
345 | .BI \-f " file" | |
1227625a | 346 | Read the backup from |
153f9a83 SP |
347 | .IR file ; |
348 | .I file | |
349 | may be a special device file like | |
350 | .I /dev/st0 | |
1227625a | 351 | (a tape drive), |
153f9a83 SP |
352 | .I /dev/sda1 |
353 | (a disk drive), an ordinary file, or | |
354 | .I \- | |
355 | (the standard input). If the name of the file is of the form | |
356 | .I host:file | |
1227625a | 357 | or |
153f9a83 SP |
358 | .IR user@host:file , |
359 | .B restore | |
1227625a | 360 | reads from the named file on the remote host using |
153f9a83 SP |
361 | .BR rmt (8). |
362 | .TP | |
363 | .BI \-F " script" | |
364 | Run script at the beginning of each tape. The device name and the current | |
365 | volume number are passed on the command line. The script must return 0 if | |
366 | .B restore | |
c534413c | 367 | should continue without asking the user to change the tape, 1 if |
153f9a83 SP |
368 | .B restore |
369 | should continue but ask the user to change the tape. Any other exit code will | |
370 | cause | |
371 | .B restore | |
372 | to abort. For security reasons, | |
373 | .B restore | |
374 | reverts back to the real user ID and the real group ID before running the | |
375 | script. | |
376 | .TP | |
377 | .B \-h | |
378 | Extract the actual directory, rather than the files that it references. This | |
379 | prevents hierarchical restoration of complete subtrees from the dump. | |
380 | .TP | |
381 | .B \-k | |
382 | Use Kerberos authentication when contacting the remote tape server. (Only | |
383 | available if this options was enabled when | |
384 | .B restore | |
e51470bf | 385 | was compiled.) |
153f9a83 SP |
386 | .TP |
387 | .B \-l | |
388 | When doing remote restores, assume the remote file is a regular file (instead | |
389 | of a tape device). If you're restoring a remote compressed file, you will need | |
390 | to specify this option or | |
391 | .B restore | |
80dea635 | 392 | will fail to access it correctly. |
153f9a83 SP |
393 | .TP |
394 | .BI \-L " limit" | |
05f23c0c | 395 | The |
153f9a83 SP |
396 | .B \-L |
397 | flag allows the user to specify a maximal number of miscompares when using | |
398 | .B restore | |
05f23c0c | 399 | with the |
153f9a83 | 400 | .B \-C |
05f23c0c | 401 | option to check the backup. If this limit is reached, |
153f9a83 SP |
402 | .B restore |
403 | will abort with an error message. A value of 0 (the default value) disables | |
404 | the check. | |
405 | .TP | |
406 | .B \-m | |
407 | Extract by inode numbers rather than by file name. This is useful if only a few | |
408 | files are being extracted, and one wants to avoid regenerating the complete | |
409 | pathname to the file. | |
410 | .TP | |
411 | .B \-M | |
412 | Enables the multi-volume feature (for reading dumps made using the | |
413 | .B \-M | |
dc7cb1e2 | 414 | option of dump). The name specified with |
153f9a83 | 415 | .B \-f |
dc7cb1e2 | 416 | is treated as a prefix and |
153f9a83 SP |
417 | .B restore |
418 | tries to read in sequence from | |
419 | .I <prefix>001, <prefix>002 | |
420 | etc. | |
421 | .TP | |
422 | .B \-N | |
1227625a | 423 | The |
153f9a83 | 424 | .B \-N |
1227625a | 425 | flag causes |
153f9a83 | 426 | .B restore |
05f23c0c | 427 | to perform a full execution as requested by one of |
153f9a83 SP |
428 | .BR \-i , |
429 | .BR \-R , | |
430 | .BR \-r , | |
431 | .B t | |
05f23c0c | 432 | or |
153f9a83 | 433 | .B x |
05f23c0c | 434 | command without actually writing any file on disk. |
153f9a83 SP |
435 | .TP |
436 | .B \-o | |
80784c73 | 437 | The |
153f9a83 | 438 | .B \-o |
80784c73 | 439 | flag causes |
153f9a83 SP |
440 | .B restore |
441 | to automatically restore the current directory permissions without asking the | |
442 | operator whether to do so in one of | |
443 | .B \-i | |
80784c73 | 444 | or |
153f9a83 | 445 | .B \-x |
80784c73 | 446 | modes. |
153f9a83 SP |
447 | .TP |
448 | .BI \-Q " file" | |
35b24fb7 | 449 | Use the file |
153f9a83 SP |
450 | .I file |
451 | in order to read tape position as stored using the dump Quick File Access mode, | |
452 | in one of | |
453 | .BR \-i , | |
454 | .B \-x | |
e51470bf | 455 | or |
153f9a83 | 456 | .B \-t |
e51470bf | 457 | mode. |
153f9a83 SP |
458 | .IP |
459 | It is recommended to set up the st driver to return logical tape positions | |
460 | rather than physical before calling | |
461 | .B dump/restore | |
462 | with parameter | |
463 | .BR \-Q . | |
464 | Since not all tape devices support physical tape positions those tape devices | |
465 | return an error during | |
466 | .B dump/restore | |
467 | when the st driver is set to the default physical setting. Please see the | |
468 | .BR st (4) | |
469 | man page, option | |
470 | .B MTSETDRVBUFFER | |
471 | , or the | |
472 | .BR mt(1) | |
473 | man page, on how to set the driver to return logical tape positions. | |
474 | .IP | |
475 | Before calling | |
476 | .B restore | |
477 | with parameter | |
478 | .BR \-Q , | |
479 | always make sure the st driver is set to return the same type of tape position | |
480 | used during the call to | |
481 | .BR dump . | |
482 | Otherwise | |
483 | .B restore | |
484 | may be confused. | |
485 | .IP | |
486 | This option can be used when restoring from local or remote tapes (see above) | |
487 | or from local or remote files. | |
488 | .TP | |
489 | .BI \-s " fileno" | |
1227625a | 490 | Read from the specified |
153f9a83 SP |
491 | .I fileno |
492 | on a multi-file tape. File numbering starts at 1. | |
493 | .TP | |
494 | .BI \-T " directory" | |
1227625a | 495 | The |
153f9a83 SP |
496 | .B \-T |
497 | flag allows the user to specify a directory to use for the storage of temporary | |
498 | files. The default value is | |
499 | .IR /tmp . | |
500 | This flag is most useful when restoring files after having booted from a | |
501 | floppy. There might be little or no space on the floppy filesystem, but another | |
502 | source of space might exist. | |
503 | .TP | |
504 | .B \-u | |
505 | When creating certain types of files, | |
506 | .B restore | |
507 | may generate a warning diagnostic if they already exist in the target | |
508 | directory. To prevent this, the | |
509 | .B \-u | |
510 | (unlink) flag causes | |
511 | .B restore | |
512 | to remove old entries before attempting to create new ones. | |
513 | .TP | |
514 | .B \-v | |
1227625a | 515 | Normally |
153f9a83 SP |
516 | .B restore |
517 | does its work silently. The | |
518 | .B \-v | |
519 | (verbose) flag causes it to type the name of each file it treats preceded by | |
520 | its file type. | |
521 | .TP | |
522 | .B \-V | |
8b7882a8 | 523 | Enables reading multi-volume non-tape mediums like CDROMs. |
153f9a83 SP |
524 | .TP |
525 | .BI \-X " filelist" | |
1a05d45d | 526 | Read list of files to be listed or extracted from the text file |
153f9a83 | 527 | .I filelist |
1a05d45d | 528 | in addition to those specified on the command line. This can be used in |
08db2b86 | 529 | conjunction with the |
153f9a83 | 530 | .B \-t |
08db2b86 | 531 | or |
153f9a83 | 532 | .B \-x |
08db2b86 | 533 | commands. The file |
153f9a83 | 534 | .I filelist |
08db2b86 | 535 | should contain file names separated by newlines. |
153f9a83 | 536 | .I filelist |
1a05d45d | 537 | may be an ordinary file or |
153f9a83 | 538 | .I - |
1a05d45d | 539 | (the standard input). |
153f9a83 SP |
540 | .TP |
541 | .B \-y | |
1227625a SP |
542 | Do not ask the user whether to abort the restore in the event of an error. |
543 | Always try to skip over the bad block(s) and continue. | |
153f9a83 SP |
544 | .SH DIAGNOSTICS |
545 | Complains if it gets a read error. If | |
546 | .B y | |
1227625a | 547 | has been specified, or the user responds |
153f9a83 SP |
548 | .BR y , |
549 | .B restore | |
1227625a | 550 | will attempt to continue the restore. |
153f9a83 | 551 | .PP |
1227625a | 552 | If a backup was made using more than one tape volume, |
153f9a83 SP |
553 | .B restore |
554 | will notify the user when it is time to mount the next volume. If the | |
555 | .B \-x | |
1227625a | 556 | or |
153f9a83 | 557 | .B \-i |
1227625a | 558 | flag has been specified, |
153f9a83 SP |
559 | .B restore |
560 | will also ask which volume the user wishes to mount. The fastest way to extract | |
561 | a few files is to start with the last volume, and work towards the first volume. | |
562 | .PP | |
1227625a | 563 | There are numerous consistency checks that can be listed by |
153f9a83 SP |
564 | .BR restore . |
565 | Most checks are self-explanatory or can \*(lqnever happen\*(rq. Common errors | |
566 | are given below: | |
567 | .TP | |
568 | .I Converting to new file system format | |
569 | A dump tape created from the old file system has been loaded. It is | |
570 | automatically converted to the new file system format. | |
571 | .TP | |
572 | .I <filename>: not found on tape | |
573 | The specified file name was listed in the tape directory, but was not found on | |
574 | the tape. This is caused by tape read errors while looking for the file, and | |
575 | from using a dump tape created on an active file system. | |
576 | .TP | |
577 | .I expected next file <inumber>, got <inumber> | |
578 | A file that was not listed in the directory showed up. This can occur when | |
579 | using a dump created on an active file system. | |
580 | .TP | |
581 | .I Incremental dump too low | |
582 | When doing an incremental restore, a dump that was written before the previous | |
583 | incremental dump, or that has too low an incremental level has been loaded. | |
584 | .TP | |
585 | .I Incremental dump too high | |
586 | When doing an incremental restore, a dump that does not begin its coverage | |
587 | where the previous incremental dump left off, or that has too high an | |
588 | incremental level has been loaded. | |
589 | .TP | |
590 | .I Tape read error while restoring <filename> | |
591 | .TP | |
592 | .I Tape read error while skipping over inode <inumber> | |
593 | .TP | |
594 | .I Tape read error while trying to resynchronize | |
595 | A tape (or other media) read error has occurred. If a file name is specified, | |
596 | its contents are probably partially wrong. If an inode is being skipped or the | |
597 | tape is trying to resynchronize, no extracted files have been corrupted, though | |
598 | files may not be found on the tape. | |
599 | .TP | |
600 | .I resync restore, skipped <num> blocks | |
1227625a | 601 | After a dump read error, |
153f9a83 SP |
602 | .B restore |
603 | may have to resynchronize itself. This message lists the number of blocks that | |
604 | were skipped over. | |
605 | .SH EXIT STATUS | |
606 | .B Restore | |
607 | exits with zero status on success. Tape errors are indicated with an exit code | |
608 | of 1. | |
609 | .PP | |
610 | When doing a comparison of files from a dump, an exit code of 2 indicates that | |
611 | some files were modified or deleted since the dump was made. | |
612 | .SH ENVIRONMENT | |
ddd2ef55 | 613 | If the following environment variable exists it will be utilized by |
153f9a83 SP |
614 | .BR restore : |
615 | .TP | |
616 | .B TAPE | |
617 | If no | |
618 | .B \-f | |
619 | option was specified, | |
620 | .B restore | |
b45f51d6 | 621 | will use the device specified via |
153f9a83 | 622 | .B TAPE |
b45f51d6 | 623 | as the dump device. |
153f9a83 | 624 | .B TAPE |
b45f51d6 | 625 | may be of the form |
153f9a83 SP |
626 | .IR tapename , |
627 | .I host:tapename | |
b45f51d6 | 628 | or |
153f9a83 SP |
629 | .IR user@host:tapename . |
630 | .TP | |
631 | .B TMPDIR | |
ddd2ef55 | 632 | The directory given in |
153f9a83 SP |
633 | .B TMPDIR |
634 | will be used instead of | |
635 | .I /tmp | |
ddd2ef55 | 636 | to store temporary files. |
153f9a83 SP |
637 | .TP |
638 | .B RMT | |
b45f51d6 | 639 | The environment variable |
153f9a83 | 640 | .B RMT |
b45f51d6 | 641 | will be used to determine the pathname of the remote |
153f9a83 | 642 | .BR rmt (8) |
b45f51d6 | 643 | program. |
153f9a83 SP |
644 | .TP |
645 | .B RSH | |
646 | .B Restore | |
647 | uses the contents of this variable to determine the name of the remote shell | |
648 | command to use when doing a network restore (rsh, ssh etc.). If this variable | |
649 | is not set, | |
650 | .BR rcmd (3) | |
0c62667d | 651 | will be used, but only root will be able to do a network restore. |
153f9a83 SP |
652 | .SH FILES |
653 | .TP | |
654 | .I /dev/st0 | |
1227625a | 655 | the default tape drive |
153f9a83 SP |
656 | .TP |
657 | .I /tmp/rstdir* | |
ddd2ef55 | 658 | file containing directories on the tape |
153f9a83 SP |
659 | .TP |
660 | .I /tmp/rstmode* | |
ddd2ef55 | 661 | owner, mode, and time stamps for directories |
153f9a83 SP |
662 | .TP |
663 | .I ./restoresymtable | |
ddd2ef55 | 664 | information passed between incremental restores |
153f9a83 SP |
665 | .SH SEE ALSO |
666 | .BR dump (8), | |
667 | .BR mount (8), | |
668 | .BR mke2fs (8), | |
669 | .BR rmt (8) | |
670 | .SH BUGS | |
671 | .B Restore | |
672 | can get confused when doing incremental restores from dumps that were made on | |
673 | active file systems. | |
674 | .PP | |
675 | A level 0 dump must be done after a full restore. Because | |
676 | .B restore | |
677 | runs in user code, it has no control over inode allocation; thus a full dump | |
678 | must be done to get a new set of directories reflecting the new inode | |
679 | numbering, even though the content of the files is unchanged. | |
680 | .PP | |
ddd2ef55 | 681 | The temporary files |
153f9a83 | 682 | .I /tmp/rstdir* |
ddd2ef55 | 683 | and |
153f9a83 SP |
684 | .I /tmp/rstmode* |
685 | are generated with a unique name based on the date of the dump and the process | |
686 | ID (see | |
687 | .BR mktemp (3) ), | |
ddd2ef55 | 688 | except when |
153f9a83 | 689 | .B \-r |
ddd2ef55 | 690 | or |
153f9a83 SP |
691 | .B \-R |
692 | is used. Because | |
693 | .B \-R | |
ddd2ef55 | 694 | allows you to restart a |
153f9a83 SP |
695 | .B \-r |
696 | operation that may have been interrupted, the temporary files should be the | |
697 | same across different processes. In all other cases, the files are unique | |
698 | because it is possible to have two different dumps started at the same time, | |
699 | and separate operations shouldn't conflict with each other. | |
700 | .PP | |
701 | To do a network restore, you have to run | |
702 | .B restore | |
703 | as root or use a remote shell replacement (see | |
704 | .B RSH | |
705 | variable). This is due to the previous security history of | |
706 | .B dump | |
707 | and | |
708 | .BR restore . | |
709 | ( | |
710 | .B restore | |
711 | is written to be setuid root, but we are not certain all bugs are gone from the | |
712 | code - run setuid at your own risk.) | |
4bb009da SP |
713 | .PP |
714 | At the end of restores in | |
715 | .B \-i | |
716 | or | |
717 | .B \-x | |
718 | modes (unless | |
719 | .B \-o | |
720 | option is in use), | |
721 | .B restore | |
722 | will ask the operator whether to set the permissions on the current | |
723 | directory. If the operator confirms this action, the permissions | |
724 | on the directory from where | |
725 | .B restore | |
726 | was launched will be replaced by the permissions on the dumped root | |
727 | inode. Although this behaviour is not really a bug, it has proven itself | |
728 | to be confusing for many users, so it is recommended to answer 'no', | |
729 | unless you're performing a full restore and you do want to restore the | |
730 | permissions on '/'. | |
153f9a83 | 731 | .SH AUTHOR |
8d4197bb | 732 | The |
153f9a83 SP |
733 | .B dump/restore |
734 | backup suite was ported to Linux's Second Extended File System by Remy Card | |
735 | <card@Linux.EU.Org>. He maintained the initial versions of | |
736 | .B dump | |
737 | (up and including 0.4b4, released in january 1997). | |
738 | .PP | |
739 | Starting with 0.4b5, the new maintainer is Stelian Pop <stelian@popies.net>. | |
740 | .SH AVAILABILITY | |
8d4197bb | 741 | The |
153f9a83 SP |
742 | .B dump/restore |
743 | backup suite is available from <http://dump.sourceforge.net> | |
744 | .SH HISTORY | |
1227625a | 745 | The |
153f9a83 SP |
746 | .B restore |
747 | command appeared in 4.2BSD. |