I’m getting a No space left on device error on my btrfs filesystem for my root partition. Unlike most issues that people have, this seems to stem from the fact that btrfs isn’t using the entire space left by the filesystem.
sudo btrfs filesystem show
Label: none uuid: 8f89fba4-d877-4814-b5c8-e2e5c2942c6b
Total devices 1 FS bytes used 14.09GiB
devid 1 size 20.00GiB used 16.28GiB path /dev/sda1
As you can see the size is 20g, but it is using only 16g and My root takes up 14g. Is there away to for btrfs to claim the entire 20g?
Have you turned off snapper? Snapper uses space to save the FS state often. 20 gig is not enough for BTRFS with snapper running min recommended is 40 gig
Hi
No, it needs space for snapshots (if snapper running), else turn off snapper and delete snapshots from latest backwards, then run the btrfs-balance cronjob manually down in /etc/cron.weekly.
Hi
If the btrfsmaintenance package is installed, then it’s /usr/share/btrfsmaintenance/btrfs-balance.sh which (well on Leap) is softlinked in /etc/cron.weekly.
ls -la /etc/cron.weekly/btrfs-balance.sh
lrwxrwxrwx 1 root root 44 Oct 29 15:35 /etc/cron.weekly/btrfs-balance.sh -> /usr/share/btrfsmaintenance/btrfs-balance.sh
You may need to run it a few times to clean things up.
14.09 is the used (data and metadata extents) amount, it should be close to df -h.
20.00 is the (block) device size, i.e. the partition size
16.28 is the amount allocated to all chunk (block group) types
The chunk is a contiguous range of space, for one of three chunk types: data, metadata, or system. The amount allocated at a time depends on the device size, typically it’s 256MiB for metadata and 1GiB for data chunks. The amount unused can be allocated into either chunk type on demand. So there’s nothing wrong here and there’s nothing you need to do about it.