One of the new features in natty is the “apt-btrfs-snapshot” package. Its for people who use a btrfs install of natty. Once installed 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. Its build on top of the btfs snapshot feature and will work out of the box with the filesystem layout that a natty alpha3 btrfs install creates.
March 10, 2011 at 8:34 pm |
Sounds cool, but I would think about adding /var to exception list. Imagine you have a database on the same machine. You wouldn’t want to roll that back
March 10, 2011 at 8:44 pm |
Things like databases really belong under /srv, and probably should be moved if not there already, but that does bring up the point that /usr/local and /opt should also be excluded, pretty much anywhere that the regular packaging system shouldn’t be touching.
March 10, 2011 at 8:56 pm |
Perhaps that suggests that Apache (et al), MySQL (et al) don’t use sane defaults. They all use /var/. If you’re saying that’s incorrect, why do they default there?
March 10, 2011 at 10:14 pm |
/srv is a much newer part of FHS than those programs, so they probably haven’t changed due to inertia.
March 10, 2011 at 10:24 pm |
wow that’s awesome
Thanks mvo
March 11, 2011 at 12:05 am |
Databases aren’t the only important things in /var — consider also /var/log and /var/mail.
March 11, 2011 at 3:14 am |
How come that is available in Ubuntu but not in Debian?????????????? WTF
March 11, 2011 at 8:04 am |
Its just very new, there is no reason not to have it in debian, I expect it to be there really soon.
February 11, 2013 at 8:37 am
What’s the state of apt-btrfs-snapshot for Debian? New releases are made then and now, but still no sign of it in Debian, not even an ITP.
Is Ubuntu’s default file system layout so hardwired that it’s not as flexible as it will need to be to be useful in Debian?
February 12, 2013 at 5:53 am
The way it works in Ubuntu is that the d-i creates seperate subvolumes for / and /home at install time so that /home can be excluded from the snapshots. apt-btrfs-snapshot should work fine in debian when “/” and “/home” are put on seperate paritions or if d-i would use a similar subvolume schema (which is probably useful in more contexts than just apt-btrfs-snapshot). I’m happy to help with the ITP/adaptation for debian.
March 11, 2011 at 7:16 am |
Of course, /var was just an example. Excluding every directory that packages don’t touch should be by default (/root, /home/ /usr/local, /srv…). I do agree that /srv should be a place for services’ content. But /var is much more than; at least some parts of it need to be excluded.
There’s no easy way to roll back all the changes a deb package makes (think or preinst and postinst scripts), so as far as I can tell, this does look like the best approach.
September 20, 2011 at 6:53 am |
it’s very broken. When using Ubuntu update-manager it returns the error
installArchives() failed: Create a snapshot of ‘/tmp/apt-btrfs-snapshot-mp-q1iAGQ/@’ in ‘/tmp/apt-btrfs-snapshot-mp-q1iAGQ/@apt-snapshot-2011-09-20_08:51:37′
Create a snapshot of ‘/tmp/apt-btrfs-snapshot-mp-baDHhK/@’ in ‘/tmp/apt-btrfs-snapshot-mp-baDHhK/@apt-snapshot-2011-09-20_08:51:37/@’
Create a snapshot of ‘/tmp/apt-btrfs-snapshot-mp-0WH8Ka/@’ in ‘/tmp/apt-btrfs-snapshot-mp-0WH8Ka/@apt-snapshot-2011-09-20_08:51:37/@’
Also there is no man page for it, to tell what options are available.
I’ve reported this bug at
https://bugs.launchpad.net/bugs/853849
September 20, 2011 at 6:54 am |
sorry the error part didn’t copy
ERROR: cannot snapshot ‘/tmp/apt-btrfs-snapshot-mp-gD3PJM/@’
July 12, 2012 at 12:25 am |
This is *really* badly made. Try restoring a snapshot that doesn’t exist (make a typo). It will give an error and you won’t be able to boot afterwards.
I’ve made a fork here to start fixing errors:
https://github.com/skorokithakis/apt-btrfs-snapshot
Maybe mvo could follow and pull, I’d hate the releases in the repos to be *this* broken.
July 12, 2012 at 7:18 am |
I appreciate bugreport and will merge any fixes, this one is now in http://bazaar.launchpad.net/~mvo/apt-btrfs-snapshot/trunk/revision/42