1 .\" $NetBSD: restore.8,v 1.51 2007/04/30 12:33:13 tron Exp $
3 .\" Copyright (c) 1985, 1991, 1993
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" @(#)restore.8 8.4 (Berkeley) 5/1/95
38 .Nd "restore files or file systems from backups made with dump"
81 .in -\n[indent-synopsis]u
84 option syntax is implemented for backward compatibility, but
85 is not documented here.)
89 command performs the inverse function of
91 A full backup of a file system may be restored and
92 subsequent incremental backups layered on top of it.
94 directory subtrees may be restored from full or partial
97 works across a network;
100 flag described below.
101 Other arguments to the command are file or directory
102 names specifying the files that are to be restored.
105 flag is specified (see below),
106 the appearance of a directory name refers to
107 the files and (recursively) subdirectories of that directory.
109 If any file arguments are given with the
112 or specified in the command shell with the
115 the permissions of the root directory
117 be applied to the current directory,
118 unless one of those file arguments explicitly represents the root inode
123 This is a change from the traditional behaviour,
124 which used to be to always prompt the user.
126 Exactly one of the following flags is required:
129 This mode allows interactive restoration of files from a dump.
130 After reading in the directory information from the dump,
132 provides a shell like interface that allows the user to move
133 around the directory tree selecting files to be extracted.
134 The available commands are given below;
135 for those commands that require an argument,
136 the default is the current directory.
139 The current directory or specified argument is added to the list of
140 files to be extracted.
141 If a directory is specified, then it and all its descendants are
142 added to the extraction list
145 flag is specified on the command line).
146 Files that are on the extraction list are prepended with a
148 when they are listed by
151 Change the current working directory to the specified argument.
152 .It Ic delete Op Ar arg
153 The current directory or specified argument is deleted from the list of
154 files to be extracted.
155 If a directory is specified, then it and all its descendants are
156 deleted from the extraction list
159 flag is specified on the command line).
160 The most expedient way to extract most of the files from a directory
161 is to add the directory to the extraction list and then delete
162 those files that are not needed.
164 All the files that are on the extraction list are extracted
167 will ask which volume the user wishes to mount.
168 The fastest way to extract a few files is to
169 start with the last volume, and work towards the first volume.
171 List a summary of the available commands.
172 .It Ic \&ls Op Ar arg
173 List the current or specified directory.
174 Entries that are directories are appended with a
176 Entries that have been marked for extraction are prepended with a
179 flag is set the inode number of each entry is also listed.
181 Print the full pathname of the current working directory.
183 Restore immediately exits,
184 even if the extraction list is not empty.
186 All the directories that have been added to the extraction list
187 have their owner, modes, and times set;
188 nothing is extracted from the dump.
189 This is useful for cleaning up after a restore has been prematurely aborted.
194 When set, the verbose flag causes the
196 command to list the inode numbers of all entries.
199 to print out information about each file as it is extracted.
201 List dump header information.
207 requests a particular tape of a multi volume set on which to restart
212 This is useful if the restore has been interrupted.
214 Restore (rebuild a file system).
215 The target file system should be made pristine with
219 into the pristine file system
220 before starting the restoration of the initial level 0 backup.
221 If the level 0 restores successfully, the
223 flag may be used to restore
224 any necessary incremental backups on top of the level 0.
227 flag precludes an interactive file extraction and can be
228 detrimental to one's health if not used carefully (not to mention
231 .Bd -literal -offset indent
243 in the root directory to pass information between incremental
245 This file should be removed when the last incremental has been
253 may be used to modify file system parameters
254 such as size or block size.
256 The names of the specified files are listed if they occur
258 If no file argument is given,
259 then the root directory is listed,
260 which results in the entire content of the
264 flag has been specified.
267 flag replaces the function of the old
272 The named files are read from the given media.
273 If a named file matches a directory whose contents
277 flag is not specified,
278 the directory is recursively extracted.
279 The owner, modification time,
280 and mode are restored (if possible).
281 If no file argument is given,
282 then the root directory is extracted,
283 which results in the entire content of the
284 backup being extracted,
287 flag has been specified.
290 The following additional options may be specified:
293 The number of kilobytes per dump record.
296 option is not specified,
298 tries to determine the block size dynamically.
302 will try to determine dynamically whether the dump was made from an
303 old (pre-4.4) or new format file system.
306 flag disables this check, and only allows reading a dump in the old
308 .It Fl D Ar algorithm
309 Computes the digest of each regular files using the
311 and output to standard output.
319 This option doesn't imply
327 may be a special device file
336 (the standard input).
337 If the name of the file is of the form
342 reads from the named file on the remote host using
344 If the name of the file is
347 reads from standard input.
352 can be used in a pipeline to dump and restore a file system
354 .Bd -literal -offset indent
355 dump 0f - /usr | (cd /mnt; restore xf -)
359 Extract the actual directory,
360 rather than the files that it references.
361 This prevents hierarchical restoration of complete subtrees
364 Do not set the file flags on restore.
369 which can be used to restore file flags with a command such as
370 .Bd -literal -offset indent
371 sort mfile | mtree -e -i -u
374 Extract by inode numbers rather than by file name.
375 This is useful if only a few files are being extracted,
376 and one wants to avoid regenerating the complete pathname
379 Do not perform actual writing to disk.
381 Read from the specified
383 on a multi-file tape.
384 File numbering starts at 1.
389 flag removes files before extracting them.
390 This is useful when an executable file is in use.
399 does its work silently.
403 flag causes it to type the name of each file it treats
404 preceded by its file type.
406 Do not ask the user whether to abort the restore in the event of an error.
407 Always try to skip over the bad block(s) and continue.
410 If the following environment variable exists it will be used by
412 .Bl -tag -width "TMPDIR" -compact
414 The directory given in TMPDIR will be used
417 to store temporary files.
420 for more information.
423 .Bl -tag -width "./restoresymtable" -compact
425 default tape unit to use.
429 .Pa /usr/include/paths.h .
431 raw SCSI tape interface
433 file containing directories on the tape.
435 owner, mode, and time stamps for directories.
436 .It Pa \&./restoresymtable
437 information passed between incremental restores.
440 Complains if it gets a read error.
443 has been specified, or the user responds
446 will attempt to continue the restore.
448 If a backup was made using more than one tape volume,
450 will notify the user when it is time to mount the next volume.
455 flag has been specified,
457 will also ask which volume the user wishes to mount.
458 The fastest way to extract a few files is to
459 start with the last volume, and work towards the first volume.
461 There are numerous consistency checks that can be listed by
463 Most checks are self-explanatory or can
465 Common errors are given below.
467 .Bl -tag -width Ds -compact
468 .It Converting to new file system format.
469 A dump tape created from the old file system has been loaded.
470 It is automatically converted to the new file system format.
472 .It \*[Lt]filename\*[Gt]: not found on tape
473 The specified file name was listed in the tape directory,
474 but was not found on the tape.
475 This is caused by tape read errors while looking for the file,
476 and from using a dump tape created on an active file system.
478 .It expected next file \*[Lt]inumber\*[Gt], got \*[Lt]inumber\*[Gt]
479 A file that was not listed in the directory showed up.
480 This can occur when using a dump created on an active file system.
482 .It Incremental dump too low
483 When doing incremental restore,
484 a dump that was written before the previous incremental dump,
485 or that has too low an incremental level has been loaded.
487 .It Incremental dump too high
488 When doing incremental restore,
489 a dump that does not begin its coverage where the previous incremental
491 or that has too high an incremental level has been loaded.
493 .It Tape read error while restoring \*[Lt]filename\*[Gt]
494 .It Tape read error while skipping over inode \*[Lt]inumber\*[Gt]
495 .It Tape read error while trying to resynchronize
496 A tape (or other media) read error has occurred.
497 If a file name is specified,
498 then its contents are probably partially wrong.
499 If an inode is being skipped or the tape is trying to resynchronize,
500 then no extracted files have been corrupted,
501 though files may not be found on the tape.
503 .It resync restore, skipped \*[Lt]num\*[Gt] blocks
504 After a dump read error,
506 may have to resynchronize itself.
507 This message lists the number of blocks that were skipped over.
524 can get confused when doing incremental restores from
525 dumps that were made on active file systems.
527 A level zero dump must be done after a full restore.
531 it has no control over inode allocation;
532 thus a full dump must be done to get a new set of directories
533 reflecting the new inode numbering,
534 even though the content of the files is unchanged.
540 are generated with a unique name based on the date of the dump
541 and the process ID (see
550 allows you to restart a
552 operation that may have been interrupted, the temporary files should
553 be the same across different processes.
554 In all other cases, the files are unique because it is possible to
555 have two different dumps started at the same time, and separate
556 operations shouldn't conflict with each other.