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