Hello there!
I’m new to TrueNAS but I’m enjoying every minute of it so far.
I’d like to have a geo-redundant backup on my Synology of my ZFS pool. However, I don’t need access to the files on Synology, and I have ~8M files, many of them small. So this means rsync will be really slow, trying to access them one-by-one over the internet.
Is there a way to back up the ZFS pool as a single, huge file, as “raw bits”, or similar?
And related: Would native ZFS replication work on a file-by-file or a “raw bits” basis?
Hello and welcome to the forums.
Replication works at the block level and is often considered the better/faster way to move/backup data with ZFS.
to move/backup data with ZFS.
Which is only possible between two TrueNAS instances, and definitely not when the peer is a Synology, right?
I’m guessing what I’m asking for doesn’t exist - replicating data on a block level, but to a non-ZFS peer (creating something akin to an “.iso file” on the peer).
You can pipe zfs send to a file if you wish but that’s defo outside the scope of the TrueNAS UI. Traditionally something like a tarball.
Thanks for the direction anyway! Might try that and see how far I get, I’m fine with dabbling in the terminal
When something goes wrong and you need to resort to this backup file, what are you going to do with the image file?
You cannot import it as a pool. It still needs to be “sent back” to another ZFS pool in order to access the data.
“Received back,” really. To create the file, you’d run zfs send pool/dataset@snapshot > backupfile.zfs
(with .zfs
chosen somewhat arbitrarily as a file extension, and adding any other flags might be appropriate), and then compress that file in whatever way you like. To restore, zfs receive ... < backupfile.zfs
.
But you’re right, the file isn’t itself importable; it needs an existing ZFS environment to restore to.
This is why I don’t think replicating a ZFS snapshot into a file is pragmatic for backups.
- You cannot immediately access or review the data.
- You cannot just “import” the file.
- You still need to create (or use) a ZFS pool in order to receive the snapshot for a “backup restoration” process.
To backup from ZFS dataset → non-ZFS, the most practical methods are still “file-based” solutions, such as Rsync or your preferred backup software of choice.
Unlike cloning or backing up an entire drive, there’s no partition scheme that needs to be preserved. Tools like “Clonezilla” or drive-to-image software are outside the bounds of ZFS, and don’t really make much sense. (The only time you’d want to image an entire drive in regards to ZFS is for emergency recovery.)
Thank you! I haven’t found conversation about a backup solution like this so it could come in handy.
I’m thinking of this indeed as only an emergency backup, for everything else there are snapshots and drive-redundancy. But the complications of the restore process might just be enough to discourage me - an emergency scenario is exactly when I don’t want to be messing around with the last remaining backup being one humongous file.