xref: /freebsd/sbin/dump/dump.8 (revision 51e16cb8fc536913f490ac6bc9c17e92ebd0411b)
18fae3551SRodney W. Grimes.\" Copyright (c) 1980, 1991, 1993
28fae3551SRodney W. Grimes.\"	 Regents of the University of California.
38fae3551SRodney W. Grimes.\" All rights reserved.
48fae3551SRodney W. Grimes.\"
58fae3551SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without
68fae3551SRodney W. Grimes.\" modification, are permitted provided that the following conditions
78fae3551SRodney W. Grimes.\" are met:
88fae3551SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright
98fae3551SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer.
108fae3551SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright
118fae3551SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer in the
128fae3551SRodney W. Grimes.\"    documentation and/or other materials provided with the distribution.
13fbbd9655SWarner Losh.\" 3. Neither the name of the University nor the names of its contributors
148fae3551SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
158fae3551SRodney W. Grimes.\"    without specific prior written permission.
168fae3551SRodney W. Grimes.\"
178fae3551SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
188fae3551SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
198fae3551SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
208fae3551SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
218fae3551SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
228fae3551SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
238fae3551SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
248fae3551SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
258fae3551SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
268fae3551SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
278fae3551SRodney W. Grimes.\" SUCH DAMAGE.
288fae3551SRodney W. Grimes.\"
29*70a2e109SGuangyuan Yang.Dd December 28, 2020
308fae3551SRodney W. Grimes.Dt DUMP 8
319fe48c6eSRuslan Ermilov.Os
328fae3551SRodney W. Grimes.Sh NAME
3307a48f4bSAlexey Zelkin.Nm dump ,
3407a48f4bSAlexey Zelkin.Nm rdump
358fae3551SRodney W. Grimes.Nd file system backup
368fae3551SRodney W. Grimes.Sh SYNOPSIS
377c7fb079SRuslan Ermilov.Nm
38693c40a3SKirk McKusick.Op Fl 0123456789acLnrRSu
39a37c38b8SPeter Wemm.Op Fl B Ar records
40a37c38b8SPeter Wemm.Op Fl b Ar blocksize
415941e412SMatthew Dillon.Op Fl C Ar cachesize
421f6a4631SRuslan Ermilov.Op Fl D Ar dumpdates
43a37c38b8SPeter Wemm.Op Fl d Ar density
44c51d70c6SBrian Feldman.Op Fl f Ar file | Fl P Ar pipecommand
45a37c38b8SPeter Wemm.Op Fl h Ar level
46a37c38b8SPeter Wemm.Op Fl s Ar feet
47a37c38b8SPeter Wemm.Op Fl T Ar date
48a37c38b8SPeter Wemm.Ar filesystem
497c7fb079SRuslan Ermilov.Nm
507ac80665STom Rhodes.Fl W | Fl w
518fae3551SRodney W. Grimes.Sh DESCRIPTION
52e1205e80SPhilippe CharnierThe
53e1205e80SPhilippe Charnier.Nm
54e1205e80SPhilippe Charnierutility examines files
558fae3551SRodney W. Grimeson a file system
568fae3551SRodney W. Grimesand determines which files
57ef8f7ac9SSheldon Hearnneed to be backed up.
58ef8f7ac9SSheldon HearnThese files
598fae3551SRodney W. Grimesare copied to the given disk, tape or other
608fae3551SRodney W. Grimesstorage medium for safe keeping (see the
61a37c38b8SPeter Wemm.Fl f
628fae3551SRodney W. Grimesoption below for doing remote backups).
638fae3551SRodney W. GrimesA dump that is larger than the output medium is broken into
648fae3551SRodney W. Grimesmultiple volumes.
658fae3551SRodney W. GrimesOn most media the size is determined by writing until an
661f6a4631SRuslan Ermilovend-of-media indication is returned.
671f6a4631SRuslan ErmilovThis can be enforced
68af00957eSJoerg Wunschby using the
69e457979cSPeter Wemm.Fl a
70af00957eSJoerg Wunschoption.
71af00957eSJoerg Wunsch.Pp
728fae3551SRodney W. GrimesOn media that cannot reliably return an end-of-media indication
738fae3551SRodney W. Grimes(such as some cartridge tape drives)
748fae3551SRodney W. Grimeseach volume is of a fixed size;
758fae3551SRodney W. Grimesthe actual size is determined by the tape size and density and/or
767ac80665STom Rhodes.Fl B
777ac80665STom Rhodesoptions.
788fae3551SRodney W. GrimesBy default, the same output file name is used for each volume
798fae3551SRodney W. Grimesafter prompting the operator to change media.
808fae3551SRodney W. Grimes.Pp
817ac80665STom RhodesThe file system to be dumped is specified by the argument
827ac80665STom Rhodes.Ar filesystem
837ac80665STom Rhodesas either its device-special file or its mount point
841ec84e50SRuslan Ermilov(if that is in a standard entry in
851ec84e50SRuslan Ermilov.Pa /etc/fstab ) .
867ac80665STom Rhodes.Pp
87a692c58aSJoel Dahl.Nm
88a692c58aSJoel Dahlmay also be invoked as
89a692c58aSJoel Dahl.Nm rdump .
90a692c58aSJoel DahlThe
91a692c58aSJoel Dahl.Bx 4.3
92a692c58aSJoel Dahloption syntax is implemented for backward compatibility, but
93a692c58aSJoel Dahlis not documented here.
94a692c58aSJoel Dahl.Pp
958fae3551SRodney W. GrimesThe following options are supported by
967c7fb079SRuslan Ermilov.Nm :
97a37c38b8SPeter Wemm.Bl -tag -width Ds
981f6a4631SRuslan Ermilov.It Fl 0-9
998fae3551SRodney W. GrimesDump levels.
1008fae3551SRodney W. GrimesA level 0, full backup,
1018fae3551SRodney W. Grimesguarantees the entire file system is copied
1028fae3551SRodney W. Grimes(but see also the
103a37c38b8SPeter Wemm.Fl h
1048fae3551SRodney W. Grimesoption below).
1058fae3551SRodney W. GrimesA level number above 0,
1068fae3551SRodney W. Grimesincremental backup,
1078fae3551SRodney W. Grimestells dump to
1088fae3551SRodney W. Grimescopy all files new or modified since the
10959dcbbb2SJoerg Wunschlast dump of any lower level.
110d2daa2c0SSteve PriceThe default level is 0.
111a37c38b8SPeter Wemm.It Fl a
112af00957eSJoerg Wunsch.Dq auto-size .
113af00957eSJoerg WunschBypass all tape length considerations, and enforce writing
1141f6a4631SRuslan Ermilovuntil an end-of-media indication is returned.
1151f6a4631SRuslan ErmilovThis fits best for most modern tape drives.
1161f6a4631SRuslan ErmilovUse of this option is particularly
117af00957eSJoerg Wunschrecommended when appending to an existing tape, or using a tape
118af00957eSJoerg Wunschdrive with hardware compression (where you can never be sure about
119af00957eSJoerg Wunschthe compression ratio).
12003578dfeSDima Dorfman.It Fl B Ar records
1217ac80665STom RhodesThe number of kilobytes per output volume, except that if it is
1227ac80665STom Rhodesnot an integer multiple of the output block size,
1237ac80665STom Rhodesthe command uses the next smaller such multiple.
12403578dfeSDima DorfmanThis option overrides the calculation of tape size
12503578dfeSDima Dorfmanbased on length and density.
126a37c38b8SPeter Wemm.It Fl b Ar blocksize
12717fe3d1dSGreg LeheyThe number of kilobytes per output block.
1287ac80665STom RhodesThe default block size is 10.
1291f6a4631SRuslan Ermilov.It Fl C Ar cachesize
1301f6a4631SRuslan ErmilovSpecify the cache size in megabytes.
1311f6a4631SRuslan ErmilovThis will greatly improve performance
1321f6a4631SRuslan Ermilovat the cost of
1331f6a4631SRuslan Ermilov.Nm
134*70a2e109SGuangyuan Yangpossibly not noticing changes in the file system between passes
135*70a2e109SGuangyuan Yangunless a snapshot is being used.
136*70a2e109SGuangyuan YangThe potential for performance improvement indicates that
137*70a2e109SGuangyuan Yanguse of this option together with snapshots is the recommended
138*70a2e109SGuangyuan Yangcourse of action.
1391f6a4631SRuslan ErmilovBeware that
1401f6a4631SRuslan Ermilov.Nm
1411f6a4631SRuslan Ermilovforks, and the actual memory use may be larger than the specified cache
1421f6a4631SRuslan Ermilovsize.
1431f6a4631SRuslan ErmilovThe recommended cache size is between 8 and 32 (megabytes).
144a37c38b8SPeter Wemm.It Fl c
145af00957eSJoerg WunschChange the defaults for use with a cartridge tape drive, with a density
146af00957eSJoerg Wunschof 8000 bpi, and a length of 1700 feet.
147988d64c2SMatthew Dillon.It Fl D Ar dumpdates
148448087aeSRuslan ErmilovSpecify an alternate path to the
149448087aeSRuslan Ermilov.Pa dumpdates
150448087aeSRuslan Ermilovfile.
151988d64c2SMatthew DillonThe default is
152988d64c2SMatthew Dillon.Pa /etc/dumpdates .
153a37c38b8SPeter Wemm.It Fl d Ar density
154a37c38b8SPeter WemmSet tape density to
155a37c38b8SPeter Wemm.Ar density .
156a37c38b8SPeter WemmThe default is 1600BPI.
157a37c38b8SPeter Wemm.It Fl f Ar file
1588fae3551SRodney W. GrimesWrite the backup to
1598fae3551SRodney W. Grimes.Ar file ;
1608fae3551SRodney W. Grimes.Ar file
1618fae3551SRodney W. Grimesmay be a special device file
1628fae3551SRodney W. Grimeslike
163ff7405adSDavid E. O'Brien.Pa /dev/sa0
1648fae3551SRodney W. Grimes(a tape drive),
165257875beSKris Kennaway.Pa /dev/fd1
166019420a5SJoerg Wunsch(a floppy disk drive),
1678fae3551SRodney W. Grimesan ordinary file,
1688fae3551SRodney W. Grimesor
169463cfa80SRuslan Ermilov.Sq Fl
1708fae3551SRodney W. Grimes(the standard output).
1718fae3551SRodney W. GrimesMultiple file names may be given as a single argument separated by commas.
1728fae3551SRodney W. GrimesEach file will be used for one dump volume in the order listed;
1738fae3551SRodney W. Grimesif the dump requires more volumes than the number of names given,
1748fae3551SRodney W. Grimesthe last file name will used for all remaining volumes after prompting
1758fae3551SRodney W. Grimesfor media changes.
1768fae3551SRodney W. GrimesIf the name of the file is of the form
1778fae3551SRodney W. Grimes.Dq host:file ,
1788fae3551SRodney W. Grimesor
1798fae3551SRodney W. Grimes.Dq user@host:file ,
1807580ffbbSPhilippe Charnier.Nm
1818fae3551SRodney W. Grimeswrites to the named file on the remote host using
1828fae3551SRodney W. Grimes.Xr rmt 8 .
183019420a5SJoerg WunschThe default path name of the remote
184019420a5SJoerg Wunsch.Xr rmt 8
185019420a5SJoerg Wunschprogram is
1864cbb75f4SDavid E. O'Brien.\" rmt path, is the path on the remote host
1874cbb75f4SDavid E. O'Brien.Pa /etc/rmt ;
188019420a5SJoerg Wunschthis can be overridden by the environment variable
189019420a5SJoerg Wunsch.Ev RMT .
190c51d70c6SBrian Feldman.It Fl P Ar pipecommand
191c51d70c6SBrian FeldmanUse
192c51d70c6SBrian Feldman.Xr popen 3
193c51d70c6SBrian Feldmanto execute the
194c51d70c6SBrian Feldman.Xr sh 1
195c51d70c6SBrian Feldmanscript string defined by
196c51d70c6SBrian Feldman.Ar pipecommand
197c51d70c6SBrian Feldmanfor the output device of each volume.
198c51d70c6SBrian FeldmanThis child pipeline's
199c51d70c6SBrian Feldman.Dv stdin
200d04b5dfeSRuslan Ermilov.Pq Pa /dev/fd/0
201c51d70c6SBrian Feldmanis redirected from the
202c51d70c6SBrian Feldman.Nm
203c51d70c6SBrian Feldmanoutput stream, and the environment variable
204c51d70c6SBrian Feldman.Ev DUMP_VOLUME
205c51d70c6SBrian Feldmanis set to the current volume number being written.
206c51d70c6SBrian FeldmanAfter every volume, the writer side of the pipe is closed and
207c51d70c6SBrian Feldman.Ar pipecommand
208c51d70c6SBrian Feldmanis executed again.
209c51d70c6SBrian FeldmanSubject to the media size specified by
210c51d70c6SBrian Feldman.Fl B ,
211c51d70c6SBrian Feldmaneach volume is written in this manner as if the output were a tape drive.
21203578dfeSDima Dorfman.It Fl h Ar level
21303578dfeSDima DorfmanHonor the user
21403578dfeSDima Dorfman.Dq nodump
21503578dfeSDima Dorfmanflag
21603578dfeSDima Dorfman.Pq Dv UF_NODUMP
21703578dfeSDima Dorfmanonly for dumps at or above the given
21803578dfeSDima Dorfman.Ar level .
21903578dfeSDima DorfmanThe default honor level is 1,
22003578dfeSDima Dorfmanso that incremental backups omit such files
22103578dfeSDima Dorfmanbut full backups retain them.
222194a6667SKirk McKusick.It Fl L
223194a6667SKirk McKusickThis option is to notify
224194a6667SKirk McKusick.Nm
225194a6667SKirk McKusickthat it is dumping a live file system.
226194a6667SKirk McKusickTo obtain a consistent dump image,
227194a6667SKirk McKusick.Nm
228b17f40bbSKirk McKusicktakes a snapshot of the file system in the
229b17f40bbSKirk McKusick.Pa .snap
230b17f40bbSKirk McKusickdirectory in the root of the file system being dumped and
231194a6667SKirk McKusickthen does a dump of the snapshot.
23272408a12SThomas QuinotThe snapshot is unlinked as soon as the dump starts, and
23372408a12SThomas Quinotis thus removed when the dump is complete.
234f7c7b87fSBrian FeldmanThis option is ignored for unmounted or read-only file systems.
235b17f40bbSKirk McKusickIf the
236b17f40bbSKirk McKusick.Pa .snap
237b17f40bbSKirk McKusickdirectory does not exist in the root of the file system being dumped,
23873e31afaSWes Petersa warning will be issued and the
239d04b5dfeSRuslan Ermilov.Nm
24073e31afaSWes Peterswill revert to the standard behavior.
241b17f40bbSKirk McKusickThis problem can be corrected by creating a
242b17f40bbSKirk McKusick.Pa .snap
243b17f40bbSKirk McKusickdirectory in the root of the file system to be dumped;
244d04b5dfeSRuslan Ermilovits owner should be
245d04b5dfeSRuslan Ermilov.Dq Li root ,
246d04b5dfeSRuslan Ermilovits group should be
247d04b5dfeSRuslan Ermilov.Dq Li operator ,
248d04b5dfeSRuslan Ermilovand its mode should be
249d04b5dfeSRuslan Ermilov.Dq Li 0770 .
250a37c38b8SPeter Wemm.It Fl n
2518fae3551SRodney W. GrimesWhenever
2527580ffbbSPhilippe Charnier.Nm
2538fae3551SRodney W. Grimesrequires operator attention,
2548fae3551SRodney W. Grimesnotify all operators in the group
2558fae3551SRodney W. Grimes.Dq operator
2568fae3551SRodney W. Grimesby means similar to a
2578fae3551SRodney W. Grimes.Xr wall 1 .
258693c40a3SKirk McKusick.It Fl r
259693c40a3SKirk McKusickBe rsync-friendly.
260693c40a3SKirk McKusickNormally dump stores the date of the current
261693c40a3SKirk McKusickand prior dump in numerous places throughout the dump.
262693c40a3SKirk McKusickThese scattered changes significantly slow down rsync or
263693c40a3SKirk McKusickanother incremental file transfer program when they are
264693c40a3SKirk McKusickused to update a remote copy of a level 0 dump,
265693c40a3SKirk McKusicksince the date changes for each dump.
266693c40a3SKirk McKusickThis option sets both dates to the epoch, permitting
267693c40a3SKirk McKusickrsync to be much more efficient when transferring a dump file.
268e924cb6fSKirk McKusickThe
269e924cb6fSKirk McKusick.Fl r
270e924cb6fSKirk McKusickoption can be used only to create level 0 dumps.
271e924cb6fSKirk McKusickA dump using the
272e924cb6fSKirk McKusick.Fl r
273e924cb6fSKirk McKusickoption cannot be used as the basis for a later incremental dump.
274693c40a3SKirk McKusick.It Fl R
275693c40a3SKirk McKusickBe even more rsync-friendly.
276693c40a3SKirk McKusickThis option disables the storage of the actual inode access time
277693c40a3SKirk McKusick(storing it instead as the inode's modified time).
278693c40a3SKirk McKusickThis option permits rsync to be even more efficient
279693c40a3SKirk McKusickwhen transferring dumps generated from filesystems with numerous files
280693c40a3SKirk McKusickwhich are not changing other than their access times.
281693c40a3SKirk McKusickThe
282693c40a3SKirk McKusick.Fl R
283693c40a3SKirk McKusickoption also sets
284693c40a3SKirk McKusick.Fl r .
285e924cb6fSKirk McKusickThe
286e924cb6fSKirk McKusick.Fl R
287e924cb6fSKirk McKusickoption can be used only to create level 0 dumps.
288e924cb6fSKirk McKusickA dump using the
289e924cb6fSKirk McKusick.Fl R
290e924cb6fSKirk McKusickoption cannot be used as the basis for a later incremental dump.
2911f6a4631SRuslan Ermilov.It Fl S
2921f6a4631SRuslan ErmilovDisplay an estimate of the backup size and the number of
2931f6a4631SRuslan Ermilovtapes required, and exit without actually performing the dump.
294a37c38b8SPeter Wemm.It Fl s Ar feet
2958fae3551SRodney W. GrimesAttempt to calculate the amount of tape needed
2968fae3551SRodney W. Grimesat a particular density.
2978fae3551SRodney W. GrimesIf this amount is exceeded,
2987580ffbbSPhilippe Charnier.Nm
2998fae3551SRodney W. Grimesprompts for a new tape.
3008fae3551SRodney W. GrimesIt is recommended to be a bit conservative on this option.
3018fae3551SRodney W. GrimesThe default tape length is 2300 feet.
302a37c38b8SPeter Wemm.It Fl T Ar date
303a37c38b8SPeter WemmUse the specified date as the starting time for the dump
304a37c38b8SPeter Wemminstead of the time determined from looking in
305e388c208SGiorgos Keramidasthe
306448087aeSRuslan Ermilov.Pa dumpdates
307448087aeSRuslan Ermilovfile.
308a37c38b8SPeter WemmThe format of date is the same as that of
309a37c38b8SPeter Wemm.Xr ctime 3 .
310a37c38b8SPeter WemmThis option is useful for automated dump scripts that wish to
311a37c38b8SPeter Wemmdump over a specific period of time.
312a37c38b8SPeter WemmThe
313a37c38b8SPeter Wemm.Fl T
314a37c38b8SPeter Wemmoption is mutually exclusive from the
315a37c38b8SPeter Wemm.Fl u
316a37c38b8SPeter Wemmoption.
317a37c38b8SPeter Wemm.It Fl u
318448087aeSRuslan ErmilovUpdate the
319448087aeSRuslan Ermilov.Pa dumpdates
320448087aeSRuslan Ermilovfile
3218fae3551SRodney W. Grimesafter a successful dump.
3228fae3551SRodney W. GrimesThe format of
323448087aeSRuslan Ermilovthe
324448087aeSRuslan Ermilov.Pa dumpdates
325448087aeSRuslan Ermilovfile
3268fae3551SRodney W. Grimesis readable by people, consisting of one
3278fae3551SRodney W. Grimesfree format record per line:
3288fae3551SRodney W. Grimesfile system name,
3298fae3551SRodney W. Grimesincrement level
3308fae3551SRodney W. Grimesand
3318fae3551SRodney W. Grimes.Xr ctime 3
3328fae3551SRodney W. Grimesformat dump date.
3338fae3551SRodney W. GrimesThere may be only one entry per file system at each level.
334448087aeSRuslan ErmilovThe
335448087aeSRuslan Ermilov.Pa dumpdates
336448087aeSRuslan Ermilovfile
3378fae3551SRodney W. Grimesmay be edited to change any of the fields,
3388fae3551SRodney W. Grimesif necessary.
339448087aeSRuslan ErmilovThe default path for the
340448087aeSRuslan Ermilov.Pa dumpdates
341448087aeSRuslan Ermilovfile is
342988d64c2SMatthew Dillon.Pa /etc/dumpdates ,
343988d64c2SMatthew Dillonbut the
344988d64c2SMatthew Dillon.Fl D
345988d64c2SMatthew Dillonoption may be used to change it.
346a37c38b8SPeter Wemm.It Fl W
347e1205e80SPhilippe CharnierTell the operator what file systems need to be dumped.
3488fae3551SRodney W. GrimesThis information is gleaned from the files
349448087aeSRuslan Ermilov.Pa dumpdates
3508fae3551SRodney W. Grimesand
3518fae3551SRodney W. Grimes.Pa /etc/fstab .
3528fae3551SRodney W. GrimesThe
353a37c38b8SPeter Wemm.Fl W
3548fae3551SRodney W. Grimesoption causes
3557580ffbbSPhilippe Charnier.Nm
3568fae3551SRodney W. Grimesto print out, for each file system in
357448087aeSRuslan Ermilovthe
358448087aeSRuslan Ermilov.Pa dumpdates
359448087aeSRuslan Ermilovfile
3608fae3551SRodney W. Grimesthe most recent dump date and level,
3618fae3551SRodney W. Grimesand highlights those file systems that should be dumped.
3628fae3551SRodney W. GrimesIf the
363a37c38b8SPeter Wemm.Fl W
3648fae3551SRodney W. Grimesoption is set, all other options are ignored, and
3657580ffbbSPhilippe Charnier.Nm
3668fae3551SRodney W. Grimesexits immediately.
367a37c38b8SPeter Wemm.It Fl w
3681f6a4631SRuslan ErmilovIs like
3691f6a4631SRuslan Ermilov.Fl W ,
3701f6a4631SRuslan Ermilovbut prints only those file systems which need to be dumped.
3718fae3551SRodney W. Grimes.El
3728fae3551SRodney W. Grimes.Pp
37371717f5dSDima DorfmanDirectories and regular files which have their
374801382faSDavid E. O'Brien.Dq nodump
375801382faSDavid E. O'Brienflag
376801382faSDavid E. O'Brien.Pq Dv UF_NODUMP
37771717f5dSDima Dorfmanset will be omitted along with everything under such directories,
37871717f5dSDima Dorfmansubject to the
37971717f5dSDima Dorfman.Fl h
38071717f5dSDima Dorfmanoption.
381801382faSDavid E. O'Brien.Pp
382e1205e80SPhilippe CharnierThe
383e1205e80SPhilippe Charnier.Nm
384e1205e80SPhilippe Charnierutility requires operator intervention on these conditions:
3858fae3551SRodney W. Grimesend of tape,
3868fae3551SRodney W. Grimesend of dump,
3878fae3551SRodney W. Grimestape write error,
3888fae3551SRodney W. Grimestape open error or
3898fae3551SRodney W. Grimesdisk read error (if there are more than a threshold of 32).
3908fae3551SRodney W. GrimesIn addition to alerting all operators implied by the
391a37c38b8SPeter Wemm.Fl n
3928fae3551SRodney W. Grimeskey,
3937580ffbbSPhilippe Charnier.Nm
3948fae3551SRodney W. Grimesinteracts with the operator on
3958fae3551SRodney W. Grimes.Em dump's
3968fae3551SRodney W. Grimescontrol terminal at times when
3977580ffbbSPhilippe Charnier.Nm
3988fae3551SRodney W. Grimescan no longer proceed,
3998fae3551SRodney W. Grimesor if something is grossly wrong.
4008fae3551SRodney W. GrimesAll questions
4017580ffbbSPhilippe Charnier.Nm
4028fae3551SRodney W. Grimesposes
4038fae3551SRodney W. Grimes.Em must
4048fae3551SRodney W. Grimesbe answered by typing
4058fae3551SRodney W. Grimes.Dq yes
4068fae3551SRodney W. Grimesor
4078fae3551SRodney W. Grimes.Dq no ,
4088fae3551SRodney W. Grimesappropriately.
4098fae3551SRodney W. Grimes.Pp
4108fae3551SRodney W. GrimesSince making a dump involves a lot of time and effort for full dumps,
4117580ffbbSPhilippe Charnier.Nm
4128fae3551SRodney W. Grimescheckpoints itself at the start of each tape volume.
4138fae3551SRodney W. GrimesIf writing that volume fails for some reason,
4147580ffbbSPhilippe Charnier.Nm
4158fae3551SRodney W. Grimeswill,
4168fae3551SRodney W. Grimeswith operator permission,
4178fae3551SRodney W. Grimesrestart itself from the checkpoint
4188fae3551SRodney W. Grimesafter the old tape has been rewound and removed,
4198fae3551SRodney W. Grimesand a new tape has been mounted.
4208fae3551SRodney W. Grimes.Pp
421e1205e80SPhilippe CharnierThe
422e1205e80SPhilippe Charnier.Nm
423e1205e80SPhilippe Charnierutility tells the operator what is going on at periodic intervals
424992b9b7aSRuslan Ermilov(every 5 minutes, or promptly after receiving
425992b9b7aSRuslan Ermilov.Dv SIGINFO ) ,
4268fae3551SRodney W. Grimesincluding usually low estimates of the number of blocks to write,
4278fae3551SRodney W. Grimesthe number of tapes it will take, the time to completion, and
4288fae3551SRodney W. Grimesthe time to the tape change.
4298fae3551SRodney W. GrimesThe output is verbose,
4308fae3551SRodney W. Grimesso that others know that the terminal
4318fae3551SRodney W. Grimescontrolling
4327580ffbbSPhilippe Charnier.Nm
4338fae3551SRodney W. Grimesis busy,
4348fae3551SRodney W. Grimesand will be for some time.
4358fae3551SRodney W. Grimes.Pp
4368fae3551SRodney W. GrimesIn the event of a catastrophic disk event, the time required
4378fae3551SRodney W. Grimesto restore all the necessary backup tapes or files to disk
4388fae3551SRodney W. Grimescan be kept to a minimum by staggering the incremental dumps.
4398fae3551SRodney W. GrimesAn efficient method of staggering incremental dumps
4408fae3551SRodney W. Grimesto minimize the number of tapes follows:
4418fae3551SRodney W. Grimes.Bl -bullet -offset indent
4428fae3551SRodney W. Grimes.It
4438fae3551SRodney W. GrimesAlways start with a level 0 backup, for example:
4448fae3551SRodney W. Grimes.Bd -literal -offset indent
445ff7405adSDavid E. O'Brien/sbin/dump -0u -f /dev/nsa0 /usr/src
4468fae3551SRodney W. Grimes.Ed
4478fae3551SRodney W. Grimes.Pp
4488fae3551SRodney W. GrimesThis should be done at set intervals, say once a month or once every two months,
4498fae3551SRodney W. Grimesand on a set of fresh tapes that is saved forever.
4508fae3551SRodney W. Grimes.It
4515324d49aSKen SmithAfter a level 0, dumps of active file systems (file systems with files
4525324d49aSKen Smiththat change, depending on your partition layout some file systems may
4535324d49aSKen Smithcontain only data that does not change) are taken on a daily basis,
4548fae3551SRodney W. Grimesusing a modified Tower of Hanoi algorithm,
4558fae3551SRodney W. Grimeswith this sequence of dump levels:
4568fae3551SRodney W. Grimes.Bd -literal -offset indent
4578fae3551SRodney W. Grimes3 2 5 4 7 6 9 8 9 9 ...
4588fae3551SRodney W. Grimes.Ed
4598fae3551SRodney W. Grimes.Pp
4608fae3551SRodney W. GrimesFor the daily dumps, it should be possible to use a fixed number of tapes
4618fae3551SRodney W. Grimesfor each day, used on a weekly basis.
4628fae3551SRodney W. GrimesEach week, a level 1 dump is taken, and
4638fae3551SRodney W. Grimesthe daily Hanoi sequence repeats beginning with 3.
4648fae3551SRodney W. GrimesFor weekly dumps, another fixed set of tapes per dumped file system is
4658fae3551SRodney W. Grimesused, also on a cyclical basis.
4668fae3551SRodney W. Grimes.El
4678fae3551SRodney W. Grimes.Pp
4688fae3551SRodney W. GrimesAfter several months or so, the daily and weekly tapes should get
4698fae3551SRodney W. Grimesrotated out of the dump cycle and fresh tapes brought in.
470019420a5SJoerg Wunsch.Sh ENVIRONMENT
4712ab3df59SSheldon Hearn.Bl -tag -width ".Ev TAPE"
4722ab3df59SSheldon Hearn.It Ev TAPE
473b1f1271fSCeri DaviesThe
474b1f1271fSCeri Davies.Ar file
475b1f1271fSCeri Daviesor device to dump to if the
476b1f1271fSCeri Davies.Fl f
477b1f1271fSCeri Daviesoption is not used.
4782ab3df59SSheldon Hearn.It Ev RMT
4792ab3df59SSheldon HearnPathname of the remote
480019420a5SJoerg Wunsch.Xr rmt 8
481019420a5SJoerg Wunschprogram.
48293ba0fc8SAlexander Langer.It Ev RSH
483d04b5dfeSRuslan ErmilovPathname of a remote shell program, if not
48493ba0fc8SAlexander Langer.Xr rsh 1 .
4852ab3df59SSheldon Hearn.El
4868fae3551SRodney W. Grimes.Sh FILES
4878fae3551SRodney W. Grimes.Bl -tag -width /etc/dumpdates -compact
488ff7405adSDavid E. O'Brien.It Pa /dev/sa0
4898fae3551SRodney W. Grimesdefault tape unit to dump to
4908fae3551SRodney W. Grimes.It Pa /etc/dumpdates
4918fae3551SRodney W. Grimesdump date records
492988d64c2SMatthew Dillon(this can be changed;
493988d64c2SMatthew Dillonsee the
494988d64c2SMatthew Dillon.Fl D
495988d64c2SMatthew Dillonoption)
4968fae3551SRodney W. Grimes.It Pa /etc/fstab
4978fae3551SRodney W. Grimesdump table: file systems and frequency
4988fae3551SRodney W. Grimes.It Pa /etc/group
4998fae3551SRodney W. Grimesto find group
5008fae3551SRodney W. Grimes.Em operator
5018fae3551SRodney W. Grimes.El
5026087df9eSRuslan Ermilov.Sh EXIT STATUS
5036087df9eSRuslan ErmilovDump exits with zero status on success.
5046087df9eSRuslan ErmilovStartup errors are indicated with an exit code of 1;
5056087df9eSRuslan Ermilovabnormal termination is indicated with an exit code of 3.
5068266d476SRuslan Ermilov.Sh EXAMPLES
5078266d476SRuslan ErmilovDumps the
5088266d476SRuslan Ermilov.Pa /u
5098266d476SRuslan Ermilovfile system to DVDs using
5108266d476SRuslan Ermilov.Nm growisofs .
5118266d476SRuslan ErmilovUses a 16MB cache, creates a snapshot of the dump, and records the
5128266d476SRuslan Ermilov.Pa dumpdates
5138266d476SRuslan Ermilovfile.
5148266d476SRuslan Ermilov.Bd -literal
5158266d476SRuslan Ermilov/sbin/dump -0u  -L -C16 -B4589840 -P 'growisofs -Z /dev/cd0=/dev/fd/0' /u
5168266d476SRuslan Ermilov.Ed
5176087df9eSRuslan Ermilov.Sh DIAGNOSTICS
5186087df9eSRuslan ErmilovMany, and verbose.
5198fae3551SRodney W. Grimes.Sh SEE ALSO
52071717f5dSDima Dorfman.Xr chflags 1 ,
521af202156SWolfram Schneider.Xr fstab 5 ,
5228fae3551SRodney W. Grimes.Xr restore 8 ,
523af202156SWolfram Schneider.Xr rmt 8
5246087df9eSRuslan Ermilov.Sh HISTORY
5256087df9eSRuslan ErmilovA
5266087df9eSRuslan Ermilov.Nm
5276087df9eSRuslan Ermilovutility appeared in
528b26d1098SSevan Janiyan.At v4 .
5298fae3551SRodney W. Grimes.Sh BUGS
5305324d49aSKen SmithFewer than 32 read errors on the file system are ignored, though all
5315324d49aSKen Smitherrors will generate a warning message.
5325324d49aSKen SmithThis is a bit of a compromise.
533d04b5dfeSRuslan ErmilovIn practice, it is possible to generate read errors when doing dumps
5345324d49aSKen Smithon mounted partitions if the file system is being modified while the
535d04b5dfeSRuslan Ermilov.Nm
536d04b5dfeSRuslan Ermilovis running.
5375324d49aSKen SmithSince dumps are often done in an unattended fashion using
5385324d49aSKen Smith.Xr cron 8
539d04b5dfeSRuslan Ermilovjobs asking for Operator intervention would result in the
540d04b5dfeSRuslan Ermilov.Nm
541d04b5dfeSRuslan Ermilovdying.
542d04b5dfeSRuslan ErmilovHowever, there is nothing wrong with a dump tape written when this sort
543d04b5dfeSRuslan Ermilovof read error occurs, and there is no reason to terminate the
544d04b5dfeSRuslan Ermilov.Nm .
545a37c38b8SPeter Wemm.Pp
5468fae3551SRodney W. GrimesEach reel requires a new process, so parent processes for
5478fae3551SRodney W. Grimesreels already written just hang around until the entire tape
5488fae3551SRodney W. Grimesis written.
5498fae3551SRodney W. Grimes.Pp
550e1205e80SPhilippe CharnierThe
551e1205e80SPhilippe Charnier.Nm
552e1205e80SPhilippe Charnierutility with the
553a37c38b8SPeter Wemm.Fl W
5548fae3551SRodney W. Grimesor
555a37c38b8SPeter Wemm.Fl w
5568fae3551SRodney W. Grimesoptions does not report file systems that have never been recorded
557448087aeSRuslan Ermilovin the
558448087aeSRuslan Ermilov.Pa dumpdates
559448087aeSRuslan Ermilovfile,
5608fae3551SRodney W. Grimeseven if listed in
5618fae3551SRodney W. Grimes.Pa /etc/fstab .
5628fae3551SRodney W. Grimes.Pp
5638fae3551SRodney W. GrimesIt would be nice if
5647580ffbbSPhilippe Charnier.Nm
5658fae3551SRodney W. Grimesknew about the dump sequence,
5668fae3551SRodney W. Grimeskept track of the tapes scribbled on,
5678fae3551SRodney W. Grimestold the operator which tape to mount when,
5688fae3551SRodney W. Grimesand provided more assistance
5698fae3551SRodney W. Grimesfor the operator running
5709680d7b6SPhilippe Charnier.Xr restore 8 .
57120a842dfSEivind Eklund.Pp
572e1205e80SPhilippe CharnierThe
573e1205e80SPhilippe Charnier.Nm
574e1205e80SPhilippe Charnierutility cannot do remote backups without being run as root, due to its
5751f6a4631SRuslan Ermilovsecurity history.
5761f6a4631SRuslan ErmilovThis will be fixed in a later version of
577f050f700SMike Pritchard.Fx .
578f135a2b2SSteve PricePresently, it works if you set it setuid (like it used to be), but this
57920a842dfSEivind Eklundmight constitute a security risk.
580