BTRFS: No space left on device despite 95GiB unallocated

Hey there,
I’ve got a little bit of an issue, that I haven’t managed to resolve despite a whole bunch of balancing:

Overall:
    Device size:		 195.03GiB
    Device allocated:		 100.08GiB
    Device unallocated:		  94.95GiB <<<<<<<<
    Device missing:		     0.00B
    Device slack:		     0.00B
    Used:			  89.39GiB
    Free (estimated):		 101.85GiB	(min: 54.37GiB)
    Free (statfs, df):		 101.85GiB
    Data ratio:			      1.00
    Metadata ratio:		      2.00
    Global reserve:		 231.36MiB	(used: 0.00B)
    Multiple profiles:		        no

Data,single: Size:92.02GiB, Used:85.13GiB (92.51%) <<<<<<<<<
   /dev/sda1	  92.02GiB

Metadata,DUP: Size:4.00GiB, Used:2.13GiB (53.36%)
   /dev/sda1	   8.00GiB

System,DUP: Size:32.00MiB, Used:16.00KiB (0.05%)
   /dev/sda1	  64.00MiB

Unallocated:
   /dev/sda1	  94.95GiB

As you can see, I’m almost out of space in terms of data, but for some reason 95GiB are still unallocated. I’m regularly running into “no space left on device” errors during updates and yet I can’t get btrfs to actually use this space. btrfs filesystem resize max / also didn’t resolve this.

Any idea what I’m missing?

Thanks!

What are using, systemd-boot or Grub? I though maybe your ESP is too little for the number of kernels you have installed.

What is the output lsblk -f ?

Grub.

$ lsblk -f
NAME     FSTYPE FSVER LABEL    UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sda
├─sda1   btrfs                 74b3c9a2-de25-46f7-91bc-cc177baa106b  102,1G    46% /var/log
│                                                                                  /var/cache
│                                                                                  /

This returns an inaccurate value. Probably including the unallocated 95GiB

Are you sure it isn’t your EFI partition that is filling up and throwing errors during updates?

definitely. I keep having to delete snapshots and earlier it failed when pacman tried to install a font package.

Do you have the output from where you are getting these out of space errors?

I don’t see any issues in your btrfs output.

If you are talking about this line:

That doesn’t mean you are out of space.

could not extract /usr/share/texmf-dist/fonts/tfm/urw35vf/bookman/ubkdo8t.tfm (Failed to create dir '/usr/share/texmf-dist/fonts/tfm/urw35vf')

And it started working again when I uninstalled a bunch of packages. That also caused that data thing to go from basically 100% down to what it is now. I have no idea what else could cause this if not that data thing filling up.

You could try doing a balance using a command like: sudo btrfs balance start -dusage=10 -musage=10 / but it looks fine to me.

How many snapshots do you have and how old is the oldest snapshot.

I already did several up to dusage=90 balances earlier. Will musage change much there?

I have basically no snapshots. Maybe 10-15.

It could if you are running out of metadata blocks. However, it would be strange for that to happen when you have unallocated space. If you have already run dusage balance, you can run the musage part only which should be pretty fast.

welp, just ran an musage balance but still not really much change

Yeah, I mean everything looks fine. Generally speaking, you want those percentages to be high. It means your blocks are being used efficiently.

When most people have issues, it is because they have free space but there is no unallocated space so btrfs can’t allocate additional metadata blocks when it needs to.

However, if you did a btrfs balance with dusage=90, that would force that percentage to be high.

I’ve been chatting in the btrfs IRC and we’ve been making a little bit of progress. They’ve also told me that metadata shouldn’t actually be balanced, see also this wiki: https://wiki.tnonline.net/w/Btrfs/Balance#Automatic_Balance

Just wanted to mention that, before I forget.

Will report back when we (hopefully) find a solution.