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
172 If the name of the file is of the form \fImachine\fR\fB:\fR\fIdevice,\fR the
173 dump is done from the specified machine over the network using \fBrmt\fR(1M).
174 Since \fBufsdump\fR is normally run by root, the name of the local machine must
175 appear in the \fB/.rhosts\fR file of the remote machine. If the file is
176 specified as \fIuser\fR\fB@\fR\fImachine\fR\fB:\fR\fIdevice,\fR \fBufsdump\fR
177 will attempt to execute as the specified user on the remote machine. The
178 specified user must have a \fB\&.rhosts\fR file on the remote machine that
179 allows the user invoking the command from the local machine to access the
190 Autoload. When the end-of-tape is reached before the dump is complete, take the
191 drive offline and wait up to two minutes for the tape drive to be ready again.
192 This gives autoloading (stackloader) tape drives a chance to load a new tape.
193 If the drive is ready within two minutes, continue. If it is not, prompt for
194 another tape and wait.
200 \fB\fBL\fR \fIstring\fR\fR
204 Sets the tape label to \fIstring\fR, instead of the default \fBnone\fR.
205 \fIstring\fR may be no more than sixteen characters long. If it is longer, it
206 is truncated and a warning printed; the dump will still be done. The tape label
207 is specific to the \fBufsdump\fR tape format, and bears no resemblance to
208 \fBIBM\fR or \fBANSI\fR-standard tape labels.
218 Notify all operators in the \fBsys\fR group that \fBufsdump\fR requires
219 attention by sending messages to their terminals, in a manner similar to that
220 used by the \fBwall\fR(1M) command. Otherwise, such messages are sent only to
221 the terminals (such as the console) on which the user running \fBufsdump\fR is
228 \fB\fBN\fR \fIdevice_name\fR\fR
232 Use \fIdevice_name\fR when recording information in \fB/etc/dumpdates\fR (see
233 the \fBu\fR option) and when comparing against information in
234 \fB/etc/dumpdates\fR for incremental dumps. The \fIdevice_name\fR provided can
235 contain no white space as defined in \fBscanf\fR(3C) and is case-sensitive.
245 Offline. Take the drive offline when the dump is complete or the end-of-media
246 is reached and rewind the tape, or eject the diskette. In the case of some
247 autoloading 8mm drives, the tape is removed from the drive automatically. This
248 prevents another process which rushes in to use the drive, from inadvertently
249 overwriting the media.
255 \fB\fBs\fR \fIsize\fR\fR
259 Specify the \fIsize\fR of the volume being dumped to. Not normally required, as
260 \fBufsdump\fR can detect end-of-media. When the specified size is reached,
261 \fBufsdump\fR waits for you to change the volume. \fBufsdump\fR interprets the
262 specified size as the length in feet for tapes and cartridges, and as the
263 number of 1024-byte blocks for diskettes. The values should be a little smaller
264 than the actual physical size of the media (for example, 425 for a 450-foot
265 cartridge). Typical values for tape devices depend on the \fBc\fR option, for
266 cartridge devices, and the \fBD\fR option for diskettes:
280 \fB60-Mbyte 1/4 inch cartridge\fR
290 \fB150-Mbyte 1/4 inch cartridge\fR
304 1422 blocks (Corresponds to a 1.44-Mbyte diskette, with one cylinder reserved
305 for bad block information.)
317 Size estimate. Determine the amount of space that is needed to perform the dump
318 without actually doing it, and display the estimated number of bytes it will
319 take. This is useful with incremental dumps to determine how many volumes of
320 media will be needed.
326 \fB\fBt\fR \fItracks\fR\fR
330 Specify the number of tracks for a cartridge tape. Not normally required, as
331 \fBufsdump\fR can detect end-of-media. The default is 9 tracks. The \fBt\fR
332 option is not compatible with the \fBD\fR option. Values for Sun-supported tape
337 \fB60-Mbyte 1/4 inch cartridge\fR
347 \fB150-Mbyte 1/4 inch cartridge\fR
359 \fB\fBT\fR \fItime_wait\fR\fB[hms]\fR\fR
363 Sets the amount of time to wait for an \fBautoload\fR command to complete. This
364 option is ignored unless the \fBl\fR option has also been specified. The
365 default time period to wait is two minutes. Specify time units with a trailing
366 \fBh\fR ( for hours), \fBm\fR (for minutes), or \fBs\fR (for seconds). The
367 default unit is minutes.
377 Update the dump record. Add an entry to the file \fB/etc/dumpdates,\fR for each
378 file system successfully dumped that includes the file system name (or
379 \fIdevice_name\fR as specified with the \fBN\fR option), date, and dump level.
389 Verify. After each tape or diskette is written, verify the contents of the
390 media against the source file system. If any discrepancies occur, prompt for
391 new media, then repeat the dump/verification process. The file system
392 \fImust\fR be unmounted. This option cannot be used to verify a dump to
403 Warning. List the file systems that have not been backed up within a day. This
404 information is gleaned from the files \fB/etc/dumpdates\fR and
405 \fB/etc/vfstab\fR. When the \fBw\fR option is used, all other options are
406 ignored. After reporting, \fBufsdump\fR exits immediately.
416 Warning with highlight. Similar to the \fBw\fR option, except that the \fBW\fR
417 option includes all file systems that appear in \fB/etc/dumpdates\fR, along
418 with information about their most recent dump dates and levels. File systems
419 that have not been backed up within a day are highlighted.
424 The following operand is supported:
428 \fB\fIfiles_to_dump\fR\fR
432 Specifies the files to dump. Usually it identifies a whole file system by its
433 raw device name (for example, \fB/dev/rdsk/c0t3d0s6\fR). Incremental dumps
434 (levels \fB1\fR to \fB9\fR) of files changed after a certain date only apply to
435 a whole file system. Alternatively, \fIfiles_to_dump\fR can identify individual
436 files or directories. All named directories that may be examined by the user
437 running \fBufsdump\fR, as well as any explicitly-named files, are dumped. This
438 dump is equivalent to a level \fB0\fR dump of the indicated portions of the
439 filesystem, except that \fB/etc/dumpdates\fR is not updated even if the
440 \fB-u\fR option has been specified. In all cases, the files must be contained
441 in the same file system, and the file system must be local to the system where
442 \fBufsdump\fR is being run.
444 \fIfiles_to_dump\fR is required and must be the last argument on the command
450 If no \fIoptions\fR are given, the default is \fB9uf\fR \fB/dev/rmt/0\fR
454 See \fBlargefile\fR(5) for the description of the behavior of \fBufsdump\fR
455 when encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
458 \fBExample 1 \fRUsing \fBufsdump\fR
461 The following command makes a full dump of a root file system on \fBc0t3d0\fR,
462 on a 150-MByte cartridge tape unit \fB0\fR:
467 example# ufsdump 0cfu /dev/rmt/0 /dev/rdsk/c0t3d0s0
474 The following command makes and verifies an incremental dump at level \fB5\fR
475 of the \fBusr\fR partition of \fBc0t3d0\fR, on a 1/2 inch reel tape unit
481 example# ufsdump 5fuv /dev/rmt/1 /dev/rdsk/c0t3d0s6
488 While running, \fBufsdump\fR emits many verbose messages. \fBufsdump\fR returns
489 the following exit values:
507 Startup errors encountered.
517 Abort \(mi no checkpoint attempted.
523 \fB\fB/dev/rmt/0\fR\fR
527 default unit to dump to
533 \fB\fB/etc/dumpdates\fR\fR
543 \fB\fB/etc/group\fR\fR
547 to find group \fBsys\fR
553 \fB\fB/etc/hosts\fR\fR
557 to gain access to remote system with drive
563 \fB\fB/etc/vfstab\fR\fR
572 \fBcpio\fR(1), \fBtar\fR(1), \fBdd\fR(1M), \fBdevnm\fR(1M), \fBfssnap\fR(1M),
573 \fBprtvtoc\fR(1M), \fBrmt\fR(1M), \fBshutdown\fR(1M), \fBufsrestore\fR(1M),
574 \fBvolcopy\fR(1M), \fBwall\fR(1M), \fBscanf\fR(3C), \fBufsdump\fR(4),
575 \fBattributes\fR(5), \fBlargefile\fR(5), \fBst\fR(7D)
579 Fewer than 32 read errors on the file system are ignored.
580 .SS "Process Per Reel"
582 Because each reel requires a new process, parent processes for reels that are
583 already written hang around until the entire tape is written.
584 .SS "Operator Intervention"
586 \fBufsdump\fR requires operator intervention on these conditions: end of
587 volume, end of dump, volume write error, volume open error or disk read error
588 (if there are more than a threshold of 32). In addition to alerting all
589 operators implied by the \fBn\fR option, \fBufsdump\fR interacts with the
590 operator on \fBufsdump\fR's control terminal at times when \fBufsdump\fR can no
591 longer proceed, or if something is grossly wrong. All questions \fBufsdump\fR
592 poses \fImust\fR be answered by typing \fByes\fR or \fBno\fR, as appropriate.
595 Since backing up a disk can involve a lot of time and effort, \fBufsdump\fR
596 checkpoints at the start of each volume. If writing that volume fails for some
597 reason, \fBufsdump\fR will, with operator permission, restart itself from the
598 checkpoint after a defective volume has been replaced.
599 .SS "Suggested Dump Schedule"
601 It is vital to perform full, "level \fB0\fR", dumps at regular intervals. When
602 performing a full dump, bring the machine down to single-user mode using
603 \fBshutdown\fR(1M). While preparing for a full dump, it is a good idea to clean
604 the tape drive and heads. Incremental dumps should be performed with the system
605 running in single-user mode.
608 Incremental dumps allow for convenient backup and recovery of active files on a
609 more frequent basis, with a minimum of media and time. However, there are some
610 tradeoffs. First, the interval between backups should be kept to a minimum
611 (once a day at least). To guard against data loss as a result of a media
612 failure (a rare, but possible occurrence), capture active files on (at least)
613 two sets of dump volumes. Another consideration is the desire to keep
614 unnecessary duplication of files to a minimum to save both operator time and
615 media storage. A third consideration is the ease with which a particular
616 backed-up version of a file can be located and restored. The following
617 four-week schedule offers a reasonable tradeoff between these goals.
621 Sun Mon Tue Wed Thu Fri
622 Week 1: Full 5 5 5 5 3
632 Although the Tuesday through Friday incrementals contain "extra copies" of
633 files from Monday, this scheme assures that any file modified during the week
634 can be recovered from the previous day's incremental dump.
635 .SS "Process Priority of ufsdump"
637 \fBufsdump\fR uses multiple processes to allow it to read from the disk and
638 write to the media concurrently. Due to the way it synchronizes between these
639 processes, any attempt to run dump with a \fBnice\fR (process priority) of
640 `\(mi5' or better will likely make \fBufsdump\fR run \fIslower\fR instead of
642 .SS "Overlapping Partitions"
644 Most disks contain one or more overlapping slices because slice 2 covers the
645 entire disk. The other slices are of various sizes and usually do not overlap.
646 For example, a common configuration places \fBroot\fR on slice 0, \fBswap\fR on
647 slice 1, \fB/opt\fR on slice 5 and \fB/usr\fR on slice 6.
650 It should be emphasized that \fBufsdump\fR dumps one \fBufs\fR file system at a
651 time. Given the above scenario where slice 0 and slice 2 have the same starting
652 offset, executing \fBufsdump\fR on slice 2 with the intent of dumping the
653 entire disk would instead dump only the \fBroot\fR file system on slice 0. To
654 dump the entire disk, the user must dump the file systems on each slice
658 The \fB/etc/vfstab\fR file does not allow the desired frequency of backup for
659 file systems to be specified (as \fB/etc/fstab\fR did). Consequently, the
660 \fBw\fR and \fBW\fR options assume file systems should be backed up daily,
661 which limits the usefulness of these options.