zfs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. # Big-endian values
  38. 8 string \000\000\000\002\365\272\313\254 ZFS shapshot (big-endian machine),
  39. >20 belong x version %u,
  40. >32 belong 0 type: NONE,
  41. >32 belong 1 type: META,
  42. >32 belong 2 type: ZFS,
  43. >32 belong 3 type: ZVOL,
  44. >32 belong 4 type: OTHER,
  45. >32 belong 5 type: ANY,
  46. >32 belong >5 type: UNKNOWN (%u),
  47. >40 byte x destination GUID: %02X
  48. >41 byte x %02X
  49. >42 byte x %02X
  50. >43 byte x %02X
  51. >44 byte x %02X
  52. >45 byte x %02X
  53. >46 byte x %02X
  54. >47 byte x %02X,
  55. >48 ulong >0
  56. >>52 ulong >0
  57. >>>48 byte x source GUID: %02X
  58. >>>49 byte x %02X
  59. >>>50 byte x %02X
  60. >>>51 byte x %02X
  61. >>>52 byte x %02X
  62. >>>53 byte x %02X
  63. >>>54 byte x %02X
  64. >>>55 byte x %02X,
  65. >56 string >\0 name: '%s'
  66. # Little-endian values
  67. 8 string \254\313\272\365\002\000\000\000 ZFS shapshot (little-endian machine),
  68. >16 lelong x version %u,
  69. >32 lelong 0 type: NONE,
  70. >32 lelong 1 type: META,
  71. >32 lelong 2 type: ZFS,
  72. >32 lelong 3 type: ZVOL,
  73. >32 lelong 4 type: OTHER,
  74. >32 lelong 5 type: ANY,
  75. >32 lelong >5 type: UNKNOWN (%u),
  76. >47 byte x destination GUID: %02X
  77. >46 byte x %02X
  78. >45 byte x %02X
  79. >44 byte x %02X
  80. >43 byte x %02X
  81. >42 byte x %02X
  82. >41 byte x %02X
  83. >40 byte x %02X,
  84. >48 ulong >0
  85. >>52 ulong >0
  86. >>>55 byte x source GUID: %02X
  87. >>>54 byte x %02X
  88. >>>53 byte x %02X
  89. >>>52 byte x %02X
  90. >>>51 byte x %02X
  91. >>>50 byte x %02X
  92. >>>49 byte x %02X
  93. >>>48 byte x %02X,
  94. >56 string >\0 name: '%s'