1ufsdump(4)                       File Formats                       ufsdump(4)
2
3
4

NAME

6       ufsdump, dumpdates - incremental dump format
7

SYNOPSIS

9       #include <sys/types.h>
10
11
12       #include <sys/inode.h>
13
14
15       #include <protocols/dumprestore.h>
16
17
18       /etc/dumpdates
19
20

DESCRIPTION

22       Tapes used by ufsdump(1M) and ufsrestore(1M) contain:
23
24           o      a header record
25
26           o      two groups of bit map records
27
28           o      a group of records describing directories
29
30           o      a group of records describing files
31
32
33       The  format  of the header record and the format of the first record of
34       each description in the <protocols/dumprestore.h> include file are:
35
36         #define TP_BSIZE_MAX    65536
37         #define TP_BSIZE_MIN    1024
38         #define ESIZE_SHIFT_MAX 6
39
40         #ifdef SUPPORTS_MTB_TAPE_FORMAT
41         #define TP_BUFSIZE      TP_BSIZE_MAX
42         #else
43         #define TP_BSIZE        1024
44         #define TP_BUFSIZE      TP_BSIZE
45         #endif /* SUPPORTS_MTB_TAPE_FORMAT */
46
47         #define NTREC           10
48         #define HIGHDENSITYTREC 32
49         #define CARTRIDGETREC   63
50         #define TP_NINDIR       (TP_BSIZE_MIN/2)
51         #define TP_NINOS        (TP_NINDIR / sizeof (long))
52         #define LBLSIZE         16
53         #define NAMELEN         64
54
55         #define OFS_MAGIC       (int)60011
56         #define NFS_MAGIC       (int)60012
57         #define MTB_MAGIC       (int)60013
58         #define CHECKSUM        (int)84446
59
60
61         union u_data {
62                 char    s_addrs[TP_NINDIR];
63                 int32_t s_inos[TP_NINOS];
64         };
65
66         union u_shadow {
67                 struct s_nonsh {
68                         int32_t c_level;
69                         char    c_filesys[NAMELEN];
70                         char    c_dev[NAMELEN];
71                         char    c_host[NAMELEN];
72                 } c_nonsh;
73                 char    c_shadow[1];
74         };
75
76         union u_spcl {
77                 char dummy[TP_BUFSIZE];
78                 struct  s_spcl {
79                         int32_t c_type;
80                         time32_t c_date;
81                         time32_t c_ddate;
82                         int32_t c_volume;
83                         daddr32_t c_tapea;
84                         ino32_t c_inumber;
85                         int32_t c_magic;
86                         int32_t c_checksum;
87                         struct  dinode  c_dinode;
88                         int32_t c_count;
89                         union   u_data c_data;
90                         char    c_label[LBLSIZE];
91                         union   u_shadow c_shadow;
92                         int32_t c_flags;
93                         int32_t c_firstrec;
94         #ifdef SUPPORTS_MTB_TAPE_FORMAT
95                         int32_t c_tpbsize;
96                         int32_t c_spare[31];
97         #else
98                         int32_t c_spare[32];
99         #endif /* SUPPORTS_MTB_TAPE_FORMAT */
100         } s_spcl;
101         } u_spcl;
102
103
104         int32_t                    c_type;
105         time32_t                   c_date;
106         time32_t                   c_ddate;
107         int32_t                    c_volume;
108         daddr32_t                  c_tapea;
109         ino32_t                    c_inumber;
110         int32_t                    c_magic;
111         int32_t                    c_checksum;
112         struct dinode              c_dinode;
113         int32_t                    c_count;
114         union                      u_data c_data;
115         char                       c_label[LBLSIZE];
116         union                      u_shadow c_shadow;
117         int32_t                    c_flags;
118         int32_t                    c_firstrec;
119         #ifdef SUPPORTS_MTB_TAPE_FORMAT
120         int32_t                    c_tpbsize;
121         int32_t                    c_spare[31];
122         #else
123         int32_t                    c_spare[32];
124         #endif                       /*
125              SUPPORTS_MTB_TAPE_FORMAT */
126
127
128            } s_spcl;
129         } u_spcl;
130         #define spcl u_spcl.s_spcl
131         #define c_addr c_data.s_addrs
132         #define c_inos c_data.s_inos
133         #define c_level c_shadow.c_nonsh.c_level
134         #define c_filesys c_shadow.c_nonsh.c_filesys
135         #define c_dev c_shadow.c_nonsh.c_dev
136         #define c_host c_shadow.c_nonsh.c_host
137
138
139         #define TS_TAPE         1
140         #define TS_INODE        2
141         #define TS_ADDR         4
142         #define TS_BITS         3
143         #define TS_CLRI         6
144         #define TS_END          5
145         #define TS_EOM          7
146
147         #define DR_NEWHEADER    1
148         #define DR_INODEINFO    2
149         #define DR_REDUMP       4
150         #define DR_TRUEINC      8
151         #define DR_HASMETA      16
152
153
154
155       This header describes three formats for the  ufsdump/ufsrestore  inter‐
156       face:
157
158           o      An  old  format,  non-MTB,  that supports dump sizes of less
159                  than 2 terabytes. This format is represented by NFS_MAGIC.
160
161           o      A new format, MTB, that supports dump sizes of greater  than
162                  2 terabytes using a variable block size and 2 new constants:
163                  TP_BSIZE_MIN and TP_BSIZE_MAX. This format is represented by
164                  MTB_MAGIC.
165
166           o      A  much  older format that might be found on existing backup
167                  tapes. The ufsrestore command can restore tapes of this for‐
168                  mat,  but  no longer generates tapes of this format. Backups
169                  in this format have the OFS_MAGIC magic number in their tape
170                  headers.
171
172
173       The constants are described as follows:
174
175       TP_BSIZE            Size  of  file blocks on the dump tapes for the old
176                           format. Note that TP_BSIZE must be  a  multiple  of
177                           DEV_BSIZE  This  is  applicable  for  dumps of type
178                           NFS_MAGIC or OFS_MAGIC, but is not  applicable  for
179                           dumps of type MTB_MAGIC.
180
181
182       TP_BSIZE_MIN        Minimum  size  of file blocks on the dump tapes for
183                           the new MTB format (MTB_MAGIC) only.
184
185
186       TP_BSIZE_MAX        Maximum size of file blocks on the dump  tapes  for
187                           the new MTB format (MTB_MAGIC) only.
188
189
190       NTREC               Number  of TP_BSIZE blocks that are written in each
191                           tape record.
192
193
194       HIGHDENSITYNTREC    Number of TP_BSIZE blocks that are written in  each
195                           tape record on  6250 BPI or higher density tapes.
196
197
198       CARTRIDGETREC       Number  of TP_BSIZE blocks that are written in each
199                           tape record on cartridge tapes.
200
201
202       TP_NINDIR           Number  of  indirect  pointers  in  a  TS_INODE  or
203                           TS_ADDR record. It must be a power of 2.
204
205
206       TP_NINOS            The maximum number of volumes on a tape.
207
208
209       LBLSIZE             The maximum size of a volume label.
210
211
212       NAMELEN             The maximum size of a host's name.
213
214
215       OFS_MAGIC           Magic number that is used for the very old format.
216
217
218       NFS_MAGIC           Magic number that is used for the non-MTB format.
219
220
221       MTB_MAGIC           Magic number that is used for the MTB format.
222
223
224       CHECKSUM            Header records checksum to this value.
225
226
227
228       The  TS_  entries are used in the c_type field to indicate what sort of
229       header this is. The types and their meanings are as follows:
230
231       TS_TAPE     Tape volume label.
232
233
234       TS_INODE    A file or directory follows. The c_dinode field is  a  copy
235                   of  the  disk  inode and contains bits telling what sort of
236                   file this is.
237
238
239       TS_ADDR     A subrecord of a file description. See s_addrs below.
240
241
242       TS_BITS     A bit map follows. This bit map has  a  one  bit  for  each
243                   inode that was dumped.
244
245
246       TS_CLRI     A bit map follows. This bit map contains a zero bit for all
247                   inodes that were empty on the file system when dumped.
248
249
250       TS_END      End of tape record.
251
252
253       TS_EOM      diskette  EOMindicates that the restore is compatible  with
254                   old dump
255
256
257
258       The flags are described as follows:
259
260       DR_NEWHEADER     New format tape header.
261
262
263       DR_INFODEINFO    Header contains starting inode info.
264
265
266       DR_REDUMP        Dump contains recopies of active files.
267
268
269       DR_TRUEINC       Dump is a "true incremental".
270
271
272       DR_HASMETA       The metadata in this header.
273
274
275       DUMPOUTFMT       Name, incon, and ctime (date) for printf.
276
277
278       DUMPINFMT        Inverse for scanf.
279
280
281
282       The fields of the header structure are as follows:
283
284       s_addrs          An  array of bytes describing the blocks of the dumped
285                        file.  A byte is  zero if the  block  associated  with
286                        that  byte  was not present on the file system; other‐
287                        wise, the byte is non-zero.   If  the  block  was  not
288                        present  on the file lsystem, no block was dumped; the
289                        block will be stored as a    hole  in  the  file.   If
290                        there  is  not  sufficient  space  in  this  record to
291                        describe all the blocks in a  file,   TS_ADDR  records
292                        will  be  scattered through the file, each one picking
293                        up where the  last left off
294
295
296       s_inos           The starting inodes on tape.
297
298
299       c_type           The type of the record.
300
301
302       c_date           The date of the previous dump.
303
304
305       c_ddate          The date of this dump.
306
307
308       c_volume         The current volume number of the dump.
309
310
311       c_tapea          The logical block of this record.
312
313
314       c_inumber        The number of the inode being dumped  if  this  is  of
315                        type TS_INODE.
316
317
318       c_magic          This  contains  the  value  MAGIC  above, truncated as
319                        needed.
320
321
322       c_checksum       This contains whatever value is  needed  to  make  the
323                        record sum to CHECKSUM.
324
325
326       c_dinode         This  is a copy of the inode as it appears on the file
327                        system.
328
329
330       c_count          The count of bytes in s_addrs.
331
332
333       u_data c_data    The union of either  u_data c_data The union of either
334                        s_addrs or  s_inos.
335
336
337       c_label          Label for this dump.
338
339
340       c_level          Level of this dump.
341
342
343       c_filesys        Name of dumped file system.
344
345
346       c_dev            Name of dumped service.
347
348
349       c_host           Name of dumped host.
350
351
352       c_flags          Additional information.
353
354
355       c_firstrec       First record on volume.
356
357
358       c_spare          Reserved for future uses.
359
360
361       c_tpbsize        Tape block size for MTB format only.
362
363
364
365       Each  volume  except  the  last ends with a tapemark (read as an end of
366       file). The last volume ends with a TS_END record and then the tapemark.
367
368
369       The dump history is kept in the file /etc/dumpdates.  It  is  an  ASCII
370       file with three fields separated by white space:
371
372           o      The  name  of  the  device  on  which the dumped file system
373                  resides.
374
375           o      The level number of the dump tape; see ufsdump(1M).
376
377           o      The date of the incremental dump in the format generated  by
378                  ctime(3C).
379
380
381       DUMPOUTFMT is the format to use when using printf(3C) to write an entry
382       to /etc/dumpdates; DUMPINFMT is the format to use when using  scanf(3C)
383       to read an entry from /etc/dumpdates.
384

ATTRIBUTES

386       See attributes(5) for a description of the following attributes:
387
388
389
390
391       ┌─────────────────────────────┬─────────────────────────────┐
392       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
393       ├─────────────────────────────┼─────────────────────────────┤
394       │Stability Level              │Unstable                     │
395       └─────────────────────────────┴─────────────────────────────┘
396

SEE ALSO

398       ufsdump(1M),    ufsrestore(1M),   ctime(3C),   printf(3C),   scanf(3C),
399       types.h(3HEAD), attributes(5),
400
401
402
403SunOS 5.11                        9 Apr 2003                        ufsdump(4)
Impressum