How does apt-btrfs-snapshot work?

I read on the planet that apt-btrfs-snapshot would be available for Natty. The brief description of what it does sounds very nice:

it will automatically create filesystem snapshot (of everything but /home) when apt installs/removes/upgrades. With the apt-btrfs-snapshot cli app its easy to list/remove/rollback the snapshots

But before I convert my entire life to btrfs for the sole purpose of gaining a built-in backup system, can anybody tell me how btrfs's snapshots work. To my layman's brain, it sounds like this would eat a devastating amount of disk space if you're taking snapshots every time you install or upgrade something (I do this more than once a day).

I assume the system is smarter than I'm allowing it but I really don't know. How do the snapshots work?


Solution 1:

I don't know apt-btrfs-snapshot, but from what I read rapidly in the code, it simply use the btrfs snapshot feature before apt's actions.

btrfs uses a lot of B-trees to hold data. Duplication is kept to minimum (not even using hardlink, but copy-on-write). Read: "it will use as much more-memory that you delete data outside /home".

EDIT:

After reading the code, apt-btrfs-snapshot have some problems. For example:

  • it makes big assumptions: your btrfs must have specific subvolume's name (your root subvolume must be named "@")
  • if your /home and /var/lib are on the same subvolume as your root /, they will also be snapshotted.