summaryrefslogtreecommitdiff
path: root/usr/src/man/man4/ufsdump.4
blob: e9073cb3bb6399d4f7a2f44f8872e519199cfe2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
'\" te
.\"  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.
.TH UFSDUMP 4 "Apr 9, 2003"
.SH NAME
ufsdump, dumpdates \- incremental dump format
.SH SYNOPSIS
.LP
.nf
\fB#include <sys/types.h>\fR
.fi

.LP
.nf
\fB#include <sys/inode.h>\fR
.fi

.LP
.nf
\fB#include <protocols/dumprestore.h>\fR
.fi

.LP
.nf
\fB/etc/dumpdates\fR
.fi

.SH DESCRIPTION
.sp
.LP
Tapes used by \fBufsdump\fR(1M) and \fBufsrestore\fR(1M) contain:
.RS +4
.TP
.ie t \(bu
.el o
a header record
.RE
.RS +4
.TP
.ie t \(bu
.el o
two groups of bit map records
.RE
.RS +4
.TP
.ie t \(bu
.el o
a group of records describing directories
.RE
.RS +4
.TP
.ie t \(bu
.el o
a group of records describing files
.RE
.sp
.LP
The format of the header record and the format of the first record of each
description in the \fB<protocols/dumprestore.h>\fR include file are:
.sp
.in +2
.nf
#define TP_BSIZE_MAX    65536
#define TP_BSIZE_MIN    1024
#define ESIZE_SHIFT_MAX 6

#ifdef SUPPORTS_MTB_TAPE_FORMAT
#define TP_BUFSIZE      TP_BSIZE_MAX
#else
#define TP_BSIZE        1024
#define TP_BUFSIZE      TP_BSIZE
#endif /* SUPPORTS_MTB_TAPE_FORMAT */

#define NTREC           10
#define HIGHDENSITYTREC 32
#define CARTRIDGETREC   63
#define TP_NINDIR       (TP_BSIZE_MIN/2)
#define TP_NINOS        (TP_NINDIR / sizeof (long))
#define LBLSIZE         16
#define NAMELEN         64

#define OFS_MAGIC       (int)60011
#define NFS_MAGIC       (int)60012
#define MTB_MAGIC       (int)60013
#define CHECKSUM        (int)84446
.fi
.in -2

.sp
.in +2
.nf
union u_data {
        char    s_addrs[TP_NINDIR];
        int32_t s_inos[TP_NINOS];
};

union u_shadow {
        struct s_nonsh {
                int32_t c_level;
                char    c_filesys[NAMELEN];
                char    c_dev[NAMELEN];
                char    c_host[NAMELEN];
        } c_nonsh;
        char    c_shadow[1];
};

union u_spcl {
        char dummy[TP_BUFSIZE];
        struct  s_spcl {
                int32_t c_type;
                time32_t c_date;
                time32_t c_ddate;
                int32_t c_volume;
                daddr32_t c_tapea;
                ino32_t c_inumber;
                int32_t c_magic;
                int32_t c_checksum;
                struct  dinode  c_dinode;
                int32_t c_count;
                union   u_data c_data;
                char    c_label[LBLSIZE];
                union   u_shadow c_shadow;
                int32_t c_flags;
                int32_t c_firstrec;
#ifdef SUPPORTS_MTB_TAPE_FORMAT
                int32_t c_tpbsize;
                int32_t c_spare[31];
#else
                int32_t c_spare[32];
#endif /* SUPPORTS_MTB_TAPE_FORMAT */
} s_spcl;
} u_spcl;
.fi
.in -2

.sp
.in +2
.nf
int32_t                    c_type;
time32_t                   c_date;
time32_t                   c_ddate;
int32_t                    c_volume;
daddr32_t                  c_tapea;
ino32_t                    c_inumber;
int32_t                    c_magic;
int32_t                    c_checksum;
struct dinode              c_dinode;
int32_t                    c_count;
union                      u_data c_data;
char                       c_label[LBLSIZE];
union                      u_shadow c_shadow;
int32_t                    c_flags;
int32_t                    c_firstrec;
#ifdef SUPPORTS_MTB_TAPE_FORMAT
int32_t                    c_tpbsize;
int32_t                    c_spare[31];
#else
int32_t                    c_spare[32];
#endif                       /*
     SUPPORTS_MTB_TAPE_FORMAT */
.fi
.in -2

.sp
.in +2
.nf
   } s_spcl;
} u_spcl;
#define spcl u_spcl.s_spcl
#define c_addr c_data.s_addrs
#define c_inos c_data.s_inos
#define c_level c_shadow.c_nonsh.c_level
#define c_filesys c_shadow.c_nonsh.c_filesys
#define c_dev c_shadow.c_nonsh.c_dev
#define c_host c_shadow.c_nonsh.c_host
.fi
.in -2

.sp
.in +2
.nf
#define TS_TAPE         1
#define TS_INODE        2
#define TS_ADDR         4
#define TS_BITS         3
#define TS_CLRI         6
#define TS_END          5
#define TS_EOM          7

#define DR_NEWHEADER    1
#define DR_INODEINFO    2
#define DR_REDUMP       4
#define DR_TRUEINC      8
#define DR_HASMETA      16
.fi
.in -2

.sp
.LP
This header describes three formats for the \fBufsdump\fR/\fBufsrestore\fR
interface:
.RS +4
.TP
.ie t \(bu
.el o
An old format, non-MTB, that supports dump sizes of less than 2 terabytes. This
format is represented by \fBNFS_MAGIC\fR.
.RE
.RS +4
.TP
.ie t \(bu
.el o
A new format, MTB, that supports dump sizes of greater than 2 terabytes using a
variable block size and 2 new constants: \fBTP_BSIZE_MIN\fR and
\fBTP_BSIZE_MAX\fR. This format is represented by \fBMTB_MAGIC\fR.
.RE
.RS +4
.TP
.ie t \(bu
.el o
A much older format that might be found on existing backup tapes. The
\fBufsrestore\fR command can restore tapes of this format, but no longer
generates tapes of this format. Backups in this format have the \fBOFS_MAGIC\fR
magic number in their tape headers.
.RE
.sp
.LP
The constants are described as follows:
.sp
.ne 2
.na
\fB\fBTP_BSIZE\fR\fR
.ad
.RS 20n
Size of file blocks on the dump tapes for the old format. Note that
\fBTP_BSIZE\fR must be a multiple of \fBDEV_BSIZE\fR This is applicable for
dumps of type \fBNFS_MAGIC\fR or \fBOFS_MAGIC\fR, but is not applicable for
dumps of type \fBMTB_MAGIC\fR.
.RE

.sp
.ne 2
.na
\fB\fBTP_BSIZE_MIN\fR\fR
.ad
.RS 20n
Minimum size of file blocks on the dump tapes for the new MTB format
(\fBMTB_MAGIC\fR) only.
.RE

.sp
.ne 2
.na
\fB\fBTP_BSIZE_MAX\fR\fR
.ad
.RS 20n
Maximum size of file blocks on the dump tapes for the new MTB format
(\fBMTB_MAGIC\fR) only.
.RE

.sp
.ne 2
.na
\fB\fBNTREC\fR\fR
.ad
.RS 20n
Number of \fBTP_BSIZE\fR blocks that are written in each tape record.
.RE

.sp
.ne 2
.na
\fB\fBHIGHDENSITYNTREC\fR\fR
.ad
.RS 20n
Number of \fBTP_BSIZE\fR blocks that are written in each tape record on  6250
BPI or higher density tapes.
.RE

.sp
.ne 2
.na
\fB\fBCARTRIDGETREC\fR\fR
.ad
.RS 20n
Number of \fBTP_BSIZE\fR blocks that are written in each tape record on
cartridge tapes.
.RE

.sp
.ne 2
.na
\fB\fBTP_NINDIR\fR\fR
.ad
.RS 20n
Number of indirect pointers in a \fBTS_INODE\fR or \fBTS_ADDR\fR record. It
must be a power of 2.
.RE

.sp
.ne 2
.na
\fB\fBTP_NINOS\fR\fR
.ad
.RS 20n
The maximum number of volumes on a tape.
.RE

.sp
.ne 2
.na
\fB\fBLBLSIZE\fR\fR
.ad
.RS 20n
The maximum size of a volume label.
.RE

.sp
.ne 2
.na
\fB\fBNAMELEN\fR\fR
.ad
.RS 20n
The maximum size of a host's name.
.RE

.sp
.ne 2
.na
\fB\fBOFS_MAGIC\fR\fR
.ad
.RS 20n
Magic number that is used for the very old format.
.RE

.sp
.ne 2
.na
\fB\fBNFS_MAGIC\fR\fR
.ad
.RS 20n
Magic number that is used for the non-MTB format.
.RE

.sp
.ne 2
.na
\fB\fBMTB_MAGIC\fR\fR
.ad
.RS 20n
Magic number that is used for the MTB format.
.RE

.sp
.ne 2
.na
\fB\fBCHECKSUM\fR\fR
.ad
.RS 20n
Header records checksum to this value.
.RE

.sp
.LP
The \fBTS_\fR entries are used in the \fBc_type\fR field to indicate what sort
of header this is. The types and their meanings are as follows:
.sp
.ne 2
.na
\fB\fBTS_TAPE\fR\fR
.ad
.RS 12n
Tape volume label.
.RE

.sp
.ne 2
.na
\fB\fBTS_INODE\fR\fR
.ad
.RS 12n
A file or directory follows. The \fBc_dinode\fR field is a copy of the disk
inode and contains bits telling what sort of file this is.
.RE

.sp
.ne 2
.na
\fB\fBTS_ADDR\fR\fR
.ad
.RS 12n
A subrecord of a file description. See \fBs_addrs\fR below.
.RE

.sp
.ne 2
.na
\fB\fBTS_BITS\fR\fR
.ad
.RS 12n
A bit map follows. This bit map has a one bit for each inode that was dumped.
.RE

.sp
.ne 2
.na
\fB\fBTS_CLRI\fR\fR
.ad
.RS 12n
A bit map follows. This bit map contains a zero bit for all inodes that were
empty on the file system when dumped.
.RE

.sp
.ne 2
.na
\fB\fBTS_END\fR\fR
.ad
.RS 12n
End of tape record.
.RE

.sp
.ne 2
.na
\fB\fBTS_EOM\fR\fR
.ad
.RS 12n
diskette  \fBEOM\fRindicates that the restore is compatible with old dump
.RE

.sp
.LP
The flags are described as follows:
.sp
.ne 2
.na
\fB\fBDR_NEWHEADER\fR\fR
.ad
.RS 17n
New format tape header.
.RE

.sp
.ne 2
.na
\fB\fBDR_INFODEINFO\fR\fR
.ad
.RS 17n
Header contains starting inode info.
.RE

.sp
.ne 2
.na
\fB\fBDR_REDUMP\fR\fR
.ad
.RS 17n
Dump contains recopies of active files.
.RE

.sp
.ne 2
.na
\fB\fBDR_TRUEINC\fR\fR
.ad
.RS 17n
Dump is a "true incremental".
.RE

.sp
.ne 2
.na
\fB\fBDR_HASMETA\fR\fR
.ad
.RS 17n
The metadata in this header.
.RE

.sp
.ne 2
.na
\fB\fBDUMPOUTFMT\fR\fR
.ad
.RS 17n
Name, incon, and ctime (date) for printf.
.RE

.sp
.ne 2
.na
\fB\fBDUMPINFMT\fR\fR
.ad
.RS 17n
Inverse for scanf.
.RE

.sp
.LP
The fields of the header structure are as follows:
.sp
.ne 2
.na
\fB\fBs_addrs\fR\fR
.ad
.RS 17n
An array of bytes describing the blocks of the dumped file.  A byte is  zero if
the block associated with that byte was not present on the file system;
otherwise, the byte is non-zero.  If the block was not present on the file
lsystem, no block was dumped; the block will be stored as a   hole in the file.
If there is not sufficient space in this record to  describe all the blocks in
a file,  \fBTS_ADDR\fR records will be scattered through the file, each one
picking up where the  last left off
.RE

.sp
.ne 2
.na
\fB\fBs_inos\fR\fR
.ad
.RS 17n
The starting inodes on tape.
.RE

.sp
.ne 2
.na
\fB\fBc_type\fR\fR
.ad
.RS 17n
The type of the record.
.RE

.sp
.ne 2
.na
\fB\fBc_date\fR\fR
.ad
.RS 17n
The date of the previous dump.
.RE

.sp
.ne 2
.na
\fB\fBc_ddate\fR\fR
.ad
.RS 17n
The date of this dump.
.RE

.sp
.ne 2
.na
\fB\fBc_volume\fR\fR
.ad
.RS 17n
The current volume number of the dump.
.RE

.sp
.ne 2
.na
\fB\fBc_tapea\fR\fR
.ad
.RS 17n
The logical block of this record.
.RE

.sp
.ne 2
.na
\fB\fBc_inumber\fR\fR
.ad
.RS 17n
The number of the inode being dumped if this is of type \fBTS_INODE\fR.
.RE

.sp
.ne 2
.na
\fB\fBc_magic\fR\fR
.ad
.RS 17n
This contains the value \fBMAGIC\fR above, truncated as needed.
.RE

.sp
.ne 2
.na
\fB\fBc_checksum\fR\fR
.ad
.RS 17n
This contains whatever value is needed to make the record sum to
\fBCHECKSUM\fR.
.RE

.sp
.ne 2
.na
\fB\fBc_dinode\fR\fR
.ad
.RS 17n
This is a copy of the inode as it appears on the file system.
.RE

.sp
.ne 2
.na
\fB\fBc_count\fR\fR
.ad
.RS 17n
The count of bytes in \fBs_addrs\fR.
.RE

.sp
.ne 2
.na
\fB\fBu_data c_data\fR\fR
.ad
.RS 17n
The union of either  \fBu_data c_data\fR The union of either  \fBs_addrs\fR or
\fBs_inos\fR.
.RE

.sp
.ne 2
.na
\fB\fBc_label\fR\fR
.ad
.RS 17n
Label for this dump.
.RE

.sp
.ne 2
.na
\fB\fBc_level\fR\fR
.ad
.RS 17n
Level of this dump.
.RE

.sp
.ne 2
.na
\fB\fBc_filesys\fR\fR
.ad
.RS 17n
Name of dumped file system.
.RE

.sp
.ne 2
.na
\fB\fBc_dev\fR\fR
.ad
.RS 17n
Name of dumped service.
.RE

.sp
.ne 2
.na
\fB\fBc_host\fR\fR
.ad
.RS 17n
Name of dumped host.
.RE

.sp
.ne 2
.na
\fB\fBc_flags\fR\fR
.ad
.RS 17n
Additional information.
.RE

.sp
.ne 2
.na
\fB\fBc_firstrec\fR\fR
.ad
.RS 17n
First record on volume.
.RE

.sp
.ne 2
.na
\fB\fBc_spare\fR\fR
.ad
.RS 17n
Reserved for future uses.
.RE

.sp
.ne 2
.na
\fB\fBc_tpbsize\fR\fR
.ad
.RS 17n
Tape block size for MTB format only.
.RE

.sp
.LP
Each volume except the last ends with a tapemark (read as an end of file). The
last volume ends with a \fBTS_END\fR record and then the tapemark.
.sp
.LP
The dump history is kept in the file \fB/etc/dumpdates\fR. It is an \fBASCII\fR
file with three fields separated by white space:
.RS +4
.TP
.ie t \(bu
.el o
The name of the device on which the dumped file system resides.
.RE
.RS +4
.TP
.ie t \(bu
.el o
The level number of the dump tape; see \fBufsdump\fR(1M).
.RE
.RS +4
.TP
.ie t \(bu
.el o
The date of the incremental dump in the format generated by \fBctime\fR(3C).
.RE
.sp
.LP
\fBDUMPOUTFMT\fR is the format to use when using \fBprintf\fR(3C) to write an
entry to \fB/etc/dumpdates\fR; \fBDUMPINFMT\fR is the format to use when using
\fBscanf\fR(3C) to read an entry from \fB/etc/dumpdates\fR.
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for a description of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Stability Level	Unstable
.TE

.SH SEE ALSO
.sp
.LP
\fBufsdump\fR(1M), \fBufsrestore\fR(1M), \fBctime\fR(3C), \fBprintf\fR(3C),
\fBscanf\fR(3C), \fBtypes.h\fR(3HEAD), \fBattributes\fR(5),