btrfs disk space

Published: Monday, Aug 10, 2015 Last modified: Monday, Dec 9, 2024

I heard about df mis-reporting with btrfs and I assumed it was that df reports less than what was actually available.

No. df is actually reporting MORE than what’s available!

core@dc ~ $ df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        487M     0  487M   0% /dev
tmpfs           499M     0  499M   0% /dev/shm
tmpfs           499M  332K  499M   1% /run
tmpfs           499M     0  499M   0% /sys/fs/cgroup
/dev/vda9        28G   23G  4.2G  85% /
/dev/vda3       985M  346M  588M  38% /usr
tmpfs           499M     0  499M   0% /tmp
tmpfs           499M     0  499M   0% /media
/dev/vda6       108M   56K   99M   1% /usr/share/oem
core@dc ~ $ sudo btrfs fi df /s fs fi df /
Data, single: total=21.21GiB, used=19.30GiB
System, DUP: total=8.00MiB, used=16.00KiB
System, single: total=4.00MiB, used=0.00B
Metadata, DUP: total=2.10GiB, used=1.21GiB
Metadata, single: total=8.00MiB, used=0.00B
GlobalReserve, single: total=416.00MiB, used=0.00B

So df reports 4.2G free on root, but actually I have 21.21-19.30=1.91GB free according to btrfs tooling! YIKES!