Complete backup (including zvols) to target system (ssh/rsync) with no ZFS support

sargue

Cadet
Joined
Mar 1, 2023
Messages
2
Hi there,

First post and yet another backup question. Please bear with me.

I've just installed TrueNAS scale for the first time which I plan to use for some shares and also at least one VM (holding Proxmox Backup Server) which uses zvols for the drives. My target system for backups has ssh and rsync available but no option to use ZFS. As far as I understand it's quite easy to add a rsync task for backup of the filesystem datasets. But that won't include zvols and everywhere I've looked seems the only options is to use a target zfs system.

Can someone confirm this is the case and it's not possible? Or am I missing something?

I really tried to find the answer through the documentation and this forum and I think it's not possible, but I just wanted to ask in case I'm missing something.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
A zvol sent with zfs send is just a stream of bytes so instead of zfs receive into an equivalent zvol on the target system you can save it as a file.

zfs send pool/path/to/zvol@20230302 | gzip -c >/mnt/some/location/zvol@20230302.gz

This file can be copied to a system without ZFS support. You will not be able to create incremental backups this way, though. Each copy takes up the full space - not the nominal size, of course, but all the data "in" the zvol after compression.
 

sargue

Cadet
Joined
Mar 1, 2023
Messages
2
Oh, very interesting! Thank you so much, I think that will solve my problem. Now I can just play a bit with it to automate and optimize it (perhaps rsync can help with the differences).

Not having incremental backups for zvols is not a major problem in my case.

Again, thanks for the helpful response.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
For restore just do the inverse: gzip -dc /mnt/some/location/zvol@20230302.gz | zfs receive pool/path/to/zvol.
 
Top