While I was working on a few [STRIKEOUT:large] huge packages for archlinux, my btrfs harddrive slowly filled without me noticing. I did run df once in a while, but it showed lots of free space. Still, I was suddenly unable to do anything, because of free space errors. Even removing files was impossible, giving me the error: "rm: Cannot remove file, no space left on device".

Somebody mentioned that echo > somefile might help, but it didn't. Neither did dd if=/dev/null of=somefile.

Following is a simple list of steps I had to do to be able to use this PC again without reformatting.

Reboot using a live disk. (I used a flash drive with the newest Arch Linux ISO)

Mount the device with the problem

Check metadata space in use Then to check how much of the metadata space is being used:

# btrfs fi df /mount/point
Data: total=21.01GB, used=10.95GB
System, DUP: total=40.00MB, used=4.00KB
System: total=4.00MB, used=0.00
Metadata, DUP: total=1.00GB, used=997.81MB
Metadata: total=8.00MB, used=0.00

As you can see, almost all the Metada is in use. This is why no files can be removed. A partial rebalance can solve this problem by reordering used space to get just a little bit back, enough to delete some files.


...Profit Then just unmount, reboot and make sure to watch your metadata space in the future.