One of my linux boxes ran out of disk space, which surprised me, because it definitely didn’t have that much stuff on it. When I check with df
it says I have used 212GB on my / path:
$ df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 227G 212G 5.2G 98% /
So, I tried to use du
to see if maybe a runaway log file was the cause, but this says I have only used 101GB on my / path (this is also more in-line with how much space I expected to be used):
$ du -h | sort -h
...
101G /
Using those commands with sudo
outputs the same sizes.
My filesystem is Btrfs, I’ve tried the suggestion to use btrfs balance start ...
but this actually INCREASED my disk usage to 99% lol
So my question is… what on earth is using the remaining 111GB?? Why can I not see it in du
?
The bit of information you’re missing is that
du
aggregates the size of all subfolders, so when you saydu /
, you’re saying: “how much stuff is in / and everything under it?”If you’re sticking with
du
, then you’ll need to traverse your folders, working downward until you find the culprit folder:$ du /* (Note which folder looks the biggest) $ du /home/* (If /home looks the biggest)
… and so on.
The trouble with this method however is that
*
won’t include folders with a.
in front, which is often the culprit:.cache
,.local/share
, etc. For that, you can do:$ du /home/.*
Which should do the job I think.
If you’ve got a GUI though, things get a lot easier 'cause you have access to GNOME Disk Usage Analyzer which will draw you a fancy tree graph of your filesystem state all the way down to the smallest folder. It’s pretty handy.
GUI disk space analyzers are absolutely amazing.
For those who prefer KDE and/or donut graphs, Filelight has you covered.
Bookmarked! Thanks!