ZFS: Is there a way to find out where the blocks for a file are stored?
This is non trivial and possibly beyond the scope of an SF question/answer as the tools required don't appear well documented. You can probably use zdb(1m) in conjunction with the on disk format doc to find the information you want. There is a blog on how to do this here
Essentially
use ls -i
to get the initial inode.
use zdb -ddddd <inodenum>
to get the block information and decode it using the ODF
You can use ls -i
to see the initial inode, after that I'd suggest reading the source code published to understand the on-disk data structures. After you've completed that I'd suggest writing your own tools to read the raw device and assemble all the block layout information you're interested in. There is a small-ish ZFS API (libzfs) project that only offers basic ZFS configuration like listing, creating etc. zpools.