Hi all,
I follow Wendell on YouTube and enjoy the content very much.
Recently I faced a problem which I couldn’t find a solution
I use zfs on linux which supports taking snapshot. Is there a way to to take snapshots only if there’s a change in the files? (I saw something in Truenas which says “don’t allow empty snapshots”)
NB. I use znapzend to snapshot my pools and replicate them to an off-site pool.
Normally you want to take a snapshot even if no change has taken place. The snapshot will take up zero extra space, and the replication will be very fast. If you don’t take a snapshot it can cause issues with some retention algorithms for backup software (time based vs snapshot count based).
When you see 0B USED on a snapshot, that does not mean it’s “empty.” That means that there are no blocks present in that snapshot that are not present in at least one other snapshot (including the live filesystem).
It is “safe” to delete a single snapshot which has 0B USED without risk of losing data. But you can’t delete another one “safely” until you do a new zfs list and recheck the USED for the nextsnapshot you’re thinking of deleting.
If empty snapshots are making things unreadable in the Cli, , may instead consider just filtering out the empty ones instead of deleting them. For a better way of looking through the contents of a snapshot, httm (“hot tub Time Machine”) is a neat tool.