abolish ino32_t
[unleashed.git] / share / man / man4 / ufsdump.4
blobf7174267905c878379951140e0f5ea9510804af0
1 '\" te
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"
4 .SH NAME
5 ufsdump, dumpdates \- incremental dump format
6 .SH SYNOPSIS
7 .LP
8 .nf
9 \fB#include <sys/types.h>\fR
10 .fi
12 .LP
13 .nf
14 \fB#include <sys/inode.h>\fR
15 .fi
17 .LP
18 .nf
19 \fB#include <protocols/dumprestore.h>\fR
20 .fi
22 .LP
23 .nf
24 \fB/etc/dumpdates\fR
25 .fi
27 .SH DESCRIPTION
28 .sp
29 .LP
30 Tapes used by \fBufsdump\fR(8) and \fBufsrestore\fR(8) contain:
31 .RS +4
32 .TP
33 .ie t \(bu
34 .el o
35 a header record
36 .RE
37 .RS +4
38 .TP
39 .ie t \(bu
40 .el o
41 two groups of bit map records
42 .RE
43 .RS +4
44 .TP
45 .ie t \(bu
46 .el o
47 a group of records describing directories
48 .RE
49 .RS +4
50 .TP
51 .ie t \(bu
52 .el o
53 a group of records describing files
54 .RE
55 .sp
56 .LP
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:
59 .sp
60 .in +2
61 .nf
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
68 #else
69 #define TP_BSIZE        1024
70 #define TP_BUFSIZE      TP_BSIZE
71 #endif /* SUPPORTS_MTB_TAPE_FORMAT */
73 #define NTREC           10
74 #define HIGHDENSITYTREC 32
75 #define CARTRIDGETREC   63
76 #define TP_NINDIR       (TP_BSIZE_MIN/2)
77 #define TP_NINOS        (TP_NINDIR / sizeof (long))
78 #define LBLSIZE         16
79 #define NAMELEN         64
81 #define OFS_MAGIC       (int)60011
82 #define NFS_MAGIC       (int)60012
83 #define MTB_MAGIC       (int)60013
84 #define CHECKSUM        (int)84446
85 .fi
86 .in -2
88 .sp
89 .in +2
90 .nf
91 union u_data {
92         char    s_addrs[TP_NINDIR];
93         int32_t s_inos[TP_NINOS];
96 union u_shadow {
97         struct s_nonsh {
98                 int32_t c_level;
99                 char    c_filesys[NAMELEN];
100                 char    c_dev[NAMELEN];
101                 char    c_host[NAMELEN];
102         } c_nonsh;
103         char    c_shadow[1];
106 union u_spcl {
107         char dummy[TP_BUFSIZE];
108         struct  s_spcl {
109                 int32_t c_type;
110                 time32_t c_date;
111                 time32_t c_ddate;
112                 int32_t c_volume;
113                 daddr32_t c_tapea;
114                 ino_t   c_inumber;
115                 int32_t c_magic;
116                 int32_t c_checksum;
117                 struct  dinode  c_dinode;
118                 int32_t c_count;
119                 union   u_data c_data;
120                 char    c_label[LBLSIZE];
121                 union   u_shadow c_shadow;
122                 int32_t c_flags;
123                 int32_t c_firstrec;
124 #ifdef SUPPORTS_MTB_TAPE_FORMAT
125                 int32_t c_tpbsize;
126                 int32_t c_spare[31];
127 #else
128                 int32_t c_spare[32];
129 #endif /* SUPPORTS_MTB_TAPE_FORMAT */
130 } s_spcl;
131 } u_spcl;
133 .in -2
136 .in +2
138 int32_t                    c_type;
139 time32_t                   c_date;
140 time32_t                   c_ddate;
141 int32_t                    c_volume;
142 daddr32_t                  c_tapea;
143 ino_t                      c_inumber;
144 int32_t                    c_magic;
145 int32_t                    c_checksum;
146 struct dinode              c_dinode;
147 int32_t                    c_count;
148 union                      u_data c_data;
149 char                       c_label[LBLSIZE];
150 union                      u_shadow c_shadow;
151 int32_t                    c_flags;
152 int32_t                    c_firstrec;
153 #ifdef SUPPORTS_MTB_TAPE_FORMAT
154 int32_t                    c_tpbsize;
155 int32_t                    c_spare[31];
156 #else
157 int32_t                    c_spare[32];
158 #endif                       /*
159      SUPPORTS_MTB_TAPE_FORMAT */
161 .in -2
164 .in +2
166    } s_spcl;
167 } u_spcl;
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
176 .in -2
179 .in +2
181 #define TS_TAPE         1
182 #define TS_INODE        2
183 #define TS_ADDR         4
184 #define TS_BITS         3
185 #define TS_CLRI         6
186 #define TS_END          5
187 #define TS_EOM          7
189 #define DR_NEWHEADER    1
190 #define DR_INODEINFO    2
191 #define DR_REDUMP       4
192 #define DR_TRUEINC      8
193 #define DR_HASMETA      16
195 .in -2
199 This header describes three formats for the \fBufsdump\fR/\fBufsrestore\fR
200 interface:
201 .RS +4
203 .ie t \(bu
204 .el o
205 An old format, non-MTB, that supports dump sizes of less than 2 terabytes. This
206 format is represented by \fBNFS_MAGIC\fR.
208 .RS +4
210 .ie t \(bu
211 .el o
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.
216 .RS +4
218 .ie t \(bu
219 .el o
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:
229 .ne 2
231 \fB\fBTP_BSIZE\fR\fR
233 .RS 20n
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.
241 .ne 2
243 \fB\fBTP_BSIZE_MIN\fR\fR
245 .RS 20n
246 Minimum size of file blocks on the dump tapes for the new MTB format
247 (\fBMTB_MAGIC\fR) only.
251 .ne 2
253 \fB\fBTP_BSIZE_MAX\fR\fR
255 .RS 20n
256 Maximum size of file blocks on the dump tapes for the new MTB format
257 (\fBMTB_MAGIC\fR) only.
261 .ne 2
263 \fB\fBNTREC\fR\fR
265 .RS 20n
266 Number of \fBTP_BSIZE\fR blocks that are written in each tape record.
270 .ne 2
272 \fB\fBHIGHDENSITYNTREC\fR\fR
274 .RS 20n
275 Number of \fBTP_BSIZE\fR blocks that are written in each tape record on  6250
276 BPI or higher density tapes.
280 .ne 2
282 \fB\fBCARTRIDGETREC\fR\fR
284 .RS 20n
285 Number of \fBTP_BSIZE\fR blocks that are written in each tape record on
286 cartridge tapes.
290 .ne 2
292 \fB\fBTP_NINDIR\fR\fR
294 .RS 20n
295 Number of indirect pointers in a \fBTS_INODE\fR or \fBTS_ADDR\fR record. It
296 must be a power of 2.
300 .ne 2
302 \fB\fBTP_NINOS\fR\fR
304 .RS 20n
305 The maximum number of volumes on a tape.
309 .ne 2
311 \fB\fBLBLSIZE\fR\fR
313 .RS 20n
314 The maximum size of a volume label.
318 .ne 2
320 \fB\fBNAMELEN\fR\fR
322 .RS 20n
323 The maximum size of a host's name.
327 .ne 2
329 \fB\fBOFS_MAGIC\fR\fR
331 .RS 20n
332 Magic number that is used for the very old format.
336 .ne 2
338 \fB\fBNFS_MAGIC\fR\fR
340 .RS 20n
341 Magic number that is used for the non-MTB format.
345 .ne 2
347 \fB\fBMTB_MAGIC\fR\fR
349 .RS 20n
350 Magic number that is used for the MTB format.
354 .ne 2
356 \fB\fBCHECKSUM\fR\fR
358 .RS 20n
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:
367 .ne 2
369 \fB\fBTS_TAPE\fR\fR
371 .RS 12n
372 Tape volume label.
376 .ne 2
378 \fB\fBTS_INODE\fR\fR
380 .RS 12n
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.
386 .ne 2
388 \fB\fBTS_ADDR\fR\fR
390 .RS 12n
391 A subrecord of a file description. See \fBs_addrs\fR below.
395 .ne 2
397 \fB\fBTS_BITS\fR\fR
399 .RS 12n
400 A bit map follows. This bit map has a one bit for each inode that was dumped.
404 .ne 2
406 \fB\fBTS_CLRI\fR\fR
408 .RS 12n
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.
414 .ne 2
416 \fB\fBTS_END\fR\fR
418 .RS 12n
419 End of tape record.
423 .ne 2
425 \fB\fBTS_EOM\fR\fR
427 .RS 12n
428 diskette  \fBEOM\fRindicates that the restore is compatible with old dump
433 The flags are described as follows:
435 .ne 2
437 \fB\fBDR_NEWHEADER\fR\fR
439 .RS 17n
440 New format tape header.
444 .ne 2
446 \fB\fBDR_INFODEINFO\fR\fR
448 .RS 17n
449 Header contains starting inode info.
453 .ne 2
455 \fB\fBDR_REDUMP\fR\fR
457 .RS 17n
458 Dump contains recopies of active files.
462 .ne 2
464 \fB\fBDR_TRUEINC\fR\fR
466 .RS 17n
467 Dump is a "true incremental".
471 .ne 2
473 \fB\fBDR_HASMETA\fR\fR
475 .RS 17n
476 The metadata in this header.
480 .ne 2
482 \fB\fBDUMPOUTFMT\fR\fR
484 .RS 17n
485 Name, incon, and ctime (date) for printf.
489 .ne 2
491 \fB\fBDUMPINFMT\fR\fR
493 .RS 17n
494 Inverse for scanf.
499 The fields of the header structure are as follows:
501 .ne 2
503 \fB\fBs_addrs\fR\fR
505 .RS 17n
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
516 .ne 2
518 \fB\fBs_inos\fR\fR
520 .RS 17n
521 The starting inodes on tape.
525 .ne 2
527 \fB\fBc_type\fR\fR
529 .RS 17n
530 The type of the record.
534 .ne 2
536 \fB\fBc_date\fR\fR
538 .RS 17n
539 The date of the previous dump.
543 .ne 2
545 \fB\fBc_ddate\fR\fR
547 .RS 17n
548 The date of this dump.
552 .ne 2
554 \fB\fBc_volume\fR\fR
556 .RS 17n
557 The current volume number of the dump.
561 .ne 2
563 \fB\fBc_tapea\fR\fR
565 .RS 17n
566 The logical block of this record.
570 .ne 2
572 \fB\fBc_inumber\fR\fR
574 .RS 17n
575 The number of the inode being dumped if this is of type \fBTS_INODE\fR.
579 .ne 2
581 \fB\fBc_magic\fR\fR
583 .RS 17n
584 This contains the value \fBMAGIC\fR above, truncated as needed.
588 .ne 2
590 \fB\fBc_checksum\fR\fR
592 .RS 17n
593 This contains whatever value is needed to make the record sum to
594 \fBCHECKSUM\fR.
598 .ne 2
600 \fB\fBc_dinode\fR\fR
602 .RS 17n
603 This is a copy of the inode as it appears on the file system.
607 .ne 2
609 \fB\fBc_count\fR\fR
611 .RS 17n
612 The count of bytes in \fBs_addrs\fR.
616 .ne 2
618 \fB\fBu_data c_data\fR\fR
620 .RS 17n
621 The union of either  \fBu_data c_data\fR The union of either  \fBs_addrs\fR or
622 \fBs_inos\fR.
626 .ne 2
628 \fB\fBc_label\fR\fR
630 .RS 17n
631 Label for this dump.
635 .ne 2
637 \fB\fBc_level\fR\fR
639 .RS 17n
640 Level of this dump.
644 .ne 2
646 \fB\fBc_filesys\fR\fR
648 .RS 17n
649 Name of dumped file system.
653 .ne 2
655 \fB\fBc_dev\fR\fR
657 .RS 17n
658 Name of dumped service.
662 .ne 2
664 \fB\fBc_host\fR\fR
666 .RS 17n
667 Name of dumped host.
671 .ne 2
673 \fB\fBc_flags\fR\fR
675 .RS 17n
676 Additional information.
680 .ne 2
682 \fB\fBc_firstrec\fR\fR
684 .RS 17n
685 First record on volume.
689 .ne 2
691 \fB\fBc_spare\fR\fR
693 .RS 17n
694 Reserved for future uses.
698 .ne 2
700 \fB\fBc_tpbsize\fR\fR
702 .RS 17n
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:
714 .RS +4
716 .ie t \(bu
717 .el o
718 The name of the device on which the dumped file system resides.
720 .RS +4
722 .ie t \(bu
723 .el o
724 The level number of the dump tape; see \fBufsdump\fR(8).
726 .RS +4
728 .ie t \(bu
729 .el o
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.
737 .SH ATTRIBUTES
740 See \fBattributes\fR(5) for a description of the following attributes:
745 box;
746 c | c
747 l | l .
748 ATTRIBUTE TYPE  ATTRIBUTE VALUE
750 Stability Level Unstable
753 .SH SEE ALSO
756 \fBufsdump\fR(8), \fBufsrestore\fR(8), \fBctime\fR(3C), \fBprintf\fR(3C),
757 \fBscanf\fR(3C), \fBtypes.h\fR(3HEAD), \fBattributes\fR(5),