BTRFS/Rollback & Yum Snapshot Plugin

Jorge Fábregas jorge.fabregas at gmail.com
Fri Jan 31 01:02:13 UTC 2014


Hi everyone,

I'm playing around with btrfs (this time on a Fedora 20 VM).  I used the
default configuration for btrfs that Anaconda provides.  Right after
installation I did:

#btrfs subvolume list /
ID 257 gen 102 top level 5 path root
ID 258 gen 102 top level 5 path home

I then installed the yum-plugin-fs-snapshot package to try it out.  I
installed some updates and after it:

#btrfs subvolume list /
ID 257 gen 102 top level 5 path root
ID 258 gen 102 top level 5 path home
ID 278 gen 95 top level 257 path yum_20140130172422
ID 279 gen 97 top level 5 path home/yum_20140130172422

Fine.  yum created the snapshots.  I then wanted to rollback my system
(to the state prior to the updates) so I went ahead and changed the
rootflags=subvol... parameter in GRUB's kernel line in order to specify
the above snapshot for the root filesytem.  (I also changed /etc/fstab
to point /home to the snapshot subvolume).  After booting, everything
seemed right (I was running off the snapshot subvolumes).

Now, here's the thing.  I wanted to permanently run off these snapshots
so I wanted to delete the parent "subvolumes" for these snapshots (e.g.
"commit" the snapshot) by doing:

# mount -o subvolid=5 /dev/vda3 /mnt
# btrfs subvolume delete /mnt/root
Delete subvolume '/mnt/root'
ERROR: cannot delete '/mnt/root' - Device or resource busy

I believe this is happening because the snapshots are being created
WITHIN the subvolume they're snapshotting against.  That is, I can't
delete it because the currently running root snapshot,
yum_20140130172422, resides inside the "root" subvolume.   Is this
theory correct?  Can you modify the yum plugin so that it places its
snapshots within OTHER particular subvolume?

BTW,  is there anyone out there using this plugin with btrfs?

Thanks!
Jorge

p.d. I know snapshotting /home doesn't make sense at all for yum updates
but I followed it along...


More information about the users mailing list