Mounting zfs backups

zBrain

Renowned Member
Apr 27, 2013
38
0
71
I have some VMs running with disks on zvol in Proxmox. I am using sanoid/syncoid to push zfs snapshots to a FreeNAS box as backup - but I'm curious if I can mount the snapshot read only and extract single files. The filesystem on the VM is ext4 if that matters.

Purely educational at this point, I'd like to know what is possible before I need it in a hurry.
 
Yes, that's possible:
Just clone the desired snapshot to a new name. We need a clone, because some filesystems write to it while opening (resetting journal and such). The newly cloned dataset will have a zvol entry in /dev/zvol/<poolname>/<dataset> and the partitions can be exposed by running kpartx. Afterwards you can just mount the partition and do your recovery.