I am using ZFS on Linux, and have some question regarding snapshots. I have following structure
mypool/HOME mounts /home
mypool/HOME/root mounts /root
mypool/ROOT mounts none
mypool/ROOT/rootfs mounts /
mypool/ROOT/rootfs/OPT mounts /opt
mypool/ROOT/rootfs/USR mounts /usr
mypool/ROOT/rootfs/VAR mounts /var
mypool/docker mounts /var/lib/docker
I want to backup all of this by cron task
when I run zfs snapshot -r mypool/HOME@today, it creates snapshot recursively.
But after I copy something heavy to /home, and create another snapshot, it shows used 0 or a few kb.
I want to be sure, that it backups mypool/HOME and mypool/HOME/root. is the -r option works for both?
Same with docker. Docker have own snapshots/clones/subvolumes on it's volume. If I do zfs snapshot -r mypool/docker, will it backup all data as it is on this moment? If some subvolumes appear/disappear, can I restore the same state it was from snapshot?