2 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved
3 .\" Copyright 1989 AT&T
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH UFSDUMP 1M "April 9, 2016"
9 ufsdump \- incremental file system dump
13 \fB/usr/sbin/ufsdump\fR [\fIoptions\fR] [\fIarguments\fR] \fIfiles_to_dump\fR
18 \fBufsdump\fR backs up all files specified by \fIfiles_to_dump\fR (usually
19 either a whole file system or files within a file system changed after a certain
20 date) to magnetic tape, diskette, or disk file.
23 The \fBufsdump\fR command can only be used on unmounted file systems, or those
24 mounted read-only. Attempting to dump a mounted, read-write file system might
25 result in a system disruption or the inability to restore files from the dump.
26 Consider using the \fBfssnap\fR(1M) command to create a file system snapshot if
27 you need a point-in-time image of a file system that is mounted.
30 If a filesystem was mounted with the logging option, it is strongly
31 recommended that you run \fBufsdump\fR as the root user. Running the command as
32 a non-root user might result in the creation of an inconsistent dump.
35 \fIoptions\fR is a single string of one-letter \fBufsdump\fR options.
38 \fIarguments\fR may be multiple strings whose association with the options is
39 determined by order. That is, the first argument goes with the first option
40 that takes an argument; the second argument goes with the second option that
41 takes an argument, and so on.
44 \fIfiles_to_dump\fR is required and must be the last argument on the command
45 line. See \fBOPERANDS\fR for more information.
48 With most devices \fBufsdump\fR can automatically detect the end-of-media.
49 Consequently, the \fBd\fR, \fBs\fR, and \fBt\fR options are not necessary for
50 multi-volume dumps, unless \fBufsdump\fR does not understand the way the device
51 detects the end-of-media, or the files are to be restored on a system with an
52 older version of the \fBrestore\fR command.
55 The following options are supported:
63 The "dump level." All files specified by \fIfiles_to_dump\fR that have been
64 modified since the last \fBufsdump\fR at a lower dump level are copied to the
65 \fIdump_file\fR destination (normally a magnetic tape device). For instance, if
66 a "level \fB2\fR" dump was done on Monday, followed by a "level \fB4\fR" dump
67 on Tuesday, a subsequent "level \fB3\fR" dump on Wednesday would contain all
68 files modified or added since the "level \fB2\fR" (Monday) backup. A "level
69 \fB0\fR" dump copies the entire file system to the \fIdump_file\fR.
75 \fB\fBa\fR \fIarchive_file\fR\fR
79 Archive file. Archive a dump table-of-contents in the specified
80 \fIarchive_file\fR to be used by \fBufsrestore\fR(1M) to determine whether a
81 file is in the dump file that is being restored.
87 \fB\fBb\fR \fIfactor\fR\fR
91 Blocking factor. Specify the blocking factor for tape writes. The default is 20
92 blocks per write for tapes of density less than 6250BPI (bytes-per-inch). The
93 default blocking factor for tapes of density 6250BPI and greater is 64. The
94 default blocking factor for cartridge tapes (\fBc\fR option) is 126. The
95 highest blocking factor available with most tape drives is 126. Note: the
96 blocking factor is specified in terms of 512-byte blocks, for compatibility
107 Cartridge. Set the defaults for cartridge instead of the standard half-inch
108 reel. This sets the density to 1000BPI and the blocking factor to 126. Since
109 \fBufsdump\fR can automatically detect the end-of-media, only the blocking
110 parameter normally has an effect. When cartridge tapes are used, and this
111 option is \fInot\fR specified, \fBufsdump\fR will slightly miscompute the size
112 of the tape. If the \fBb\fR, \fBd\fR, \fBs\fR or \fBt\fR options are specified
113 with this option, their values will override the defaults set by this option.
119 \fB\fBd\fR \fIbpi\fR\fR
123 Tape density. Not normally required, as \fBufsdump\fR can detect end-of-media.
124 This parameter can be used to keep a running tab on the amount of tape used per
125 reel. The default density is 6250BPI except when the \fBc\fR option is used for
126 cartridge tape, in which case it is assumed to be 1000BPI per track. Typical
127 values for tape devices are:
141 \fB1/4 inch cartridge\fR
145 1000 BPI The tape densities and other options are documented in the
146 \fBst\fR(7D) man page.
158 Diskette. Dump to diskette.
164 \fB\fBf\fR \fIdump_file\fR\fR
168 Dump file. Use \fIdump_file\fR as the file to dump to, instead of
169 \fB/dev/rmt/0\fR. If \fIdump_file\fR is specified as \fB\(mi\fR, dump to
179 Autoload. When the end-of-tape is reached before the dump is complete, take the
180 drive offline and wait up to two minutes for the tape drive to be ready again.
181 This gives autoloading (stackloader) tape drives a chance to load a new tape.
182 If the drive is ready within two minutes, continue. If it is not, prompt for
183 another tape and wait.
189 \fB\fBL\fR \fIstring\fR\fR
193 Sets the tape label to \fIstring\fR, instead of the default \fBnone\fR.
194 \fIstring\fR may be no more than sixteen characters long. If it is longer, it
195 is truncated and a warning printed; the dump will still be done. The tape label
196 is specific to the \fBufsdump\fR tape format, and bears no resemblance to
197 \fBIBM\fR or \fBANSI\fR-standard tape labels.
207 Notify all operators in the \fBsys\fR group that \fBufsdump\fR requires
208 attention by sending messages to their terminals, in a manner similar to that
209 used by the \fBwall\fR(1M) command. Otherwise, such messages are sent only to
210 the terminals (such as the console) on which the user running \fBufsdump\fR is
217 \fB\fBN\fR \fIdevice_name\fR\fR
221 Use \fIdevice_name\fR when recording information in \fB/etc/dumpdates\fR (see
222 the \fBu\fR option) and when comparing against information in
223 \fB/etc/dumpdates\fR for incremental dumps. The \fIdevice_name\fR provided can
224 contain no white space as defined in \fBscanf\fR(3C) and is case-sensitive.
234 Offline. Take the drive offline when the dump is complete or the end-of-media
235 is reached and rewind the tape, or eject the diskette. In the case of some
236 autoloading 8mm drives, the tape is removed from the drive automatically. This
237 prevents another process which rushes in to use the drive, from inadvertently
238 overwriting the media.
244 \fB\fBs\fR \fIsize\fR\fR
248 Specify the \fIsize\fR of the volume being dumped to. Not normally required, as
249 \fBufsdump\fR can detect end-of-media. When the specified size is reached,
250 \fBufsdump\fR waits for you to change the volume. \fBufsdump\fR interprets the
251 specified size as the length in feet for tapes and cartridges, and as the
252 number of 1024-byte blocks for diskettes. The values should be a little smaller
253 than the actual physical size of the media (for example, 425 for a 450-foot
254 cartridge). Typical values for tape devices depend on the \fBc\fR option, for
255 cartridge devices, and the \fBD\fR option for diskettes:
269 \fB60-Mbyte 1/4 inch cartridge\fR
279 \fB150-Mbyte 1/4 inch cartridge\fR
293 1422 blocks (Corresponds to a 1.44-Mbyte diskette, with one cylinder reserved
294 for bad block information.)
306 Size estimate. Determine the amount of space that is needed to perform the dump
307 without actually doing it, and display the estimated number of bytes it will
308 take. This is useful with incremental dumps to determine how many volumes of
309 media will be needed.
315 \fB\fBt\fR \fItracks\fR\fR
319 Specify the number of tracks for a cartridge tape. Not normally required, as
320 \fBufsdump\fR can detect end-of-media. The default is 9 tracks. The \fBt\fR
321 option is not compatible with the \fBD\fR option. Values for Sun-supported tape
326 \fB60-Mbyte 1/4 inch cartridge\fR
336 \fB150-Mbyte 1/4 inch cartridge\fR
348 \fB\fBT\fR \fItime_wait\fR\fB[hms]\fR\fR
352 Sets the amount of time to wait for an \fBautoload\fR command to complete. This
353 option is ignored unless the \fBl\fR option has also been specified. The
354 default time period to wait is two minutes. Specify time units with a trailing
355 \fBh\fR ( for hours), \fBm\fR (for minutes), or \fBs\fR (for seconds). The
356 default unit is minutes.
366 Update the dump record. Add an entry to the file \fB/etc/dumpdates,\fR for each
367 file system successfully dumped that includes the file system name (or
368 \fIdevice_name\fR as specified with the \fBN\fR option), date, and dump level.
378 Verify. After each tape or diskette is written, verify the contents of the
379 media against the source file system. If any discrepancies occur, prompt for
380 new media, then repeat the dump/verification process. The file system
381 \fImust\fR be unmounted. This option cannot be used to verify a dump to
392 Warning. List the file systems that have not been backed up within a day. This
393 information is gleaned from the files \fB/etc/dumpdates\fR and
394 \fB/etc/vfstab\fR. When the \fBw\fR option is used, all other options are
395 ignored. After reporting, \fBufsdump\fR exits immediately.
405 Warning with highlight. Similar to the \fBw\fR option, except that the \fBW\fR
406 option includes all file systems that appear in \fB/etc/dumpdates\fR, along
407 with information about their most recent dump dates and levels. File systems
408 that have not been backed up within a day are highlighted.
413 The following operand is supported:
417 \fB\fIfiles_to_dump\fR\fR
421 Specifies the files to dump. Usually it identifies a whole file system by its
422 raw device name (for example, \fB/dev/rdsk/c0t3d0s6\fR). Incremental dumps
423 (levels \fB1\fR to \fB9\fR) of files changed after a certain date only apply to
424 a whole file system. Alternatively, \fIfiles_to_dump\fR can identify individual
425 files or directories. All named directories that may be examined by the user
426 running \fBufsdump\fR, as well as any explicitly-named files, are dumped. This
427 dump is equivalent to a level \fB0\fR dump of the indicated portions of the
428 filesystem, except that \fB/etc/dumpdates\fR is not updated even if the
429 \fB-u\fR option has been specified. In all cases, the files must be contained
430 in the same file system, and the file system must be local to the system where
431 \fBufsdump\fR is being run.
433 \fIfiles_to_dump\fR is required and must be the last argument on the command
439 If no \fIoptions\fR are given, the default is \fB9uf\fR \fB/dev/rmt/0\fR
443 See \fBlargefile\fR(5) for the description of the behavior of \fBufsdump\fR
444 when encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
447 \fBExample 1 \fRUsing \fBufsdump\fR
450 The following command makes a full dump of a root file system on \fBc0t3d0\fR,
451 on a 150-MByte cartridge tape unit \fB0\fR:
456 example# ufsdump 0cfu /dev/rmt/0 /dev/rdsk/c0t3d0s0
463 The following command makes and verifies an incremental dump at level \fB5\fR
464 of the \fBusr\fR partition of \fBc0t3d0\fR, on a 1/2 inch reel tape unit
470 example# ufsdump 5fuv /dev/rmt/1 /dev/rdsk/c0t3d0s6
477 While running, \fBufsdump\fR emits many verbose messages. \fBufsdump\fR returns
478 the following exit values:
496 Startup errors encountered.
506 Abort \(mi no checkpoint attempted.
512 \fB\fB/dev/rmt/0\fR\fR
516 default unit to dump to
522 \fB\fB/etc/dumpdates\fR\fR
532 \fB\fB/etc/group\fR\fR
536 to find group \fBsys\fR
542 \fB\fB/etc/vfstab\fR\fR
551 \fBcpio\fR(1), \fBtar\fR(1), \fBdd\fR(1M), \fBdevnm\fR(1M), \fBfssnap\fR(1M),
552 \fBprtvtoc\fR(1M), \fBrmt\fR(1M), \fBshutdown\fR(1M), \fBufsrestore\fR(1M),
553 \fBvolcopy\fR(1M), \fBwall\fR(1M), \fBscanf\fR(3C), \fBufsdump\fR(4),
554 \fBattributes\fR(5), \fBlargefile\fR(5), \fBst\fR(7D)
558 Fewer than 32 read errors on the file system are ignored.
559 .SS "Process Per Reel"
561 Because each reel requires a new process, parent processes for reels that are
562 already written hang around until the entire tape is written.
563 .SS "Operator Intervention"
565 \fBufsdump\fR requires operator intervention on these conditions: end of
566 volume, end of dump, volume write error, volume open error or disk read error
567 (if there are more than a threshold of 32). In addition to alerting all
568 operators implied by the \fBn\fR option, \fBufsdump\fR interacts with the
569 operator on \fBufsdump\fR's control terminal at times when \fBufsdump\fR can no
570 longer proceed, or if something is grossly wrong. All questions \fBufsdump\fR
571 poses \fImust\fR be answered by typing \fByes\fR or \fBno\fR, as appropriate.
574 Since backing up a disk can involve a lot of time and effort, \fBufsdump\fR
575 checkpoints at the start of each volume. If writing that volume fails for some
576 reason, \fBufsdump\fR will, with operator permission, restart itself from the
577 checkpoint after a defective volume has been replaced.
578 .SS "Suggested Dump Schedule"
580 It is vital to perform full, "level \fB0\fR", dumps at regular intervals. When
581 performing a full dump, bring the machine down to single-user mode using
582 \fBshutdown\fR(1M). While preparing for a full dump, it is a good idea to clean
583 the tape drive and heads. Incremental dumps should be performed with the system
584 running in single-user mode.
587 Incremental dumps allow for convenient backup and recovery of active files on a
588 more frequent basis, with a minimum of media and time. However, there are some
589 tradeoffs. First, the interval between backups should be kept to a minimum
590 (once a day at least). To guard against data loss as a result of a media
591 failure (a rare, but possible occurrence), capture active files on (at least)
592 two sets of dump volumes. Another consideration is the desire to keep
593 unnecessary duplication of files to a minimum to save both operator time and
594 media storage. A third consideration is the ease with which a particular
595 backed-up version of a file can be located and restored. The following
596 four-week schedule offers a reasonable tradeoff between these goals.
600 Sun Mon Tue Wed Thu Fri
601 Week 1: Full 5 5 5 5 3
611 Although the Tuesday through Friday incrementals contain "extra copies" of
612 files from Monday, this scheme assures that any file modified during the week
613 can be recovered from the previous day's incremental dump.
614 .SS "Process Priority of ufsdump"
616 \fBufsdump\fR uses multiple processes to allow it to read from the disk and
617 write to the media concurrently. Due to the way it synchronizes between these
618 processes, any attempt to run dump with a \fBnice\fR (process priority) of
619 `\(mi5' or better will likely make \fBufsdump\fR run \fIslower\fR instead of
621 .SS "Overlapping Partitions"
623 Most disks contain one or more overlapping slices because slice 2 covers the
624 entire disk. The other slices are of various sizes and usually do not overlap.
625 For example, a common configuration places \fBroot\fR on slice 0, \fBswap\fR on
626 slice 1, \fB/opt\fR on slice 5 and \fB/usr\fR on slice 6.
629 It should be emphasized that \fBufsdump\fR dumps one \fBufs\fR file system at a
630 time. Given the above scenario where slice 0 and slice 2 have the same starting
631 offset, executing \fBufsdump\fR on slice 2 with the intent of dumping the
632 entire disk would instead dump only the \fBroot\fR file system on slice 0. To
633 dump the entire disk, the user must dump the file systems on each slice
637 The \fB/etc/vfstab\fR file does not allow the desired frequency of backup for
638 file systems to be specified (as \fB/etc/fstab\fR did). Consequently, the
639 \fBw\fR and \fBW\fR options assume file systems should be backed up daily,
640 which limits the usefulness of these options.