Ubuntu upgrades and BTRFS snapshots

One of my VMs is running Ubuntu with BTRFS on the boot disk. During an Ubuntu upgrade, I noticed a significant increase in disk space usage, and it turns out Ubuntu created a snapshot on my BTRFS volumes. Now, this is pretty neat, but once I verified everything was working fine, I wanted to delete the old snapshot. It turned out to be a bit more trickier than I though, but with some help from Sami Haahtinen, I got it to work. First, to list the sub volumes, I did

ubuntu-server (16:07) 3/0 $ sudo btrfs subvolume list /
ID 256 top level 5 path @
ID 257 top level 5 path @home
ID 258 top level 5 path @apt-snapshot-release-upgrade-oneiric-2011-10-13_12:41:44

The next step, which was crucial, is to "mount" the full disk BTRFS is using, without specifying a sub-volume:

ubuntu-server (16:09) 4/0 $ sudo mount /dev/mapper/ubuntu--server-slash /mnt

Your disk name will obviously differ (most likely), but after this, you can now delete this sub-volume:

ubuntu-server (16:09) 5/0 $ cd /mnt
ubuntu-server (16:10) 6/0 $ sudo btrfs subvolume delete '@apt-snapshot-release-upgrade-oneiric-2011-10-13_12:41:44'

Hacking: 

Comments