xref: /freebsd/sbin/dump/dump.8 (revision ce834215a70ff69e7e222827437116eee2f9ac6f)
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
14.\"    must display the following acknowledgement:
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.\"
33.\"     @(#)dump.8	8.3 (Berkeley) 5/1/95
34.\"	$Id: dump.8,v 1.14 1997/03/15 06:23:57 peter Exp $
35.\"
36.Dd May 1, 1995
37.Dt DUMP 8
38.Os BSD 4
39.Sh NAME
40.Nm dump
41.Nd filesystem backup
42.Sh SYNOPSIS
43.Nm dump
44.Op Fl 0123456789acknu
45.Op Fl B Ar records
46.Op Fl b Ar blocksize
47.Op Fl d Ar density
48.Op Fl f Ar file
49.Op Fl h Ar level
50.Op Fl s Ar feet
51.Op Fl T Ar date
52.Ar filesystem
53.Nm dump
54.Op Fl W Li \&| Fl w
55.Pp
56.in -\\n(iSu
57(The
58.Bx 4.3
59option syntax is implemented for backward compatibility, but
60is not documented here.)
61.Sh DESCRIPTION
62.Nm Dump
63examines files
64on a filesystem
65and determines which files
66need to be backed up. These files
67are copied to the given disk, tape or other
68storage medium for safe keeping (see the
69.Fl f
70option below for doing remote backups).
71A dump that is larger than the output medium is broken into
72multiple volumes.
73On most media the size is determined by writing until an
74end-of-media indication is returned.  This can be enforced
75by using the
76.Fl a
77option.
78.Pp
79On media that cannot reliably return an end-of-media indication
80(such as some cartridge tape drives)
81each volume is of a fixed size;
82the actual size is determined by the tape size and density and/or
83block count options below.
84By default, the same output file name is used for each volume
85after prompting the operator to change media.
86.Pp
87The following options are supported by
88.Nm dump :
89.Bl -tag -width Ds
90.It Fl 0\-9
91Dump levels.
92A level 0, full backup,
93guarantees the entire file system is copied
94(but see also the
95.Fl h
96option below).
97A level number above 0,
98incremental backup,
99tells dump to
100copy all files new or modified since the
101last dump of the same or lower level.
102The default level is 9.
103.It Fl B Ar records
104The number of dump records per volume.
105This option overrides the calculation of tape size
106based on length and density.
107.It Fl a
108.Dq auto-size .
109Bypass all tape length considerations, and enforce writing
110until an end-of-media indication is returned.  This fits best
111for most modern tape drives.  Use of this option is particularly
112recommended when appending to an existing tape, or using a tape
113drive with hardware compression (where you can never be sure about
114the compression ratio).
115.It Fl b Ar blocksize
116The number of kilobytes per dump record.
117.It Fl c
118Change the defaults for use with a cartridge tape drive, with a density
119of 8000 bpi, and a length of 1700 feet.
120.It Fl h Ar level
121Honor the user
122.Dq nodump
123flag
124.Dp Dv UF_NODUMP
125only for dumps at or above the given
126.Ar level .
127The default honor level is 1,
128so that incremental backups omit such files
129but full backups retain them.
130.It Fl d Ar density
131Set tape density to
132.Ar density .
133The default is 1600BPI.
134.It Fl f Ar file
135Write the backup to
136.Ar file ;
137.Ar file
138may be a special device file
139like
140.Pa /dev/rst0
141(a tape drive),
142.Pa /dev/rfd1
143(a floppy disk drive),
144an ordinary file,
145or
146.Ql Fl
147(the standard output).
148Multiple file names may be given as a single argument separated by commas.
149Each file will be used for one dump volume in the order listed;
150if the dump requires more volumes than the number of names given,
151the last file name will used for all remaining volumes after prompting
152for media changes.
153If the name of the file is of the form
154.Dq host:file ,
155or
156.Dq user@host:file ,
157.Nm dump
158writes to the named file on the remote host using
159.Xr rmt 8 .
160The default path name of the remote
161.Xr rmt 8
162program is
163.\" rmt path, is the path on the remote host
164.Pa /etc/rmt ;
165this can be overridden by the environment variable
166.Ev RMT .
167.It Fl k
168Use Kerberos authentication to talk to remote tape servers.  (Only
169available if this option was enabled when
170.Nm dump
171was compiled.)
172.It Fl n
173Whenever
174.Nm dump
175requires operator attention,
176notify all operators in the group
177.Dq operator
178by means similar to a
179.Xr wall 1 .
180.It Fl s Ar feet
181Attempt to calculate the amount of tape needed
182at a particular density.
183If this amount is exceeded,
184.Nm dump
185prompts for a new tape.
186It is recommended to be a bit conservative on this option.
187The default tape length is 2300 feet.
188.ne 1i
189.It Fl T Ar date
190Use the specified date as the starting time for the dump
191instead of the time determined from looking in
192.Pa /etc/dumpdates .
193The format of date is the same as that of
194.Xr ctime 3 .
195This option is useful for automated dump scripts that wish to
196dump over a specific period of time.
197The
198.Fl T
199option is mutually exclusive from the
200.Fl u
201option.
202.It Fl u
203Update the file
204.Pa /etc/dumpdates
205after a successful dump.
206The format of
207.Pa /etc/dumpdates
208is readable by people, consisting of one
209free format record per line:
210filesystem name,
211increment level
212and
213.Xr ctime 3
214format dump date.
215There may be only one entry per filesystem at each level.
216The file
217.Pa /etc/dumpdates
218may be edited to change any of the fields,
219if necessary.
220.It Fl W
221.Nm Dump
222tells the operator what file systems need to be dumped.
223This information is gleaned from the files
224.Pa /etc/dumpdates
225and
226.Pa /etc/fstab .
227The
228.Fl W
229option causes
230.Nm dump
231to print out, for each file system in
232.Pa /etc/dumpdates
233the most recent dump date and level,
234and highlights those file systems that should be dumped.
235If the
236.Fl W
237option is set, all other options are ignored, and
238.Nm dump
239exits immediately.
240.It Fl w
241Is like W, but prints only those filesystems which need to be dumped.
242.El
243.Pp
244.Nm Dump
245requires operator intervention on these conditions:
246end of tape,
247end of dump,
248tape write error,
249tape open error or
250disk read error (if there are more than a threshold of 32).
251In addition to alerting all operators implied by the
252.Fl n
253key,
254.Nm dump
255interacts with the operator on
256.Em dump's
257control terminal at times when
258.Nm dump
259can no longer proceed,
260or if something is grossly wrong.
261All questions
262.Nm dump
263poses
264.Em must
265be answered by typing
266.Dq yes
267or
268.Dq no ,
269appropriately.
270.Pp
271Since making a dump involves a lot of time and effort for full dumps,
272.Nm dump
273checkpoints itself at the start of each tape volume.
274If writing that volume fails for some reason,
275.Nm dump
276will,
277with operator permission,
278restart itself from the checkpoint
279after the old tape has been rewound and removed,
280and a new tape has been mounted.
281.Pp
282.Nm Dump
283tells the operator what is going on at periodic intervals,
284including usually low estimates of the number of blocks to write,
285the number of tapes it will take, the time to completion, and
286the time to the tape change.
287The output is verbose,
288so that others know that the terminal
289controlling
290.Nm dump
291is busy,
292and will be for some time.
293.Pp
294In the event of a catastrophic disk event, the time required
295to restore all the necessary backup tapes or files to disk
296can be kept to a minimum by staggering the incremental dumps.
297An efficient method of staggering incremental dumps
298to minimize the number of tapes follows:
299.Bl -bullet -offset indent
300.It
301Always start with a level 0 backup, for example:
302.Bd -literal -offset indent
303/sbin/dump -0u -f /dev/nrst0 /usr/src
304.Ed
305.Pp
306This should be done at set intervals, say once a month or once every two months,
307and on a set of fresh tapes that is saved forever.
308.It
309After a level 0, dumps of active file
310systems are taken on a daily basis,
311using a modified Tower of Hanoi algorithm,
312with this sequence of dump levels:
313.Bd -literal -offset indent
3143 2 5 4 7 6 9 8 9 9 ...
315.Ed
316.Pp
317For the daily dumps, it should be possible to use a fixed number of tapes
318for each day, used on a weekly basis.
319Each week, a level 1 dump is taken, and
320the daily Hanoi sequence repeats beginning with 3.
321For weekly dumps, another fixed set of tapes per dumped file system is
322used, also on a cyclical basis.
323.El
324.Pp
325After several months or so, the daily and weekly tapes should get
326rotated out of the dump cycle and fresh tapes brought in.
327.Sh ENVIRONMENT
328The environment variable
329.Ev RMT
330will be used to determine the pathname of the remote
331.Xr rmt 8
332program.
333.Sh FILES
334.Bl -tag -width /etc/dumpdates -compact
335.It Pa /dev/rst0
336default tape unit to dump to
337.It Pa /etc/dumpdates
338dump date records
339.It Pa /etc/fstab
340dump table: file systems and frequency
341.It Pa /etc/group
342to find group
343.Em operator
344.El
345.Sh SEE ALSO
346.Xr dump 5 ,
347.Xr fstab 5 ,
348.Xr ft 8 ,
349.Xr restore 8 ,
350.Xr rmt 8
351.Sh DIAGNOSTICS
352Many, and verbose.
353.Pp
354Dump exits with zero status on success.
355Startup errors are indicated with an exit code of 1;
356abnormal termination is indicated with an exit code of 3.
357.Sh BUGS
358Fewer than 32 read errors on the filesystem are ignored.
359.Pp
360Each reel requires a new process, so parent processes for
361reels already written just hang around until the entire tape
362is written.
363.Pp
364Currently,
365.Xr physio 9
366slices all requests into chunks of 64 KB.  Therefore, it is
367impossible to use a larger tape blocksize, so
368.Nm dump
369will prevent this from happening.
370.Pp
371.Nm Dump
372with the
373.Fl W
374or
375.Fl w
376options does not report filesystems that have never been recorded
377in
378.Pa /etc/dumpdates ,
379even if listed in
380.Pa /etc/fstab .
381.Pp
382It would be nice if
383.Nm dump
384knew about the dump sequence,
385kept track of the tapes scribbled on,
386told the operator which tape to mount when,
387and provided more assistance
388for the operator running
389.Xr restore .
390.Pp
391.Nm dump
392cannot do remote backups without being run as root, due to its
393security history.  This will be fixed in a later version of FreeBSD.
394Presently, it work if you set it setuid (like it used to be), but this
395might constitute a security risk.
396.Sh HISTORY
397A
398.Nm dump
399command appeared in
400.At v6 .
401