I think I did a mistake when I decided to use Btrfs. I am not using any of its features, but now have troubles with not enough space. I did
sudo btrfs balance start / -v
as suggested in some sources, but still have little space available:
$ sudo btrfs fi df /
Data, single: total=102.00GiB, used=99.55GiB
System, single: total=32.00MiB, used=16.00KiB
Metadata, single: total=2.00GiB, used=762.44MiB
unknown, single: total=256.00MiB, used=0.00
A source suggests to remove snapshots. I found one candidate:
$ sudo btrfs subvolume list /
ID 257 gen 390597 top level 5 path @
ID 258 gen 390597 top level 5 path @home
ID 317 gen 390480 top level 5 path @apt-snapshot-release-upgrade-utopic-2014-10-23_20:38:40
Is it safe to delete @apt-snapshot-release-upgrade-utopic-*
snapshot?
Note: I am using eCryptFS (not sure if this matters in this case).
I've seen a lot of tutorials on how to roll back to one of these snapshots however, on newer versions of ubuntu (tested on 15.04), you nolonger need to mount the filesystem to roll back to a snapshot created through
apt-btrfs-snapshot
.Again, run these commands from a running system, not a mounted partition as you normally would when managing btrfs snapshots.
Just run:
to list the available snapshots and then run the following to revert to an older snapshot:
For this case, you may want to set the default to the existing snapshot.
Reboot for the changes to take effect.
Also, deleting snapshots is now much more reliable and simple. Again, to list snapshots, run:
Then, to delete a snapshot, run:
To list by date older than two days, for example, run:
To delete all snapshots older than two days, for example, run:
The cool thing is that your old default will not be deleted so you can still roll back to that one if you have one set.
Deleting snapshots should take effect immediately.
If you get a "no space on device" error after you boot, you can attach a blank USB pendrive or external drive and use the command line to mount the drive at /tmp.
After mounting the drive at /tmp you should have enough available space to run:
Looks like it is safe. I've seen other attempts to do this and it turned to be not so simple.
First, run the following command to see which partition is your btrfs partition (assuming you only have one btrfs partition):
The following uses
/dev/sda3
as an example.Here is how I did it:
Here is the correct partition:
Not much space was freed:
A restart helped: