Dolphin / btop? seem to incorrectly report used disk space

Hi! I noticed that Dolphin and strangely, btop are both incorrectly reporting the used disk space on my arch machines. I’m using 19 - 20GiB on my laptop according to df -h / and du -h /, but Dolphin reports that i’m using 38GiB. This happens on both of my physical arch machines + a VM i use for testing. To confirm this, i asked two friends to compare their readings, one on arch and one on fedora. My friend on arch had the exact same issue as me, and he was able to confirm that df -h reports correctly as he uses ZFS, and ZFS itself can tell you how much is being used. The friend on Fedora didn’t have this issue.


^^^^ My Laptop^^^^


image
^^^^ Friend’s Arch system, also exhibiting the same issue^^^^

image
image
^^^^ Other friend’s system on Fedora, not exhibiting this issue.^^^^

Hi - just to make sure we’re talking about the same numbers, based on that screenshot it looks like:

  • Dolphin says that about 30GB of the filesystem on /dev/sda2 is used (233.2-202.7=30.5)
  • btop says that about 30GB is used
  • df says that you have 19GB “Used” - but that you have about 30GB less “Available” space than the total “Size” (234-203=31)

(Only showing the math on those because…sometimes I mess that up :sweat_smile: )

The df and du commands have a lot of intricacies in what they report - the answers to this Ask Ubuntu question were helpful for me when I was scratching my head about something similar before: disk usage - df -h - Used space + Avail Free space is less than the Total size of /home - Ask Ubuntu

By default, ext2/3/4 filesystems reserve 5% of the space to be useable only by root. This is to avoid a normal user completely filling the disk which would then cause system components to fail whenever they next needed to write to the disk.

5% of 234GB would be ~11GB, which added to the “Used” amount in df would result in about 30GB “space that isn’t free”.

So, it seems like they all generally agree that ~30GB of the space on that disk is not free to have new files written - I might be missing something, but does that make sense from your perspective?

so basically, btop and dolphin count the reserved space for root, but df does not? and what about other cases where root isn’t the owner of a disk? i’ve seen this happen on other mounted drives, the same with my friend.

The reserved space is a filesystem attribute, not based on a particular username on the system owning any paths within that filesystem, or it being mounted by any particular user. If you check through the comments of that Ask Ubuntu page, you can see some further information on what all df is doing and more attributes of ext4 filesystems.

Not sure how ZFS works, but Fedora installs use btrfs by default, which would presumably operate differently.