6253 F_GETLK doesn't always return lock owner
[illumos-gate.git] / usr / src / man / man1m / ufsdump.1m
blob85edc0e155a01e0f8f5665a3c29814946618dd51
1 '\" te
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 "Mar 17, 2008"
8 .SH NAME
9 ufsdump \- incremental file system dump
10 .SH SYNOPSIS
11 .LP
12 .nf
13 \fB/usr/sbin/ufsdump\fR [\fIoptions\fR] [\fIarguments\fR] \fIfiles_to_dump\fR
14 .fi
16 .SH DESCRIPTION
17 .sp
18 .LP
19 \fBufsdump\fR backs up all files specified by \fIfiles_to_dump\fR (usually
20 either a whole file system or files within a file sytem changed after a certain
21 date) to magnetic tape, diskette, or disk file.
22 .sp
23 .LP
24 The \fBufsdump\fR command can only be used on unmounted file systems, or those
25 mounted read-only. Attempting to dump a mounted, read-write file system might
26 result in a system disruption or the inability to restore files from the dump.
27 Consider using the \fBfssnap\fR(1M) command to create a file system snapshot if
28 you need a point-in-time image of a file system that is mounted.
29 .sp
30 .LP
31 If a filesystem was mounted with the logging option, it is strongly
32 recommended that you run \fBufsdump\fR as the root user. Running the command as
33 a non-root user might result in the creation of an inconsistent dump.
34 .sp
35 .LP
36 \fIoptions\fR is a single string of one-letter \fBufsdump\fR options.
37 .sp
38 .LP
39 \fIarguments\fR may be multiple strings whose association with the options is
40 determined by order. That is, the first argument goes with the first option
41 that takes an argument; the second argument goes with the second option that
42 takes an argument, and so on.
43 .sp
44 .LP
45 \fIfiles_to_dump\fR is required and must be the last argument on the command
46 line. See \fBOPERANDS\fR for more information.
47 .sp
48 .LP
49 With most devices \fBufsdump\fR can automatically detect the end-of-media.
50 Consequently, the \fBd\fR, \fBs\fR, and \fBt\fR options are not necessary for
51 multi-volume dumps, unless \fBufsdump\fR does not understand the way the device
52 detects the end-of-media, or the files are to be restored on a system with an
53 older version of the \fBrestore\fR command.
54 .SH OPTIONS
55 .sp
56 .LP
57 The following options are supported:
58 .sp
59 .ne 2
60 .na
61 \fB\fB0\(mi9\fR\fR
62 .ad
63 .sp .6
64 .RS 4n
65 The "dump level." All files specified by \fIfiles_to_dump\fR that have been
66 modified since the last \fBufsdump\fR at a lower dump level are copied to the
67 \fIdump_file\fR destination (normally a magnetic tape device). For instance, if
68 a "level \fB2\fR" dump was done on Monday, followed by a "level \fB4\fR" dump
69 on Tuesday, a subsequent "level \fB3\fR" dump on Wednesday would contain all
70 files modified or added since the "level \fB2\fR" (Monday) backup. A "level
71 \fB0\fR" dump copies the entire file system to the \fIdump_file\fR.
72 .RE
74 .sp
75 .ne 2
76 .na
77 \fB\fBa\fR \fIarchive_file\fR\fR
78 .ad
79 .sp .6
80 .RS 4n
81 Archive file. Archive a dump table-of-contents in the specified
82 \fIarchive_file\fR to be used by \fBufsrestore\fR(1M) to determine whether a
83 file is in the dump file that is being restored.
84 .RE
86 .sp
87 .ne 2
88 .na
89 \fB\fBb\fR \fIfactor\fR\fR
90 .ad
91 .sp .6
92 .RS 4n
93 Blocking factor. Specify the blocking factor for tape writes. The default is 20
94 blocks per write for tapes of density less than 6250BPI (bytes-per-inch). The
95 default blocking factor for tapes of density 6250BPI and greater is 64. The
96 default blocking factor for cartridge tapes (\fBc\fR option) is 126. The
97 highest blocking factor available with most tape drives is 126. Note: the
98 blocking factor is specified in terms of 512-byte blocks, for compatibility
99 with \fBtar\fR(1).
103 .ne 2
105 \fB\fBc\fR\fR
107 .sp .6
108 .RS 4n
109 Cartridge. Set the defaults for cartridge instead of the standard half-inch
110 reel. This sets the density to 1000BPI and the blocking factor to 126. Since
111 \fBufsdump\fR can automatically detect the end-of-media, only the blocking
112 parameter normally has an effect. When cartridge tapes are used, and this
113 option is \fInot\fR specified, \fBufsdump\fR will slightly miscompute the size
114 of the tape. If the \fBb\fR, \fBd\fR, \fBs\fR or \fBt\fR options are specified
115 with this option, their values will override the defaults set by this option.
119 .ne 2
121 \fB\fBd\fR \fIbpi\fR\fR
123 .sp .6
124 .RS 4n
125 Tape density. Not normally required, as \fBufsdump\fR can detect end-of-media.
126 This parameter can be used to keep a running tab on the amount of tape used per
127 reel. The default density is 6250BPI except when the \fBc\fR option is used for
128 cartridge tape, in which case it is assumed to be 1000BPI per track. Typical
129 values for tape devices are:
131 .ne 2
133 \fB1/2 inch tape\fR
135 .sp .6
136 .RS 4n
137 6250 BPI
141 .ne 2
143 \fB1/4 inch cartridge\fR
145 .sp .6
146 .RS 4n
147 1000 BPI The tape densities and other options are documented in the
148 \fBst\fR(7D) man page.
154 .ne 2
156 \fB\fBD\fR\fR
158 .sp .6
159 .RS 4n
160 Diskette. Dump to diskette.
164 .ne 2
166 \fB\fBf\fR \fIdump_file\fR\fR
168 .sp .6
169 .RS 4n
170 Dump file. Use \fIdump_file\fR as the file to dump to, instead of
171 \fB/dev/rmt/0\fR. If \fIdump_file\fR is specified as \fB\(mi\fR, dump to
172 standard output.
174 If the name of the file is of the form \fImachine\fR\fB:\fR\fIdevice,\fR the
175 dump is done from the specified machine over the network using \fBrmt\fR(1M).
176 Since \fBufsdump\fR is normally run by root, the name of the local machine must
177 appear in the \fB/.rhosts\fR file of the remote machine. If the file is
178 specified as \fIuser\fR\fB@\fR\fImachine\fR\fB:\fR\fIdevice,\fR \fBufsdump\fR
179 will attempt to execute as the specified user on the remote machine. The
180 specified user must have a \fB\&.rhosts\fR file on the remote machine that
181 allows the user invoking the command from the local machine to access the
182 remote machine.
186 .ne 2
188 \fB\fBl\fR\fR
190 .sp .6
191 .RS 4n
192 Autoload. When the end-of-tape is reached before the dump is complete, take the
193 drive offline and wait up to two minutes for the tape drive to be ready again.
194 This gives autoloading (stackloader) tape drives a chance to load a new tape.
195 If the drive is ready within two minutes, continue. If it is not, prompt for
196 another tape and wait.
200 .ne 2
202 \fB\fBL\fR \fIstring\fR\fR
204 .sp .6
205 .RS 4n
206 Sets the tape label to \fIstring\fR, instead of the default \fBnone\fR.
207 \fIstring\fR may be no more than sixteen characters long. If it is longer, it
208 is truncated and a warning printed; the dump will still be done. The tape label
209 is specific to the \fBufsdump\fR tape format, and bears no resemblance to
210 \fBIBM\fR or \fBANSI\fR-standard tape labels.
214 .ne 2
216 \fB\fBn\fR\fR
218 .sp .6
219 .RS 4n
220 Notify all operators in the \fBsys\fR group that \fBufsdump\fR requires
221 attention by sending messages to their terminals, in a manner similar to that
222 used by the \fBwall\fR(1M) command. Otherwise, such messages are sent only to
223 the terminals (such as the console) on which the user running \fBufsdump\fR is
224 logged in.
228 .ne 2
230 \fB\fBN\fR \fIdevice_name\fR\fR
232 .sp .6
233 .RS 4n
234 Use \fIdevice_name\fR when recording information in \fB/etc/dumpdates\fR (see
235 the \fBu\fR option) and when comparing against information in
236 \fB/etc/dumpdates\fR for incremental dumps. The \fIdevice_name\fR provided can
237 contain no white space as defined in \fBscanf\fR(3C) and is case-sensitive.
241 .ne 2
243 \fB\fBo\fR\fR
245 .sp .6
246 .RS 4n
247 Offline. Take the drive offline when the dump is complete or the end-of-media
248 is reached and rewind the tape, or eject the diskette. In the case of some
249 autoloading 8mm drives, the tape is removed from the drive automatically. This
250 prevents another process which rushes in to use the drive, from inadvertently
251 overwriting the media.
255 .ne 2
257 \fB\fBs\fR \fIsize\fR\fR
259 .sp .6
260 .RS 4n
261 Specify the \fIsize\fR of the volume being dumped to. Not normally required, as
262 \fBufsdump\fR can detect end-of-media. When the specified size is reached,
263 \fBufsdump\fR waits for you to change the volume. \fBufsdump\fR interprets the
264 specified size as the length in feet for tapes and cartridges, and as the
265 number of 1024-byte blocks for diskettes. The values should be a little smaller
266 than the actual physical size of the media (for example, 425 for a 450-foot
267 cartridge). Typical values for tape devices depend on the \fBc\fR option, for
268 cartridge devices, and the \fBD\fR option for diskettes:
270 .ne 2
272 \fB1/2 inch tape\fR
274 .sp .6
275 .RS 4n
276 2300 feet
280 .ne 2
282 \fB60-Mbyte 1/4 inch cartridge\fR
284 .sp .6
285 .RS 4n
286 425 feet
290 .ne 2
292 \fB150-Mbyte 1/4 inch cartridge\fR
294 .sp .6
295 .RS 4n
296 700 feet
300 .ne 2
302 \fBdiskette\fR
304 .sp .6
305 .RS 4n
306 1422 blocks (Corresponds to a 1.44-Mbyte diskette, with one cylinder reserved
307 for bad block information.)
313 .ne 2
315 \fB\fBS\fR\fR
317 .sp .6
318 .RS 4n
319 Size estimate. Determine the amount of space that is needed to perform the dump
320 without actually doing it, and display the estimated number of bytes it will
321 take. This is useful with incremental dumps to determine how many volumes of
322 media will be needed.
326 .ne 2
328 \fB\fBt\fR \fItracks\fR\fR
330 .sp .6
331 .RS 4n
332 Specify the number of tracks for a cartridge tape. Not normally required, as
333 \fBufsdump\fR can detect end-of-media. The default is 9 tracks. The \fBt\fR
334 option is not compatible with the \fBD\fR option. Values for Sun-supported tape
335 devices are:
337 .ne 2
339 \fB60-Mbyte 1/4 inch cartridge\fR
341 .sp .6
342 .RS 4n
343 9 tracks
347 .ne 2
349 \fB150-Mbyte 1/4 inch cartridge\fR
351 .sp .6
352 .RS 4n
353 18 tracks
359 .ne 2
361 \fB\fBT\fR \fItime_wait\fR\fB[hms]\fR\fR
363 .sp .6
364 .RS 4n
365 Sets the amount of time to wait for an \fBautoload\fR command to complete. This
366 option is ignored unless the \fBl\fR option has also been specified. The
367 default time period to wait is two minutes. Specify time units with a trailing
368 \fBh\fR ( for hours), \fBm\fR (for minutes), or \fBs\fR (for seconds). The
369 default unit is minutes.
373 .ne 2
375 \fB\fBu\fR\fR
377 .sp .6
378 .RS 4n
379 Update the dump record. Add an entry to the file \fB/etc/dumpdates,\fR for each
380 file system successfully dumped that includes the file system name (or
381 \fIdevice_name\fR as specified with the \fBN\fR option), date, and dump level.
385 .ne 2
387 \fB\fBv\fR\fR
389 .sp .6
390 .RS 4n
391 Verify. After each tape or diskette is written, verify the contents of the
392 media against the source file system. If any discrepancies occur, prompt for
393 new media, then repeat the dump/verification process. The file system
394 \fImust\fR be unmounted. This option cannot be used to verify a dump to
395 standard output.
399 .ne 2
401 \fB\fBw\fR\fR
403 .sp .6
404 .RS 4n
405 Warning. List the file systems that have not been backed up within a day. This
406 information is gleaned from the files \fB/etc/dumpdates\fR and
407 \fB/etc/vfstab\fR. When the \fBw\fR option is used, all other options are
408 ignored. After reporting, \fBufsdump\fR exits immediately.
412 .ne 2
414 \fB\fBW\fR\fR
416 .sp .6
417 .RS 4n
418 Warning with highlight. Similar to the \fBw\fR option, except that the \fBW\fR
419 option includes all file systems that appear in \fB/etc/dumpdates\fR, along
420 with information about their most recent dump dates and levels. File systems
421 that have not been backed up within a day are highlighted.
424 .SH OPERANDS
427 The following operand is supported:
429 .ne 2
431 \fB\fIfiles_to_dump\fR\fR
433 .sp .6
434 .RS 4n
435 Specifies the files to dump. Usually it identifies a whole file system by its
436 raw device name (for example, \fB/dev/rdsk/c0t3d0s6\fR). Incremental dumps
437 (levels \fB1\fR to \fB9\fR) of files changed after a certain date only apply to
438 a whole file system. Alternatively, \fIfiles_to_dump\fR can identify individual
439 files or directories. All named directories that may be examined by the user
440 running \fBufsdump\fR, as well as any explicitly-named files, are dumped. This
441 dump is equivalent to a level \fB0\fR dump of the indicated portions of the
442 filesystem, except that \fB/etc/dumpdates\fR is not updated even if the
443 \fB-u\fR option has been specified. In all cases, the files must be contained
444 in the same file system, and the file system must be local to the system where
445 \fBufsdump\fR is being run.
447 \fIfiles_to_dump\fR is required and must be the last argument on the command
448 line.
453 If no \fIoptions\fR are given, the default is \fB9uf\fR \fB/dev/rmt/0\fR
454 \fIfiles_to_dump\fR.
455 .SH USAGE
458 See \fBlargefile\fR(5) for the description of the behavior of \fBufsdump\fR
459 when encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
460 .SH EXAMPLES
462 \fBExample 1 \fRUsing \fBufsdump\fR
465 The following command makes a full dump of a root file system on \fBc0t3d0\fR,
466 on a 150-MByte cartridge tape unit \fB0\fR:
469 .in +2
471 example# ufsdump 0cfu /dev/rmt/0 /dev/rdsk/c0t3d0s0
473 .in -2
478 The following command makes and verifies an incremental dump at level \fB5\fR
479 of the \fBusr\fR partition of \fBc0t3d0\fR, on a 1/2 inch reel tape unit
480 \fB1,\fR:
483 .in +2
485 example# ufsdump 5fuv /dev/rmt/1 /dev/rdsk/c0t3d0s6
487 .in -2
490 .SH EXIT STATUS
493 While running, \fBufsdump\fR emits many verbose messages. \fBufsdump\fR returns
494 the following exit values:
496 .ne 2
498 \fB\fB0\fR\fR
500 .sp .6
501 .RS 4n
502 Normal exit.
506 .ne 2
508 \fB\fB1\fR\fR
510 .sp .6
511 .RS 4n
512 Startup errors encountered.
516 .ne 2
518 \fB\fB3\fR\fR
520 .sp .6
521 .RS 4n
522 Abort \(mi no checkpoint attempted.
525 .SH FILES
527 .ne 2
529 \fB\fB/dev/rmt/0\fR\fR
531 .sp .6
532 .RS 4n
533 default unit to dump to
537 .ne 2
539 \fB\fB/etc/dumpdates\fR\fR
541 .sp .6
542 .RS 4n
543 dump date record
547 .ne 2
549 \fB\fB/etc/group\fR\fR
551 .sp .6
552 .RS 4n
553 to find group \fBsys\fR
557 .ne 2
559 \fB\fB/etc/hosts\fR\fR
561 .sp .6
562 .RS 4n
563 to gain access to remote system with drive
567 .ne 2
569 \fB\fB/etc/vfstab\fR\fR
571 .sp .6
572 .RS 4n
573 list of file systems
576 .SH SEE ALSO
579 \fBcpio\fR(1), \fBtar\fR(1), \fBdd\fR(1M), \fBdevnm\fR(1M), \fBfssnap\fR(1M),
580 \fBprtvtoc\fR(1M), \fBrmt\fR(1M), \fBshutdown\fR(1M), \fBufsrestore\fR(1M),
581 \fBvolcopy\fR(1M), \fBwall\fR(1M), \fBscanf\fR(3C), \fBufsdump\fR(4),
582 \fBattributes\fR(5), \fBlargefile\fR(5), \fBst\fR(7D)
583 .SH NOTES
584 .SS "Read Errors"
587 Fewer than 32 read errors on the file system are ignored.
588 .SS "Process Per Reel"
591 Because each reel requires a new process, parent processes for reels that are
592 already written hang around until the entire tape is written.
593 .SS "Operator Intervention"
596 \fBufsdump\fR requires operator intervention on these conditions: end of
597 volume, end of dump, volume write error, volume open error or disk read error
598 (if there are more than a threshold of 32). In addition to alerting all
599 operators implied by the \fBn\fR option, \fBufsdump\fR interacts with the
600 operator on \fBufsdump\fR's control terminal at times when \fBufsdump\fR can no
601 longer proceed, or if something is grossly wrong. All questions \fBufsdump\fR
602 poses \fImust\fR be answered by typing \fByes\fR or \fBno\fR, as appropriate.
605 Since backing up a disk can involve a lot of time and effort, \fBufsdump\fR
606 checkpoints at the start of each volume. If writing that volume fails for some
607 reason, \fBufsdump\fR will, with operator permission, restart itself from the
608 checkpoint after a defective volume has been replaced.
609 .SS "Suggested Dump Schedule"
612 It is vital to perform full, "level \fB0\fR", dumps at regular intervals. When
613 performing a full dump, bring the machine down to single-user mode using
614 \fBshutdown\fR(1M). While preparing for a full dump, it is a good idea to clean
615 the tape drive and heads. Incremental dumps should be performed with the system
616 running in single-user mode.
619 Incremental dumps allow for convenient backup and recovery of active files on a
620 more frequent basis, with a minimum of media and time. However, there are some
621 tradeoffs. First, the interval between backups should be kept to a minimum
622 (once a day at least). To guard against data loss as a result of a media
623 failure (a rare, but possible occurrence), capture active files on (at least)
624 two sets of dump volumes. Another consideration is the desire to keep
625 unnecessary duplication of files to a minimum to save both operator time and
626 media storage. A third consideration is the ease with which a particular
627 backed-up version of a file can be located and restored. The following
628 four-week schedule offers a reasonable tradeoff between these goals.
630 .in +2
632               Sun    Mon    Tue    Wed    Thu    Fri
633     Week 1:   Full    5      5      5      5      3
634     Week 2:           5      5      5      5      3
635     Week 3:           5      5      5      5      3
636     Week 4:           5      5      5      5      3
638 .in -2
643 Although the Tuesday through Friday incrementals contain "extra copies" of
644 files from Monday, this scheme assures that any file modified during the week
645 can be recovered from the previous day's incremental dump.
646 .SS "Process Priority of ufsdump"
649 \fBufsdump\fR uses multiple processes to allow it to read from the disk and
650 write to the media concurrently. Due to the way it synchronizes between these
651 processes, any attempt to run dump with a \fBnice\fR (process priority) of
652 `\(mi5' or better will likely make \fBufsdump\fR run \fIslower\fR instead of
653 faster.
654 .SS "Overlapping Partitions"
657 Most disks contain one or more overlapping slices because slice 2 covers the
658 entire disk. The other slices are of various sizes and usually do not overlap.
659 For example, a common configuration places \fBroot\fR on slice 0, \fBswap\fR on
660 slice 1, \fB/opt\fR on slice 5 and \fB/usr\fR on slice 6.
663 It should be emphasized that \fBufsdump\fR dumps one \fBufs\fR file system at a
664 time. Given the above scenario where slice 0 and slice 2 have the same starting
665 offset, executing \fBufsdump\fR on slice 2 with the intent of dumping the
666 entire disk would instead dump only the \fBroot\fR file system on slice 0. To
667 dump the entire disk, the user must dump the file systems on each slice
668 separately.
669 .SH BUGS
672 The \fB/etc/vfstab\fR file does not allow the desired frequency of backup for
673 file systems to be specified (as \fB/etc/fstab\fR did). Consequently, the
674 \fBw\fR and \fBW\fR options assume file systems should be backed up daily,
675 which limits the usefulness of these options.