]> git.wh0rd.org - dump.git/blame - dump/dump.8.in
Configure magic for testing ext2_ino_t and s_journal_inum
[dump.git] / dump / dump.8.in
CommitLineData
1227625a
SP
1.\" Copyright (c) 1980, 1991, 1993
2.\" Regents of the University of California.
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
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. All advertising materials mentioning features or use of this software
ddd2ef55 14.\" must display the following acknowledgement:
1227625a
SP
15.\" This product includes software developed by the University of
16.\" California, Berkeley and its contributors.
17.\" 4. Neither the name of the University nor the names of its contributors
18.\" may be used to endorse or promote products derived from this software
19.\" without specific prior written permission.
20.\"
21.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31.\" SUCH DAMAGE.
32.\"
ce7243e0 33.\" $Id: dump.8.in,v 1.22 2001/03/20 20:15:43 stelian Exp $
1227625a 34.\"
8d4197bb 35.Dd __DATE__
1227625a 36.Dt DUMP 8
df9ae507 37.Os "dump __VERSION__"
1227625a
SP
38.Sh NAME
39.Nm dump
ddd2ef55 40.Nd ext2 filesystem backup
1227625a
SP
41.Sh SYNOPSIS
42.Nm dump
ce7243e0 43.Op Fl 0123456789ackMnSu
1227625a
SP
44.Op Fl B Ar records
45.Op Fl b Ar blocksize
46.Op Fl d Ar density
0d7af9c5 47.Op Fl e Ar inode number
1227625a 48.Op Fl f Ar file
0d7af9c5 49.Op Fl F Ar script
1227625a 50.Op Fl h Ar level
b45f51d6 51.Op Fl L Ar label
1227625a
SP
52.Op Fl s Ar feet
53.Op Fl T Ar date
ce7243e0 54.Op Fl z Ar compression level
79e31865 55.Ar file-to-dump
1227625a
SP
56.Nm dump
57.Op Fl W Li \&| Fl w
58.Pp
8d4197bb 59.in
1227625a
SP
60(The
61.Bx 4.3
ddd2ef55 62option syntax is implemented for backward compatibility but
1227625a
SP
63is not documented here.)
64.Sh DESCRIPTION
65.Nm Dump
66examines files
ddd2ef55 67on an ext2 filesystem
1227625a
SP
68and determines which files
69need to be backed up. These files
70are copied to the given disk, tape or other
71storage medium for safe keeping (see the
72.Fl f
73option below for doing remote backups).
74A dump that is larger than the output medium is broken into
75multiple volumes.
76On most media the size is determined by writing until an
4f4eee3d 77end-of-media indication is returned.
b45f51d6 78.Pp
1227625a 79On media that cannot reliably return an end-of-media indication
4f4eee3d
SP
80(such as some cartridge tape drives), each volume is of a fixed size;
81the actual size is determined by specifying cartridge media, or via the
82tape size, density and/or block count options below.
1227625a
SP
83By default, the same output file name is used for each volume
84after prompting the operator to change media.
85.Pp
79e31865
SP
86.Ar file-to-dump
87is either a mountpoint of a filesystem
88or a directory to be backed up as a subset of a filesystem.
89In the former case, either the path to a mounted filesystem
90or the device of an unmounted filesystem can be used.
91In the latter case, certain restrictions are placed on the backup:
92.Fl u
93is not allowed and the only dump level that is supported is
94.Fl 0 .
95.Pp
1227625a 96The following options are supported by
b45f51d6 97.Nm Ns :
1227625a
SP
98.Bl -tag -width Ds
99.It Fl 0\-9
100Dump levels.
101A level 0, full backup,
102guarantees the entire file system is copied
103(but see also the
104.Fl h
105option below).
106A level number above 0,
107incremental backup,
ddd2ef55
SP
108tells
109.Nm dump
110to
1227625a 111copy all files new or modified since the
ae58c8da 112last dump of a lower level.
ddd2ef55 113The default level is 9.
1227625a 114.It Fl B Ar records
b45f51d6 115The number of 1 KB blocks per volume.
4f4eee3d
SP
116This option overrides the end-of-media detection, and calculation
117of tape size based on length and density.
b45f51d6
SP
118.It Fl a
119.Dq auto-size .
4f4eee3d
SP
120Bypass all tape length calculations, and write
121until an end-of-media indication is returned. This works best
122for most modern tape drives, and is the default.
123Use of this option is particularly recommended when appending to an
124existing tape, or using a tape drive with hardware compression
125(where you can never be sure about the compression ratio).
1227625a
SP
126.It Fl b Ar blocksize
127The number of kilobytes per dump record.
ddd2ef55
SP
128Since the IO system slices all requests into chunks of MAXBSIZE
129(typically 64KB), it is not possible to use a larger blocksize
130without having problems later with
131.Xr restore 8 .
132Therefore
133.Nm dump
134will constrain writes to MAXBSIZE.
65bceb9b 135The default blocksize is 10.
1227625a 136.It Fl c
b45f51d6 137Change the defaults for use with a cartridge tape drive, with a density
4f4eee3d
SP
138of 8000 bpi, and a length of 1700 feet. Specifying a cartridge drive
139overrides the end-of-media detection.
20c345aa
SP
140.It Fl e Ar inode
141Exclude
142.Ar inode
143from the dump (you can use
144.Ar stat
145to find the inode number for a file or directory).
b45f51d6
SP
146.It Fl h Ar level
147Honor the user
148.Dq nodump
149flag
150.Dp Dv UF_NODUMP
151only for dumps at or above the given
152.Ar level .
153The default honor level is 1,
154so that incremental backups omit such files
155but full backups retain them.
1227625a
SP
156.It Fl d Ar density
157Set tape density to
158.Ar density .
4f4eee3d
SP
159The default is 1600BPI. Specifying a tape density overrides the
160end-of-media detection.
1227625a
SP
161.It Fl f Ar file
162Write the backup to
163.Ar file ;
164.Ar file
165may be a special device file
166like
ddd2ef55 167.Pa /dev/st0
1227625a
SP
168(a tape drive),
169.Pa /dev/rsd1c
b45f51d6 170(a floppy disk drive),
1227625a
SP
171an ordinary file,
172or
173.Ql Fl
174(the standard output).
175Multiple file names may be given as a single argument separated by commas.
176Each file will be used for one dump volume in the order listed;
177if the dump requires more volumes than the number of names given,
178the last file name will used for all remaining volumes after prompting
179for media changes.
180If the name of the file is of the form
ddd2ef55 181.Dq host:file
1227625a 182or
ddd2ef55 183.Dq user@host:file
b45f51d6 184.Nm
1227625a
SP
185writes to the named file on the remote host using
186.Xr rmt 8 .
b45f51d6
SP
187The default path name of the remote
188.Xr rmt 8
189program is
190.\" rmt path, is the path on the remote host
191.Pa /etc/rmt ;
192this can be overridden by the environment variable
193.Ev RMT .
0d7af9c5 194.It Fl F Ar script
365a7c7c
SP
195Run script at the end of each tape. The device name and the
196current volume number are passed on the command line.
197The script must return 0 if
ae81b200
SP
198.Nm
199should continue without asking the user to change the tape, 1 if
200.Nm
201dump should continue but ask the user to change the tape.
202Any other exit code will cause
203.Nm
204to abort.
205For security reasons,
206.Nm
207reverts back to the real user ID and the real group ID before
208running the script.
b45f51d6
SP
209.It Fl k
210Use Kerberos authentication to talk to remote tape servers. (Only
211available if this option was enabled when
212.Nm
213was compiled.)
214.It Fl L Ar label
215The user-supplied text string
216.Ar label
217is placed into the dump header, where tools like
218.Xr restore 8
219and
220.Xr file 1
221can access it.
222Note that this label is limited
223to be at most LBLSIZE (currently 16) characters, which must include
224the terminating
225.Ql \e0 .
dc7cb1e2
SP
226.It Fl M
227Enable the multi-volume feature. The name specified with
228.Fl f
229is treated as a prefix and
230.Nm
231writes in sequence to <prefix>001, <prefix>002 etc. This can be
232useful when dumping to files on an ext2 partition, in order to bypass
233the 2GB file size limitation.
1227625a
SP
234.It Fl n
235Whenever
b45f51d6 236.Nm
1227625a
SP
237requires operator attention,
238notify all operators in the group
239.Dq operator
240by means similar to a
241.Xr wall 1 .
242.It Fl s Ar feet
4f4eee3d 243Attempt to calculate the amount of tape needed at a particular density.
1227625a 244If this amount is exceeded,
b45f51d6 245.Nm
1227625a
SP
246prompts for a new tape.
247It is recommended to be a bit conservative on this option.
4f4eee3d
SP
248The default tape length is 2300 feet. Specifying the tape size
249overrides end-of-media detection.
1227625a 250.ne 1i
144a6db1
SP
251.It Fl S
252Size estimate. Determine the amount of space
253that is needed to perform the dump without
254actually doing it, and display the estimated
2e682895 255number of bytes it will take. This is useful
144a6db1
SP
256with incremental dumps to determine how many
257volumes of media will be needed.
1227625a
SP
258.It Fl T Ar date
259Use the specified date as the starting time for the dump
260instead of the time determined from looking in
8d4197bb 261.Pa __DUMPDATES__ .
ddd2ef55
SP
262The format of
263.Ar date
264is the same as that of
1227625a
SP
265.Xr ctime 3 .
266This option is useful for automated dump scripts that wish to
267dump over a specific period of time.
268The
269.Fl T
270option is mutually exclusive from the
271.Fl u
272option.
273.It Fl u
274Update the file
8d4197bb 275.Pa __DUMPDATES__
1227625a
SP
276after a successful dump.
277The format of
8d4197bb 278.Pa __DUMPDATES__
1227625a
SP
279is readable by people, consisting of one
280free format record per line:
281filesystem name,
282increment level
283and
284.Xr ctime 3
285format dump date.
286There may be only one entry per filesystem at each level.
287The file
8d4197bb 288.Pa __DUMPDATES__
1227625a
SP
289may be edited to change any of the fields,
290if necessary.
291.It Fl W
292.Nm Dump
293tells the operator what file systems need to be dumped.
294This information is gleaned from the files
8d4197bb 295.Pa __DUMPDATES__
1227625a
SP
296and
297.Pa /etc/fstab .
298The
299.Fl W
300option causes
b45f51d6 301.Nm
51b01afe 302to print out, for all file systems in
8d4197bb 303.Pa __DUMPDATES__ ,
51b01afe
SP
304and regognized file systems in
305.Pa /etc/fstab .
1227625a 306the most recent dump date and level,
51b01afe 307and highlights those that should be dumped.
1227625a
SP
308If the
309.Fl W
310option is set, all other options are ignored, and
b45f51d6 311.Nm
1227625a
SP
312exits immediately.
313.It Fl w
ddd2ef55
SP
314Is like
315.Fl W ,
51b01afe
SP
316but prints only recognized filesystems in
317.Pa /etc/fstab
318which need to be dumped.
ce7243e0 319.It Fl z Ar compression level
52ed7d6e 320Compress every block to be written on the tape using zlib library. This
2b747532
SP
321option will work only when dumping to a file or pipe or, when dumping
322to a tape drive, if the tape drive is capable of writing variable
52ed7d6e
SP
323length blocks. You will need at least the 0.4b22 version of restore in
324order to extract compressed tapes. Tapes written using compression will
ce7243e0
SP
325not be compatible with the BSD tape format. The (optional) parameter
326specifies the compression level zlib will use. The default compression
327level is 2.
1227625a
SP
328.El
329.Pp
330.Nm Dump
331requires operator intervention on these conditions:
332end of tape,
333end of dump,
334tape write error,
335tape open error or
ddd2ef55 336disk read error (if there is more than a threshold of 32).
1227625a
SP
337In addition to alerting all operators implied by the
338.Fl n
339key,
b45f51d6 340.Nm
1227625a
SP
341interacts with the operator on
342.Em dump's
343control terminal at times when
b45f51d6 344.Nm
1227625a
SP
345can no longer proceed,
346or if something is grossly wrong.
347All questions
b45f51d6 348.Nm
1227625a
SP
349poses
350.Em must
351be answered by typing
352.Dq yes
353or
354.Dq no ,
355appropriately.
356.Pp
357Since making a dump involves a lot of time and effort for full dumps,
b45f51d6 358.Nm
1227625a
SP
359checkpoints itself at the start of each tape volume.
360If writing that volume fails for some reason,
b45f51d6 361.Nm
1227625a
SP
362will,
363with operator permission,
364restart itself from the checkpoint
365after the old tape has been rewound and removed,
366and a new tape has been mounted.
367.Pp
368.Nm Dump
369tells the operator what is going on at periodic intervals,
370including usually low estimates of the number of blocks to write,
371the number of tapes it will take, the time to completion, and
372the time to the tape change.
373The output is verbose,
374so that others know that the terminal
375controlling
b45f51d6 376.Nm
1227625a
SP
377is busy,
378and will be for some time.
379.Pp
380In the event of a catastrophic disk event, the time required
381to restore all the necessary backup tapes or files to disk
382can be kept to a minimum by staggering the incremental dumps.
383An efficient method of staggering incremental dumps
384to minimize the number of tapes follows:
385.Bl -bullet -offset indent
386.It
387Always start with a level 0 backup, for example:
388.Bd -literal -offset indent
8d4197bb 389/sbin/dump -0u -f /dev/st0 /usr/src
1227625a
SP
390.Ed
391.Pp
392This should be done at set intervals, say once a month or once every two months,
393and on a set of fresh tapes that is saved forever.
394.It
395After a level 0, dumps of active file
396systems are taken on a daily basis,
397using a modified Tower of Hanoi algorithm,
398with this sequence of dump levels:
399.Bd -literal -offset indent
4003 2 5 4 7 6 9 8 9 9 ...
401.Ed
402.Pp
403For the daily dumps, it should be possible to use a fixed number of tapes
404for each day, used on a weekly basis.
405Each week, a level 1 dump is taken, and
406the daily Hanoi sequence repeats beginning with 3.
407For weekly dumps, another fixed set of tapes per dumped file system is
408used, also on a cyclical basis.
409.El
410.Pp
411After several months or so, the daily and weekly tapes should get
412rotated out of the dump cycle and fresh tapes brought in.
b45f51d6
SP
413.Sh ENVIRONMENT
414.Bl -tag -width Fl
415.It Ev TAPE
416If no -f option was specified,
417.Nm
418will use the device specified via
419.Ev TAPE
420as the dump device.
421.Ev TAPE
422may be of the form
423.Qq tapename ,
424.Qq host:tapename ,
425or
426.Qq user@host:tapename .
427.It Ev RMT
428The environment variable
429.Ev RMT
430will be used to determine the pathname of the remote
431.Xr rmt 8
432program.
0c62667d
SP
433.It Ev RSH
434.Nm Dump
435uses the contents of this variable to determine the name of the
436remote shell command to use when doing remote backups (rsh, ssh etc.).
437If this variable is not set,
438.Xr rcmd 3
439will be used, but only root will be able to do remote backups.
1227625a 440.Sh FILES
8d4197bb 441.Bl -tag -width __DUMPDATES__ -compact
ddd2ef55 442.It Pa /dev/st0
1227625a 443default tape unit to dump to
8d4197bb 444.It Pa __DUMPDATES__
1227625a
SP
445dump date records
446.It Pa /etc/fstab
447dump table: file systems and frequency
448.It Pa /etc/group
449to find group
450.Em operator
451.El
452.Sh SEE ALSO
b45f51d6 453.Xr fstab 5 ,
1227625a 454.Xr restore 8 ,
b45f51d6 455.Xr rmt 8
1227625a
SP
456.Sh DIAGNOSTICS
457Many, and verbose.
458.Pp
ddd2ef55
SP
459.Nm Dump
460exits with zero status on success.
1227625a
SP
461Startup errors are indicated with an exit code of 1;
462abnormal termination is indicated with an exit code of 3.
463.Sh BUGS
ddd2ef55
SP
464It might be considered a bug that this version of dump can only handle ext2
465filesystems. Specifically, it does not work with FAT filesystems.
466.Pp
467Fewer than 32 read errors on the filesystem are ignored. If noticing
468read errors is important, the output from dump can be parsed to look for lines
469that contain the text 'read error'.
1227625a
SP
470.Pp
471Each reel requires a new process, so parent processes for
472reels already written just hang around until the entire tape
473is written.
474.Pp
1227625a 475It would be nice if
b45f51d6 476.Nm
1227625a
SP
477knew about the dump sequence,
478kept track of the tapes scribbled on,
479told the operator which tape to mount when,
480and provided more assistance
481for the operator running
482.Xr restore .
b45f51d6
SP
483.Pp
484.Nm Dump
485cannot do remote backups without being run as root, due to its
0c62667d 486security history.
b45f51d6 487Presently, it works if you set it setuid (like it used to be), but this
0c62667d
SP
488might constitute a security risk. Note that you can set RSH to use
489a remote shell program instead.
8d4197bb
SP
490.Sh AUTHOR
491The
492.Nm dump/restore
493backup suit was ported to Linux's Second Extended File System
494by Remy Card <card@Linux.EU.Org>. He maintained the initial versions
495of dump (up and including 0.4b4, released in january 1997).
496.Pp
497Starting with 0.4b5, the new maintainer is Stelian Pop
498.br
109e9e1d 499<pop@noos.fr>.
8d4197bb
SP
500.Sh AVAILABILITY
501The
502.Nm dump/restore
01fb6bd5
SP
503backup suit is available from
504.br
505http://dump.sourceforge.net
1227625a
SP
506.Sh HISTORY
507A
b45f51d6
SP
508.Nm
509command appeared in
510.At v6 .