Backing up TrueNAS VMs to non-ZFS server

dalnew

Dabbler
Joined
Dec 9, 2020
Messages
26
Hey all, sorry if this has been covered before but I couldn't find any threads on this. I am currently doing a 2 stage backup of my TrueNAS scale server that backs up to another zfs server and also to a synology NAS. The synology is obviously not running ZFS so what I do is mount the snapshots and then rsync all the data over. Obviously it doesn't backup any of the zfs specific dataset info but all the files should be there, and more importantly immediately accessible in case both other zfs servers die.

This is the process I follow:
  1. Stop any VMs that are running
  2. Take a recursive snapshot of the datasets in the pool
  3. Replicate the snapshots to the other zfs server
  4. Load the snapshots from #1 to a temp mount point and rsync everything over to the synology (offsite backup)
  5. Restart any VMs that were running
The problem I run into is in #4. I have a set of datasets that looks like this

tank/VMs
tank/VMs/Windows-abcdef
tank/VMs/Windows-123456

The top level dataset (tank/VMs) mounts fine into the temporary directory but the VMs (Windows-#####) won't mount and result in an error when trying to mount:
# sudo mount -t zfs -o ro tank/VMs/Windows-t1qg1o@auto-2023-01-31_02-05 /mnt/tmp
unable to fetch ZFS version for filesystem 'tank/VMs/Windows-t1qg1o@auto-2023-01-31_02-05'

So maybe this is because it's a windows VM and the data isn't actually a zfs dataset, but some other kind? I tried mounting other ways but it still doesn't seem to work. Basically I just want to be able to dynamically figure out how to mount it so the files are accessible and back all those up over rsync to the synology.

Maybe I am overcomplicating this? They backup/replicate fine to the other zfs server so that one is ok, but is there a better way to backup those VMs using rsync to a non-zfs server?

Thanks!
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Zvols are not visible as files that can be accessed by e.g. rsync. But you can save them as files for backup purposes.

Code:
zfs snap tank/VMs/Windows-123456@backup-20230202
zfs send tank/VMs/Windows-123456@backup-20230202 | gzip -c >/mnt/tank/some/dataset/Windows-123456@backup-20230202.gz


Or pipe into ssh to some other system and save there without the need for an intermediate local file.
 
Top