You are not logged in.

#1 2015-12-22 09:39:55

Moviuro
Member
Registered: 2012-06-03
Posts: 73

butter - BTRFS snapshot management

Hi all,

I wanted to share a project I've been working on: a drop-in snapshot manager for btrfs: https://github.com/moviuro/butter

I love btrfs because it's like butter: subvolumes you can manipulate in any way you can imagine is just awesome.
But I ran into meta data space issues as I kept too many snapshots, hence the need for a "cycle of retention": keep 12 hourly snapshots of /home, keep 30 dailies of /, /var, etc.

ATM, it relies on systemd-escape(1) (will not require it anymore in an upcoming release), /etc/machine-id, bash and extended attributes (setfattr(1) and getfattr(1)).

Usage should be straight-forward and is explained in README.md.
Current config can ATM be shown using `butter list`. (command name is obscure and will change).

Any feedback, PRs, love letters welcome.

Last edited by Moviuro (2016-01-05 09:27:00)


bspwm, BTRFS over LUKS
Archlinux a lot, FreeBSD more and more...
Murphy's rule: The day you need a backup, you tell yourself you should have created some.

Offline

#2 2015-12-23 08:48:18

likytau
Member
Registered: 2012-09-02
Posts: 142

Re: butter - BTRFS snapshot management

I don't really understand the value of snapshots TBH : I've researched them, and they seem kind of related conceptually to versioning with Git, but without the typical quality I want in an actual backup (being guaranteed to be stored on a different hardware device from the original). Is there something I'm missing there?

.. Clearly the name your program is destined to have is 'buttshot' wink

Offline

#3 2015-12-23 09:09:42

Moviuro
Member
Registered: 2012-06-03
Posts: 73

Re: butter - BTRFS snapshot management

Snapshots are in the simplest case just a point in time of your FS. no granularity like git, but that's not the point. The point of snapshots is to prevent unwanted data loss by keeping on disk some of the most recent changes.
Say you run

user@machine:~% rm -fr ~/Downloads/ *

If you have a snapshot, you can retrieve your files pretty quickly as they still exist somewhere on it. (rsync or cp them)
Snapshots are not a backup solution though, since if your hard drive fries, well, your snapshots die with it. However, they require far less disk space as full backups (you only store the snapshot's size + the difs to the current state of your subvolume).


bspwm, BTRFS over LUKS
Archlinux a lot, FreeBSD more and more...
Murphy's rule: The day you need a backup, you tell yourself you should have created some.

Offline

#4 2015-12-23 09:30:31

likytau
Member
Registered: 2012-09-02
Posts: 142

Re: butter - BTRFS snapshot management

Yeah, I know how snapshots work in a fairly precise technical sense, I just didn't realize their application as an undo buffer. I think I will give your program a go, then.

Offline

#5 2016-01-05 09:26:27

Moviuro
Member
Registered: 2012-06-03
Posts: 73

Re: butter - BTRFS snapshot management

Hi, I uploaded butter to the AUR: https://aur.archlinux.org/packages/butter/


bspwm, BTRFS over LUKS
Archlinux a lot, FreeBSD more and more...
Murphy's rule: The day you need a backup, you tell yourself you should have created some.

Offline

Board footer

Powered by FluxBB