xref: /freebsd/contrib/file/magic/Magdir/zfs (revision 298f5fdc242b760e70cd3494e3a4f1f50b20664d)
1#------------------------------------------------------------------------------
2# zfs:	file(1) magic for ZFS dumps
3#
4# From <rea-fbsd@codelabs.ru>
5# ZFS dump header has the following structure (as per zfs_ioctl.h
6# in FreeBSD with drr_type is set to DRR_BEGIN)
7#
8#   enum {
9#	DRR_BEGIN, DRR_OBJECT, DRR_FREEOBJECTS,
10#	DRR_WRITE, DRR_FREE, DRR_END,
11#   } drr_type;
12#   uint32_t drr_pad;
13#   uint64_t drr_magic;
14#   uint64_t drr_version;
15#   uint64_t drr_creation_time;
16#   dmu_objset_type_t drr_type;
17#   uint32_t drr_pad;
18#   uint64_t drr_toguid;
19#   uint64_t drr_fromguid;
20#   char drr_toname[MAXNAMELEN];
21#
22# Backup magic is 0x00000002f5bacbac (quad word)
23# The drr_type is defined as
24#   typedef enum dmu_objset_type {
25#	  DMU_OST_NONE,
26#	  DMU_OST_META,
27#	  DMU_OST_ZFS,
28#	  DMU_OST_ZVOL,
29#	  DMU_OST_OTHER,		  /* For testing only! */
30#	  DMU_OST_ANY,			  /* Be careful! */
31#	  DMU_OST_NUMTYPES
32#  } dmu_objset_type_t;
33#
34# Almost all uint64_t fields are printed as the 32-bit ones (with high
35# 32 bits zeroed), because there is no simple way to print them as the
36# full 64-bit values.
37
38# Big-endian values
398	string	\000\000\000\002\365\272\313\254 ZFS shapshot (big-endian machine),
40>20	belong	x	version %u,
41>32	belong	0	type: NONE,
42>32	belong	1	type: META,
43>32	belong	2	type: ZFS,
44>32	belong	3	type: ZVOL,
45>32	belong	4	type: OTHER,
46>32	belong	5	type: ANY,
47>32	belong	>5	type: UNKNOWN (%u),
48>40	byte	x	destination GUID: %02X
49>41	byte	x	%02X
50>42	byte	x	%02X
51>43	byte	x	%02X
52>44	byte	x	%02X
53>45	byte	x	%02X
54>46	byte	x	%02X
55>47	byte	x	%02X,
56>48	ulong	>0
57>>52	ulong	>0
58>>>48	byte	x	source GUID: %02X
59>>>49	byte	x	%02X
60>>>50	byte	x	%02X
61>>>51	byte	x	%02X
62>>>52	byte	x	%02X
63>>>53	byte	x	%02X
64>>>54	byte	x	%02X
65>>>55	byte	x	%02X,
66>56	string	>\0	name: '%s'
67
68# Little-endian values
698	string	\254\313\272\365\002\000\000\000	ZFS shapshot (little-endian machine),
70>16	lelong	x	version %u,
71>32	lelong	0	type: NONE,
72>32	lelong	1	type: META,
73>32	lelong	2	type: ZFS,
74>32	lelong	3	type: ZVOL,
75>32	lelong	4	type: OTHER,
76>32	lelong	5	type: ANY,
77>32	lelong	>5	type: UNKNOWN (%u),
78>47	byte	x	destination GUID: %02X
79>46	byte	x	%02X
80>45	byte	x	%02X
81>44	byte	x	%02X
82>43	byte	x	%02X
83>42	byte	x	%02X
84>41	byte	x	%02X
85>40	byte	x	%02X,
86>48	ulong	>0
87>>52	ulong	>0
88>>>55	byte	x	source GUID: %02X
89>>>54	byte	x	%02X
90>>>53	byte	x	%02X
91>>>52	byte	x	%02X
92>>>51	byte	x	%02X
93>>>50	byte	x	%02X
94>>>49	byte	x	%02X
95>>>48	byte	x	%02X,
96>56	string	>\0	name: '%s'
97