[arch-general] Btrfs snapshots for upgrade operations

Leonidas Spyropoulos artafinde at gmail.com
Fri Oct 26 03:33:06 EDT 2012


Hey Tom

On Thu, Oct 25, 2012 at 4:02 PM, Tom Gundersen <teg at jklm.no> wrote:
> On Thu, Oct 25, 2012 at 3:50 PM, Leonidas Spyropoulos
> <artafinde at gmail.com> wrote:
>> Archlinux is supporting btrfs for root filesystem some time now. Have any
>> work or thoughts been done for supporting snapshots before update packages?
>> This way you can keep record of what's happening to your system and easily
>> rollback if something breaks.
>> I know Fedora and Suse (if not mistaken) supports that with their package
>> managers.
>
> I put together a proof-of-concept a while back for doing something
> like this. It "worked", but was nowhere near ready for public
> consumption, so I never posted it anywhere.
>

Would you be able to share it?

> What I thought would be nice was the ability for an upgrade to take
> effect on the next reboot without touching the running system. No need
> to integrate with pacman, a wrapper in bash would do.
>
> It went something like this (assuming / is on btrfs):
>
> create a new subvolume as a snapshot of /
> mount the new subvolume on /mnt/
> pacman -Syu --root=/mnt
> mark the new subvolume as the default one
>
> This means the current rootfs is not touched at all during the
> upgrade. However, next time the rootfs is remounted (i.e., on the next
> reboot) you will get the upgraded system. Moreover, if something went
> pear shaped, the subvolume of your old system should still be around
> which you can boot into with the right kernel parameter.
>
> Obviously any changes you do to the rootfs after creating the snapshot
> will be lost on the next reboot, so some care must be taken to make
> sure you know what you are doing :-) (it might be reasonable to only
> allow this if the rootfs is mounte read-only).
>
> Cheers,
>
> Tom

There is an interesting conversation in btrfs maling list happening now :
http://comments.gmane.org/gmane.comp.file-systems.btrfs/20738

-- 
Caution: breathing may be hazardous to your health.

#include <stdio.h>
int main(){printf("%s","\x4c\x65\x6f\x6e\x69\x64\x61\x73");}


More information about the arch-general mailing list