I’ve read a lot of the documentation regarding the transparent compression on BTRFS and what can it do, but I cannot accurately know how much actual space I am using on my disk. Using du -sh /home or df -h or btrfs filesystem df return the same result of ~33gb used, but when using compsize /home I get 23G of usage and 30G uncompressed in the TOTAL row.

So, what I don’t understand:

  • What is the actual disk usage? Which tool is reporting the correct size?
  • Will something happen if I get the uncompressed size to the size of my partition, but not the compressed size? Will the OS not let me write anymore despite having enough space?

Solved: if i mount the / btrfs subvol: sudo mkdir /mnt/nvmeroot && mount -o subvol=/ /dev/nvme0n1p15 /mnt/nvmeroot and use compsize /mnt/nvmeroot/ on it it reports the same size as the last commands and shows me the effectiveness of compression.

  • Hupf@feddit.org
    link
    fedilink
    English
    arrow-up
    4
    ·
    5 months ago

    I prefer to look at the Unallocated size in btrfs filesystem usage for an estimate of how much I can still write.

    Just make sure that never gets too low. Once btrfs can’t write a dirty metadata or system chunk, bad things will happen.

  • MentalEdge@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    2
    ·
    24 days ago

    Since BTRFS can share blocks between snapshots, which can straight up exist within the file tree, and is also able to de-duplicate files, you can theoretically use more space than there exists on the drive.

    Like the other commenter said, it’s easier to look at how many unallocated blocks the volume has.

    Also, as they warn, BAD THINGS HAPPEN WHEN A BTRFS VOLUME FILLS UP. It doesn’t just refuse to write. It will straight up break and stop working, requiring really tedius fixes to free up space.