Bug#752998: Re: Bug#752998: zfs dump magic

2022-12-03 Thread 王昊然
> Now I'm confused. Your attached file is virtually identical to
> magic/Magic/zfs in the file(1) sources, and is present since 5.11
> which is in wheezy.

ZFS stream (dump) format is not ZFS on-disk format.



Bug#752998: zfs dump magic

2016-07-16 Thread Christoph Biedl
tags 752998 moreinfo
thanks

Russell Coker wrote...

> https://wiki.freebsd.org/ZFS
> 
> I have attached a magic file for ZFS dumps downloaded from the above page.  I 
> have never tested it but I expect that the FreeBSD people know what they are 
> doing.

Now I'm confused. Your attached file is virtually identical to
magic/Magic/zfs in the file(1) sources, and is present since 5.11
which is in wheezy.

Did I miss something?

Christoph


signature.asc
Description: Digital signature


Bug#752998: zfs dump magic

2014-06-30 Thread Russell Coker
https://wiki.freebsd.org/ZFS

I have attached a magic file for ZFS dumps downloaded from the above page.  I 
have never tested it but I expect that the FreeBSD people know what they are 
doing.


-- 
My Main Blog http://etbe.coker.com.au/
My Documents Bloghttp://doc.coker.com.au/
#--
# zfs:  file(1) magic for ZFS dumps
#
# From rea-f...@codelabs.ru
# ZFS dump header has the following structure (as per zfs_ioctl.h
# in FreeBSD with drr_type is set to DRR_BEGIN)
#
#   enum {
#   DRR_BEGIN, DRR_OBJECT, DRR_FREEOBJECTS,
#   DRR_WRITE, DRR_FREE, DRR_END,
#   } drr_type;
#   uint32_t drr_pad;
#   uint64_t drr_magic;
#   uint64_t drr_version;
#   uint64_t drr_creation_time;
#   dmu_objset_type_t drr_type;
#   uint32_t drr_pad;
#   uint64_t drr_toguid;
#   uint64_t drr_fromguid;
#   char drr_toname[MAXNAMELEN];
#
# Backup magic is 0x0002f5bacbac (quad word)
# The drr_type is defined as
#   typedef enum dmu_objset_type {
# DMU_OST_NONE,
# DMU_OST_META,
# DMU_OST_ZFS,
# DMU_OST_ZVOL,
# DMU_OST_OTHER,  /* For testing only! */
# DMU_OST_ANY,/* Be careful! */
# DMU_OST_NUMTYPES
#  } dmu_objset_type_t;
#
# Almost all uint64_t fields are printed as the 32-bit ones (with high
# 32 bits zeroed), because there is no simple way to print them as the
# full 64-bit values.

# Big-endian values
8  string  \000\000\000\002\365\272\313\254 ZFS shapshot (big-endian 
machine),
20belong  0   version %lu,
32belong  0type: NONE,
32belong  1type: META,
32belong  2type: ZFS,
32belong  3type: ZVOL,
32belong  4type: OTHER,
32belong  5type: ANY,
32belong  5
32belong  0  type: UNKNOWN (%lu),
40byte0   destination GUID: %02X
41byte0   %02X
42byte0   %02X
43byte0   %02X
44byte0   %02X
45byte0   %02X
46byte0   %02X
47byte0   %02X,
48ulong   0
52ulong   0
48byte0 source GUID: %02X
49byte0 %02X
50byte0 %02X
51byte0 %02X
52byte0 %02X
53byte0 %02X
54byte0 %02X
55byte0 %02X,
56string  \0  name: '%s'

# Little-endian values
8  string  \254\313\272\365\002\000\000\000 ZFS shapshot (little-endian 
machine),
16lelong  0   version %lu,
32lelong  0type: NONE,
32lelong  1type: META,
32lelong  2type: ZFS,
32lelong  3type: ZVOL,
32lelong  4type: OTHER,
32lelong  5type: ANY,
32lelong  5
32lelong  0  type: UNKNOWN (%lu),
47byte0   destination GUID: %02X
46byte0   %02X
45byte0   %02X
44byte0   %02X
43byte0   %02X
42byte0   %02X
41byte0   %02X
40byte0   %02X,
48ulong   0
52ulong   0
55byte0 source GUID: %02X
54byte0 %02X
53byte0 %02X
52byte0 %02X
51byte0 %02X
50byte0 %02X
49byte0 %02X
48byte0 %02X,
56string  \0  name: '%s'