Confused about Btrfs, snapshots, and disk space allocation

Hi all, perhaps someone would be good enough to help me understand why the filesystem on my Endeavour installation contains so much unallocated space.

It seemed that timeline snapshots were taking up a ton of space so I disabled and deleted them. I then used Btrfs Assistant to do a scrub and full balance run of /, thinking it would free up some of the unallocated space, but it has actually made it worse for some reason :person_shrugging:

FYI, I have a 1TB NVMe drive with LUKS enabled, with snapper, snap-pac, and btrfs-maintenance installed.

According to the Btrfs Assistant GUI, I have the following settings:

  • Snapper timeline enabled :x:
  • Snapper cleanup enabled :white_check_mark:
  • Snapper boot enabled :x:

Can anyone see anything below that looks out of the ordinary? Thanks in advance :+1:

Filesystem     1K-blocks      Used Available Use% Mounted on
/dev/dm-0      975731936 517703220 456566508  54% /     
devtmpfs            4096         0      4096   0% /dev
tmpfs            7864068         0   7864068   0% /dev/shm
efivarfs             148       106        38  74% /sys/firmware/efi/efivars
tmpfs            3145628      1984   3143644   1% /run
/dev/dm-0      975731936 517703220 456566508  54% /swap
/dev/dm-0      975731936 517703220 456566508  54% /home
/dev/dm-0      975731936 517703220 456566508  54% /var/cache
/dev/dm-0      975731936 517703220 456566508  54% /var/log
tmpfs            7864068        16   7864052   1% /tmp
/dev/nvme0n1p1   1021984    155912    866072  16% /efi
tmpfs            1572812       172   1572640   1% /run/user/1000
/dev/dm-0      975731936 517703220 456566508  54% /run/BtrfsAssistant/7be39db4-db14-42e0-9dfe-0467f1764128````


~$ sudo btrfs fi usage / 
Overall:
    Device size:		     930.53GiB
    Device allocated:		 504.06GiB
    Device unallocated:		 426.47GiB
    Device missing:		     0.00B
    Device slack:		   512.00B
    Used:			       498.45GiB
    Free (estimated):		 430.19GiB	(min: 216.95GiB)
    Free (statfs, df):		 430.18GiB
    Data ratio:			      1.00
    Metadata ratio:		      2.00
    Global reserve:		     512.00MiB	(used: 0.00B)
    Multiple profiles:		     no

Data,single: Size:496.00GiB, Used:492.28GiB (99.25%)
   /dev/disk/by-uuid/7be39db4-db14-42e0-9dfe-0467f1764128	 496.00GiB

Metadata,DUP: Size:4.00GiB, Used:3.08GiB (77.11%)
   /dev/disk/by-uuid/7be39db4-db14-42e0-9dfe-0467f1764128	   8.00GiB

System,DUP: Size:32.00MiB, Used:96.00KiB (0.29%)
   /dev/disk/by-uuid/7be39db4-db14-42e0-9dfe-0467f1764128	  64.00MiB

Unallocated:
   /dev/disk/by-uuid/7be39db4-db14-42e0-9dfe-0467f1764128	 426.47GiB

~ $ sudo btrfs subvolume list /
ID 256 gen 162014 top level 5 path @_backup_20233008183305317_restore-qgnome
ID 257 gen 162167 top level 5 path @home
ID 258 gen 162097 top level 5 path @cache
ID 259 gen 162166 top level 5 path @log
ID 260 gen 162005 top level 5 path @swap
ID 261 gen 162005 top level 1681 path var/lib/portables
ID 262 gen 162005 top level 1681 path var/lib/machines
ID 265 gen 162092 top level 1681 path .snapshots
ID 419 gen 162014 top level 5 path @_backup_20230609222303444
ID 450 gen 162014 top level 5 path @_backup_20230609223040968
ID 453 gen 162014 top level 5 path @_backup_20230609230023442
ID 456 gen 162014 top level 5 path @_backup_20232411175546096
ID 1070 gen 162014 top level 5 path @_backup_20240901154045198
ID 1545 gen 162014 top level 265 path .snapshots/1275/snapshot
ID 1647 gen 162014 top level 265 path .snapshots/1377/snapshot
ID 1681 gen 162166 top level 5 path @
ID 1689 gen 162014 top level 265 path .snapshots/1409/snapshot
ID 1690 gen 162014 top level 265 path .snapshots/1410/snapshot
ID 1691 gen 162014 top level 265 path .snapshots/1411/snapshot
ID 1692 gen 162014 top level 265 path .snapshots/1412/snapshot
ID 1693 gen 162014 top level 265 path .snapshots/1413/snapshot
ID 1694 gen 162014 top level 265 path .snapshots/1414/snapshot
ID 1695 gen 162014 top level 265 path .snapshots/1415/snapshot
ID 1696 gen 162014 top level 265 path .snapshots/1416/snapshot
ID 1697 gen 162014 top level 265 path .snapshots/1417/snapshot
ID 1698 gen 162014 top level 265 path .snapshots/1418/snapshot
ID 1699 gen 162014 top level 265 path .snapshots/1419/snapshot
ID 1700 gen 162014 top level 265 path .snapshots/1420/snapshot
ID 1701 gen 162014 top level 265 path .snapshots/1421/snapshot
ID 1702 gen 162014 top level 265 path .snapshots/1422/snapshot
ID 1703 gen 162014 top level 265 path .snapshots/1423/snapshot
ID 1704 gen 162014 top level 265 path .snapshots/1424/snapshot
ID 1705 gen 162014 top level 265 path .snapshots/1425/snapshot
ID 1706 gen 162014 top level 265 path .snapshots/1426/snapshot
ID 1707 gen 162014 top level 265 path .snapshots/1427/snapshot
ID 1708 gen 162014 top level 265 path .snapshots/1428/snapshot

I am little confused. Why are you trying to free up unallocated space? That is part of your free space already.

you need to partition the unallocated space to use it.

I think he is referring to btrfs unallocated space. This is part of the partition but not yet allocated.

Ok I gotcha

1 Like

@dalto Perhaps this is just me fundamentally misunderstanding what Btrfs Assitant is telling me, then?

On the Overview tab of Btrfs Assitant, it informs me under the Internal Filesystem Statistics that my data is 98% full and that metadata is at 77%. Is that not the case?

@thefrog - but the unallocated space is already part of my root partition, no?

This is what Disks shows me:

don’t mind me i got confused with the unallocated space I’m used to that being a reference to non partitioned drives. unallocated in btrfs i believe is something different. I will leave you with the more capable hands of @dalto

Fair enough - that’s why I’m confused as well.

I’m pretty new to btrfs and I think the problem may be that I’m not sure of the difference between what “allocated” is vs “used” is.

data being close to 100% doesn’t mean your filesystem is full. That is about your metadata health.

The available space is shown in the section labeled “Free”.

1 Like

Aaah, I see :person_facepalming:

I guess I assumed that the unallocated space was not available for the filesystem to use, but I’m glad to hear that this is expected behaviour.

Thanks for the clarification!

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.