Question about ZFS Volume Backup

Hello there,

First, I would like to say that I recently started using Incus and it’s a really nice project. Thank you for all the great work!

I am in the process of migrating from Podman, where I used bind mounts to simplify my backup and restore process. However, since I am very interested in using Incus OS, I assume bind mounts will no longer be an option due to the lack of shell. This has led me to explore native volumes, which seem to offer nice features like the “shifted” property and ZFS snapshots.

Therefore, I was wondering what the recommended “Incus way” is for backing up custom ZFS volumes. I’ve seen that it’s possible to create snapshots, but I could not find an option to export the difference between snapshots, only a full export of a volume’s current state.

Does this mean that to back up a 5GB volume, a new 5GB export must be created each time, even if no diff occured since the last snapshot? Or have I missed something?

If my understanding is correct, is there an hidden option to export an incremental diff between two snapshots of the same volume? If not, could this functionality be added to the Incus API in the future?

Thank you in advance for the help

ZFS doesn’t really give us a way to grab just the file difference between two snapshots, but what it does is let us transfer the binary difference between two snapshots.

The way you’d typically do that with Incus is by using two servers, one that runs the instance and has the original of the volumes and one that acts as a backup server.

You can then create snapshots (probably automatically through snapshots.schedule) and then use incus copy --refresh and incus storage volume copy --refresh to transfer the delta from the source server to the backup server.

This way lets you effectively transfer only the delta since the last shared snapshot between the two servers. It’s something that’s rather commonly done by large scale hosting providers using Incus with ZFS.