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.

15 Responses to “apt-btrfs-snapshot”

  1. Ante Says:

    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 🙂

  2. Chris Says:

    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.

  3. Oli Says:

    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?

  4. Chris Says:

    /srv is a much newer part of FHS than those programs, so they probably haven’t changed due to inertia.

  5. Ahmed Kamal Says:

    wow that’s awesome 🙂 Thanks mvo

  6. Marius Gedminas Says:

    Databases aren’t the only important things in /var — consider also /var/log and /var/mail.

  7. foo Says:

    How come that is available in Ubuntu but not in Debian?????????????? WTF

    • mvo Says:

      Its just very new, there is no reason not to have it in debian, I expect it to be there really soon.

      • Axel Says:

        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?

      • mvogt Says:

        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.

  8. Ante Says:

    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.

  9. Kat Amsterdam Says:

    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

  10. Kat Amsterdam Says:

    sorry the error part didn’t copy

    ERROR: cannot snapshot ‘/tmp/apt-btrfs-snapshot-mp-gD3PJM/@’

  11. Stavros Korokithakis Says:

    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:


    Maybe mvo could follow and pull, I’d hate the releases in the repos to be *this* broken.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: