ZFS physically stores data using DVA (Device Virtual Addresses) offset + length. You can get the relevant data using something as zdb -bbb -vvv <dataset> -O <filename>
. You should keep in mind that:
- while ZFS stores DVA offset in 512-byte sectors on disk,
zdb
translate them in bytes
zdb
output such numbers in hex format
- offset 0 start after a 4 MB header on each disk.
For example, on a just created (and otherwise empty) test pool:
root@localhost:~# zpool status
pool: tank
state: ONLINE
config:
NAME STATE READ WRITE CKSUM
tank ONLINE 0 0 0
/root/disks/disk1.img ONLINE 0 0 0
root@localhost:~# cp /etc/services /tank/
root@localhost:~# zdb -bbb -vvv tank -O services
...
Indirect blocks:
0 L0 DVA[0]=<0:10007000:4000> [L0 ZFS plain file]
# some math:
# 0x10007000 == 268464128 == 65543 4K blocks
# 65543 + 1024 4K blocks (header) == 66567 4K blocks
# our file starts at 4k offset 66567
# check with dd over the raw device (a backing file, in this test)
root@localhost:~# dd if=/root/disks/disk1.img bs=4k count=1 skip=66567 | head -3
1+0 records in
1+0 records out
4096 bytes (4.1 kB, 4.0 KiB) copied, 2.3434e-05 s, 175 MB/s
# Network services, Internet style
#
# Updated from https://www.iana.org/assignments/service-names-port-numbers...
Some references:
https://utcc.utoronto.ca/~cks/space/blog/solaris/ZFSDVAOffsetVdevDetails
https://utcc.utoronto.ca/~cks/space/blog/solaris/ZFSDVAOffsetsInBytesII