2 .\" Copyright (c) 1980 Regents of the University of California. All rights reserved. The Berkeley software License Agreement specifies the terms and conditions for redistribution. Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved.
3 .TH UFSDUMP 4 "Apr 9, 2003"
5 ufsdump, dumpdates \- incremental dump format
9 \fB#include <sys/types.h>\fR
14 \fB#include <sys/inode.h>\fR
19 \fB#include <protocols/dumprestore.h>\fR
30 Tapes used by \fBufsdump\fR(1M) and \fBufsrestore\fR(1M) contain:
41 two groups of bit map records
47 a group of records describing directories
53 a group of records describing files
57 The format of the header record and the format of the first record of each
58 description in the \fB<protocols/dumprestore.h>\fR include file are:
62 #define TP_BSIZE_MAX 65536
63 #define TP_BSIZE_MIN 1024
64 #define ESIZE_SHIFT_MAX 6
66 #ifdef SUPPORTS_MTB_TAPE_FORMAT
67 #define TP_BUFSIZE TP_BSIZE_MAX
70 #define TP_BUFSIZE TP_BSIZE
71 #endif /* SUPPORTS_MTB_TAPE_FORMAT */
74 #define HIGHDENSITYTREC 32
75 #define CARTRIDGETREC 63
76 #define TP_NINDIR (TP_BSIZE_MIN/2)
77 #define TP_NINOS (TP_NINDIR / sizeof (long))
81 #define OFS_MAGIC (int)60011
82 #define NFS_MAGIC (int)60012
83 #define MTB_MAGIC (int)60013
84 #define CHECKSUM (int)84446
92 char s_addrs[TP_NINDIR];
93 int32_t s_inos[TP_NINOS];
99 char c_filesys[NAMELEN];
101 char c_host[NAMELEN];
107 char dummy[TP_BUFSIZE];
117 struct dinode c_dinode;
120 char c_label[LBLSIZE];
121 union u_shadow c_shadow;
124 #ifdef SUPPORTS_MTB_TAPE_FORMAT
129 #endif /* SUPPORTS_MTB_TAPE_FORMAT */
146 struct dinode c_dinode;
149 char c_label[LBLSIZE];
150 union u_shadow c_shadow;
153 #ifdef SUPPORTS_MTB_TAPE_FORMAT
159 SUPPORTS_MTB_TAPE_FORMAT */
168 #define spcl u_spcl.s_spcl
169 #define c_addr c_data.s_addrs
170 #define c_inos c_data.s_inos
171 #define c_level c_shadow.c_nonsh.c_level
172 #define c_filesys c_shadow.c_nonsh.c_filesys
173 #define c_dev c_shadow.c_nonsh.c_dev
174 #define c_host c_shadow.c_nonsh.c_host
189 #define DR_NEWHEADER 1
190 #define DR_INODEINFO 2
193 #define DR_HASMETA 16
199 This header describes three formats for the \fBufsdump\fR/\fBufsrestore\fR
205 An old format, non-MTB, that supports dump sizes of less than 2 terabytes. This
206 format is represented by \fBNFS_MAGIC\fR.
212 A new format, MTB, that supports dump sizes of greater than 2 terabytes using a
213 variable block size and 2 new constants: \fBTP_BSIZE_MIN\fR and
214 \fBTP_BSIZE_MAX\fR. This format is represented by \fBMTB_MAGIC\fR.
220 A much older format that might be found on existing backup tapes. The
221 \fBufsrestore\fR command can restore tapes of this format, but no longer
222 generates tapes of this format. Backups in this format have the \fBOFS_MAGIC\fR
223 magic number in their tape headers.
227 The constants are described as follows:
234 Size of file blocks on the dump tapes for the old format. Note that
235 \fBTP_BSIZE\fR must be a multiple of \fBDEV_BSIZE\fR This is applicable for
236 dumps of type \fBNFS_MAGIC\fR or \fBOFS_MAGIC\fR, but is not applicable for
237 dumps of type \fBMTB_MAGIC\fR.
243 \fB\fBTP_BSIZE_MIN\fR\fR
246 Minimum size of file blocks on the dump tapes for the new MTB format
247 (\fBMTB_MAGIC\fR) only.
253 \fB\fBTP_BSIZE_MAX\fR\fR
256 Maximum size of file blocks on the dump tapes for the new MTB format
257 (\fBMTB_MAGIC\fR) only.
266 Number of \fBTP_BSIZE\fR blocks that are written in each tape record.
272 \fB\fBHIGHDENSITYNTREC\fR\fR
275 Number of \fBTP_BSIZE\fR blocks that are written in each tape record on 6250
276 BPI or higher density tapes.
282 \fB\fBCARTRIDGETREC\fR\fR
285 Number of \fBTP_BSIZE\fR blocks that are written in each tape record on
292 \fB\fBTP_NINDIR\fR\fR
295 Number of indirect pointers in a \fBTS_INODE\fR or \fBTS_ADDR\fR record. It
296 must be a power of 2.
305 The maximum number of volumes on a tape.
314 The maximum size of a volume label.
323 The maximum size of a host's name.
329 \fB\fBOFS_MAGIC\fR\fR
332 Magic number that is used for the very old format.
338 \fB\fBNFS_MAGIC\fR\fR
341 Magic number that is used for the non-MTB format.
347 \fB\fBMTB_MAGIC\fR\fR
350 Magic number that is used for the MTB format.
359 Header records checksum to this value.
364 The \fBTS_\fR entries are used in the \fBc_type\fR field to indicate what sort
365 of header this is. The types and their meanings are as follows:
381 A file or directory follows. The \fBc_dinode\fR field is a copy of the disk
382 inode and contains bits telling what sort of file this is.
391 A subrecord of a file description. See \fBs_addrs\fR below.
400 A bit map follows. This bit map has a one bit for each inode that was dumped.
409 A bit map follows. This bit map contains a zero bit for all inodes that were
410 empty on the file system when dumped.
428 diskette \fBEOM\fRindicates that the restore is compatible with old dump
433 The flags are described as follows:
437 \fB\fBDR_NEWHEADER\fR\fR
440 New format tape header.
446 \fB\fBDR_INFODEINFO\fR\fR
449 Header contains starting inode info.
455 \fB\fBDR_REDUMP\fR\fR
458 Dump contains recopies of active files.
464 \fB\fBDR_TRUEINC\fR\fR
467 Dump is a "true incremental".
473 \fB\fBDR_HASMETA\fR\fR
476 The metadata in this header.
482 \fB\fBDUMPOUTFMT\fR\fR
485 Name, incon, and ctime (date) for printf.
491 \fB\fBDUMPINFMT\fR\fR
499 The fields of the header structure are as follows:
506 An array of bytes describing the blocks of the dumped file. A byte is zero if
507 the block associated with that byte was not present on the file system;
508 otherwise, the byte is non-zero. If the block was not present on the file
509 lsystem, no block was dumped; the block will be stored as a hole in the file.
510 If there is not sufficient space in this record to describe all the blocks in
511 a file, \fBTS_ADDR\fR records will be scattered through the file, each one
512 picking up where the last left off
521 The starting inodes on tape.
530 The type of the record.
539 The date of the previous dump.
548 The date of this dump.
557 The current volume number of the dump.
566 The logical block of this record.
572 \fB\fBc_inumber\fR\fR
575 The number of the inode being dumped if this is of type \fBTS_INODE\fR.
584 This contains the value \fBMAGIC\fR above, truncated as needed.
590 \fB\fBc_checksum\fR\fR
593 This contains whatever value is needed to make the record sum to
603 This is a copy of the inode as it appears on the file system.
612 The count of bytes in \fBs_addrs\fR.
618 \fB\fBu_data c_data\fR\fR
621 The union of either \fBu_data c_data\fR The union of either \fBs_addrs\fR or
646 \fB\fBc_filesys\fR\fR
649 Name of dumped file system.
658 Name of dumped service.
676 Additional information.
682 \fB\fBc_firstrec\fR\fR
685 First record on volume.
694 Reserved for future uses.
700 \fB\fBc_tpbsize\fR\fR
703 Tape block size for MTB format only.
708 Each volume except the last ends with a tapemark (read as an end of file). The
709 last volume ends with a \fBTS_END\fR record and then the tapemark.
712 The dump history is kept in the file \fB/etc/dumpdates\fR. It is an \fBASCII\fR
713 file with three fields separated by white space:
718 The name of the device on which the dumped file system resides.
724 The level number of the dump tape; see \fBufsdump\fR(1M).
730 The date of the incremental dump in the format generated by \fBctime\fR(3C).
734 \fBDUMPOUTFMT\fR is the format to use when using \fBprintf\fR(3C) to write an
735 entry to \fB/etc/dumpdates\fR; \fBDUMPINFMT\fR is the format to use when using
736 \fBscanf\fR(3C) to read an entry from \fB/etc/dumpdates\fR.
740 See \fBattributes\fR(5) for a description of the following attributes:
748 ATTRIBUTE TYPE ATTRIBUTE VALUE
750 Stability Level Unstable
756 \fBufsdump\fR(1M), \fBufsrestore\fR(1M), \fBctime\fR(3C), \fBprintf\fR(3C),
757 \fBscanf\fR(3C), \fBtypes.h\fR(3HEAD), \fBattributes\fR(5),