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