1284194Sdelphij#------------------------------------------------------------------------------ 2284194Sdelphij# zfs: file(1) magic for ZFS dumps 3284194Sdelphij# 4284194Sdelphij# From <rea-fbsd@codelabs.ru> 5284194Sdelphij# ZFS dump header has the following structure (as per zfs_ioctl.h 6284194Sdelphij# in FreeBSD with drr_type is set to DRR_BEGIN) 7284194Sdelphij# 8284194Sdelphij# enum { 9284194Sdelphij# DRR_BEGIN, DRR_OBJECT, DRR_FREEOBJECTS, 10284194Sdelphij# DRR_WRITE, DRR_FREE, DRR_END, 11284194Sdelphij# } drr_type; 12284194Sdelphij# uint32_t drr_pad; 13284194Sdelphij# uint64_t drr_magic; 14284194Sdelphij# uint64_t drr_version; 15284194Sdelphij# uint64_t drr_creation_time; 16284194Sdelphij# dmu_objset_type_t drr_type; 17284194Sdelphij# uint32_t drr_pad; 18284194Sdelphij# uint64_t drr_toguid; 19284194Sdelphij# uint64_t drr_fromguid; 20284194Sdelphij# char drr_toname[MAXNAMELEN]; 21284194Sdelphij# 22284194Sdelphij# Backup magic is 0x00000002f5bacbac (quad word) 23284194Sdelphij# The drr_type is defined as 24284194Sdelphij# typedef enum dmu_objset_type { 25284194Sdelphij# DMU_OST_NONE, 26284194Sdelphij# DMU_OST_META, 27284194Sdelphij# DMU_OST_ZFS, 28284194Sdelphij# DMU_OST_ZVOL, 29284194Sdelphij# DMU_OST_OTHER, /* For testing only! */ 30284194Sdelphij# DMU_OST_ANY, /* Be careful! */ 31284194Sdelphij# DMU_OST_NUMTYPES 32284194Sdelphij# } dmu_objset_type_t; 33284194Sdelphij# 34284194Sdelphij# Almost all uint64_t fields are printed as the 32-bit ones (with high 35284194Sdelphij# 32 bits zeroed), because there is no simple way to print them as the 36284194Sdelphij# full 64-bit values. 37284194Sdelphij 38284194Sdelphij# Big-endian values 39284194Sdelphij8 string \000\000\000\002\365\272\313\254 ZFS shapshot (big-endian machine), 40284194Sdelphij>20 belong x version %u, 41284194Sdelphij>32 belong 0 type: NONE, 42284194Sdelphij>32 belong 1 type: META, 43284194Sdelphij>32 belong 2 type: ZFS, 44284194Sdelphij>32 belong 3 type: ZVOL, 45284194Sdelphij>32 belong 4 type: OTHER, 46284194Sdelphij>32 belong 5 type: ANY, 47284194Sdelphij>32 belong >5 type: UNKNOWN (%u), 48284194Sdelphij>40 byte x destination GUID: %02X 49284194Sdelphij>41 byte x %02X 50284194Sdelphij>42 byte x %02X 51284194Sdelphij>43 byte x %02X 52284194Sdelphij>44 byte x %02X 53284194Sdelphij>45 byte x %02X 54284194Sdelphij>46 byte x %02X 55284194Sdelphij>47 byte x %02X, 56284194Sdelphij>48 ulong >0 57284194Sdelphij>>52 ulong >0 58284194Sdelphij>>>48 byte x source GUID: %02X 59284194Sdelphij>>>49 byte x %02X 60284194Sdelphij>>>50 byte x %02X 61284194Sdelphij>>>51 byte x %02X 62284194Sdelphij>>>52 byte x %02X 63284194Sdelphij>>>53 byte x %02X 64284194Sdelphij>>>54 byte x %02X 65284194Sdelphij>>>55 byte x %02X, 66284194Sdelphij>56 string >\0 name: '%s' 67284194Sdelphij 68284194Sdelphij# Little-endian values 69284194Sdelphij8 string \254\313\272\365\002\000\000\000 ZFS shapshot (little-endian machine), 70284194Sdelphij>16 lelong x version %u, 71284194Sdelphij>32 lelong 0 type: NONE, 72284194Sdelphij>32 lelong 1 type: META, 73284194Sdelphij>32 lelong 2 type: ZFS, 74284194Sdelphij>32 lelong 3 type: ZVOL, 75284194Sdelphij>32 lelong 4 type: OTHER, 76284194Sdelphij>32 lelong 5 type: ANY, 77284194Sdelphij>32 lelong >5 type: UNKNOWN (%u), 78284194Sdelphij>47 byte x destination GUID: %02X 79284194Sdelphij>46 byte x %02X 80284194Sdelphij>45 byte x %02X 81284194Sdelphij>44 byte x %02X 82284194Sdelphij>43 byte x %02X 83284194Sdelphij>42 byte x %02X 84284194Sdelphij>41 byte x %02X 85284194Sdelphij>40 byte x %02X, 86284194Sdelphij>48 ulong >0 87284194Sdelphij>>52 ulong >0 88284194Sdelphij>>>55 byte x source GUID: %02X 89284194Sdelphij>>>54 byte x %02X 90284194Sdelphij>>>53 byte x %02X 91284194Sdelphij>>>52 byte x %02X 92284194Sdelphij>>>51 byte x %02X 93284194Sdelphij>>>50 byte x %02X 94284194Sdelphij>>>49 byte x %02X 95284194Sdelphij>>>48 byte x %02X, 96284194Sdelphij>56 string >\0 name: '%s' 97