Support for snapshotting (-vss) when running on a BTRFS filesystem

TLDR: VSS support for BTRFS filesystem would be great to have.

Longer version: I’m running duplicacy on a Synology DSM. I felt a bit uneasy about live backup without snapshotting but was’t really giving it too much thought.

It just recently occurred to me that the native backup solution on those devices – HyperBackup – does take a snapshot before backing up; which is a good indication that this use case it polished to death on those appliances.

It would be therefore really awesome if duplicacy supported that.

Snapshotting on a BTRFS is fairly trivial. You would mount the volume somewhere, and then when done – delete it (no dance around tmutil like on a Mac :))

ash-4.3# mkdir /volume1/Data/_snp0000001
ash-4.3# btrfs subvolume snapshot -r /volume1/homes /volume1/Data/_snp0000001
Create a readonly snapshot of '/volume1/homes' in '/volume1/Data/_snp0000001/homes'
ash-4.3# #Do the thing
ash-4.3# btrfs subvolume delete -c /volume1/Data/_snp0000001/homes
Delete subvolume (commit): '/volume1/Data/_snp0000001/homes'
ash-4.3# rm -r /volume1/Data/_snp0000001

As a prerequisite the user duplicacy is running under should be added to the sudoers file to allow btrfs utilities.

3 Likes

Thanks saspus, trying it out. Are you aware of any negative effects of creating the snapshot folder inside the actual folder you are backing up? - obviously the backup would then be from the newly created snapshot folder, not the folder itself, but just wondering. If scheduled Synology snapshot replication is turned on will this snapshot the snapshot folder? I don’t really want my local snapshots polluted with this.

Also, how do you get around permissions for running the btrfs executable as a limited user in your script or are you running that as admin?