1 .\" Copyright (c) 1980, 1991, 1993
2 .\" Regents of the University of California.
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
13 .\" 3. Neither the name of the University nor the names of its contributors
14 .\" may be used to endorse or promote products derived from this software
15 .\" without specific prior written permission.
17 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 .\" @(#)dump.8 8.3 (Berkeley) 5/1/95
38 .Nd file system backup
41 .Op Fl 0123456789acLnrRSu
47 .Op Fl f Ar file | Fl P Ar pipecommand
57 utility examines files
59 and determines which files
62 are copied to the given disk, tape or other
63 storage medium for safe keeping (see the
65 option below for doing remote backups).
66 A dump that is larger than the output medium is broken into
68 On most media the size is determined by writing until an
69 end-of-media indication is returned.
75 On media that cannot reliably return an end-of-media indication
76 (such as some cartridge tape drives)
77 each volume is of a fixed size;
78 the actual size is determined by the tape size and density and/or
81 By default, the same output file name is used for each volume
82 after prompting the operator to change media.
84 The file system to be dumped is specified by the argument
86 as either its device-special file or its mount point
87 (if that is in a standard entry in
91 may also be invoked as
95 option syntax is implemented for backward compatibility, but
96 is not documented here.
98 The following options are supported by
103 A level 0, full backup,
104 guarantees the entire file system is copied
108 A level number above 0,
111 copy all files new or modified since the
112 last dump of any lower level.
113 The default level is 0.
116 Bypass all tape length considerations, and enforce writing
117 until an end-of-media indication is returned.
118 This fits best for most modern tape drives.
119 Use of this option is particularly
120 recommended when appending to an existing tape, or using a tape
121 drive with hardware compression (where you can never be sure about
122 the compression ratio).
124 The number of kilobytes per output volume, except that if it is
125 not an integer multiple of the output block size,
126 the command uses the next smaller such multiple.
127 This option overrides the calculation of tape size
128 based on length and density.
129 .It Fl b Ar blocksize
130 The number of kilobytes per output block.
131 The default block size is 10.
132 .It Fl C Ar cachesize
133 Specify the cache size in megabytes.
134 This will greatly improve performance
137 possibly not noticing changes in the file system between passes
138 unless a snapshot is being used.
139 The potential for performance improvement indicates that
140 use of this option together with snapshots is the recommended
144 forks, and the actual memory use may be larger than the specified cache
146 The recommended cache size is between 8 and 32 (megabytes).
148 Change the defaults for use with a cartridge tape drive, with a density
149 of 8000 bpi, and a length of 1700 feet.
150 .It Fl D Ar dumpdates
151 Specify an alternate path to the
159 The default is 1600BPI.
164 may be a special device file
169 (a floppy disk drive),
173 (the standard output).
174 Multiple file names may be given as a single argument separated by commas.
175 Each file will be used for one dump volume in the order listed;
176 if the dump requires more volumes than the number of names given,
177 the last file name will used for all remaining volumes after prompting
179 If the name of the file is of the form
184 writes to the named file on the remote host using
186 The default path name of the remote
189 .\" rmt path, is the path on the remote host
191 this can be overridden by the environment variable
193 .It Fl P Ar pipecommand
198 script string defined by
200 for the output device of each volume.
201 This child pipeline's
204 is redirected from the
206 output stream, and the environment variable
208 is set to the current volume number being written.
209 After every volume, the writer side of the pipe is closed and
212 Subject to the media size specified by
214 each volume is written in this manner as if the output were a tape drive.
220 only for dumps at or above the given
222 The default honor level is 1,
223 so that incremental backups omit such files
224 but full backups retain them.
226 This option is to notify
228 that it is dumping a live file system.
229 To obtain a consistent dump image,
231 takes a snapshot of the file system in the
233 directory in the root of the file system being dumped and
234 then does a dump of the snapshot.
235 The snapshot is unlinked as soon as the dump starts, and
236 is thus removed when the dump is complete.
237 This option is ignored for unmounted or read-only file systems.
240 directory does not exist in the root of the file system being dumped,
241 a warning will be issued and the
243 will revert to the standard behavior.
244 This problem can be corrected by creating a
246 directory in the root of the file system to be dumped;
251 and its mode should be
256 requires operator attention,
257 notify all operators in the group
259 by means similar to a
263 Normally dump stores the date of the current
264 and prior dump in numerous places throughout the dump.
265 These scattered changes significantly slow down rsync or
266 another incremental file transfer program when they are
267 used to update a remote copy of a level 0 dump,
268 since the date changes for each dump.
269 This option sets both dates to the epoch, permitting
270 rsync to be much more efficient when transferring a dump file.
273 option can be used only to create level 0 dumps.
276 option cannot be used as the basis for a later incremental dump.
278 Be even more rsync-friendly.
279 This option disables the storage of the actual inode access time
280 (storing it instead as the inode's modified time).
281 This option permits rsync to be even more efficient
282 when transferring dumps generated from filesystems with numerous files
283 which are not changing other than their access times.
290 option can be used only to create level 0 dumps.
293 option cannot be used as the basis for a later incremental dump.
295 Display an estimate of the backup size and the number of
296 tapes required, and exit without actually performing the dump.
298 Attempt to calculate the amount of tape needed
299 at a particular density.
300 If this amount is exceeded,
302 prompts for a new tape.
303 It is recommended to be a bit conservative on this option.
304 The default tape length is 2300 feet.
306 Use the specified date as the starting time for the dump
307 instead of the time determined from looking in
311 The format of date is the same as that of
313 This option is useful for automated dump scripts that wish to
314 dump over a specific period of time.
317 option is mutually exclusive from the
324 after a successful dump.
329 is readable by people, consisting of one
330 free format record per line:
336 There may be only one entry per file system at each level.
340 may be edited to change any of the fields,
342 The default path for the
348 option may be used to change it.
350 Tell the operator what file systems need to be dumped.
351 This information is gleaned from the files
359 to print out, for each file system in
363 the most recent dump date and level,
364 and highlights those file systems that should be dumped.
367 option is set, all other options are ignored, and
373 but prints only those file systems which need to be dumped.
376 Directories and regular files which have their
380 set will be omitted along with everything under such directories,
387 utility requires operator intervention on these conditions:
392 disk read error (if there are more than a threshold of 32).
393 In addition to alerting all operators implied by the
397 interacts with the operator on
399 control terminal at times when
401 can no longer proceed,
402 or if something is grossly wrong.
407 be answered by typing
413 Since making a dump involves a lot of time and effort for full dumps,
415 checkpoints itself at the start of each tape volume.
416 If writing that volume fails for some reason,
419 with operator permission,
420 restart itself from the checkpoint
421 after the old tape has been rewound and removed,
422 and a new tape has been mounted.
426 utility tells the operator what is going on at periodic intervals
427 (every 5 minutes, or promptly after receiving
429 including usually low estimates of the number of blocks to write,
430 the number of tapes it will take, the time to completion, and
431 the time to the tape change.
432 The output is verbose,
433 so that others know that the terminal
437 and will be for some time.
439 In the event of a catastrophic disk event, the time required
440 to restore all the necessary backup tapes or files to disk
441 can be kept to a minimum by staggering the incremental dumps.
442 An efficient method of staggering incremental dumps
443 to minimize the number of tapes follows:
444 .Bl -bullet -offset indent
446 Always start with a level 0 backup, for example:
447 .Bd -literal -offset indent
448 /sbin/dump -0u -f /dev/nsa0 /usr/src
451 This should be done at set intervals, say once a month or once every two months,
452 and on a set of fresh tapes that is saved forever.
454 After a level 0, dumps of active file systems (file systems with files
455 that change, depending on your partition layout some file systems may
456 contain only data that does not change) are taken on a daily basis,
457 using a modified Tower of Hanoi algorithm,
458 with this sequence of dump levels:
459 .Bd -literal -offset indent
460 3 2 5 4 7 6 9 8 9 9 ...
463 For the daily dumps, it should be possible to use a fixed number of tapes
464 for each day, used on a weekly basis.
465 Each week, a level 1 dump is taken, and
466 the daily Hanoi sequence repeats beginning with 3.
467 For weekly dumps, another fixed set of tapes per dumped file system is
468 used, also on a cyclical basis.
471 After several months or so, the daily and weekly tapes should get
472 rotated out of the dump cycle and fresh tapes brought in.
474 .Bl -tag -width ".Ev TAPE"
478 or device to dump to if the
482 Pathname of the remote
486 Pathname of a remote shell program, if not
490 .Bl -tag -width /etc/dumpdates -compact
492 default tape unit to dump to
493 .It Pa /etc/dumpdates
495 (this can be changed;
500 dump table: file systems and frequency
506 Dump exits with zero status on success.
507 Startup errors are indicated with an exit code of 1;
508 abnormal termination is indicated with an exit code of 3.
512 file system to DVDs using
514 Uses a 16MB cache, creates a snapshot of the dump, and records the
518 /sbin/dump -0u -L -C16 -B4589840 -P 'growisofs -Z /dev/cd0=/dev/fd/0' /u
533 Fewer than 32 read errors on the file system are ignored, though all
534 errors will generate a warning message.
535 This is a bit of a compromise.
536 In practice, it is possible to generate read errors when doing dumps
537 on mounted partitions if the file system is being modified while the
540 Since dumps are often done in an unattended fashion using
542 jobs asking for Operator intervention would result in the
545 However, there is nothing wrong with a dump tape written when this sort
546 of read error occurs, and there is no reason to terminate the
549 Each reel requires a new process, so parent processes for
550 reels already written just hang around until the entire tape
559 options does not report file systems that have never been recorded
568 knew about the dump sequence,
569 kept track of the tapes scribbled on,
570 told the operator which tape to mount when,
571 and provided more assistance
572 for the operator running
577 utility cannot do remote backups without being run as root, due to its
579 This will be fixed in a later version of
581 Presently, it works if you set it setuid (like it used to be), but this
582 might constitute a security risk.