1

On my Raspbian GNU/Linux 10 system it seems that I've run out of space.

df shows that no more space is available on the root filesystem:

Filesystem      Size  Used Avail Use% Mounted on
/dev/root       118G  118G     0 100% /
devtmpfs        430M     0  430M   0% /dev
tmpfs           462M     0  462M   0% /dev/shm
tmpfs           462M   13M  450M   3% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           462M     0  462M   0% /sys/fs/cgroup
/dev/mmcblk0p1  253M   49M  204M  20% /boot
tmpfs            93M     0   93M   0% /run/user/1000

When I check with du -h, the last line shows

77G

So where there should be some space left - what might be the problem?

Before I had a large log file (/var/log/messages) that I deleted (as it shows up in the du output), but now I don't understand why df still shows 100% in use.

5
  • What is currently reported by sudo du -xhd1 / and df -h
    – joan
    Commented Aug 26, 2022 at 16:04
  • Strangely it seems to be okay again - but only after the second reboot (the formatting in this comment doesn't work): pi@slimpi:~ $ sudo du -xhd1 / 4.0K /srv 16K /lost+found 32K /tmp 1.6G /usr 139M /home 75G /media 41M /opt 4.0K /mnt 762M /var 28K /root 4.2M /etc 78G / Commented Aug 26, 2022 at 20:02
  • This will be informative: unix.stackexchange.com/questions/45771/…
    – Seamus
    Commented Aug 27, 2022 at 23:14
  • ...and, in addition to @Seamus's comment, further explanations (long and short) here: linuxshellaccount.blogspot.com/2008/12/… Commented Aug 28, 2022 at 7:32
  • You might have run out of inodes, try du -i to see if that's the problem.
    – Ian Turton
    Commented Sep 1, 2022 at 19:02

2 Answers 2

1

Summation: du is the better tool to use if you are interested in knowing how much space is actually being used on your filesystem "right now." df is great for "ballpark estimates" and is preferred if you need to know how big df thinks your filesystem is (so it will agree with other incorrect system statistics).

REFERENCE: Why du & df Display Different Values

The reference above is quite old now - nearly 14 yrs old as of this writing - but it's still a good, technically accurate and easy-to-understand explanation. If you're interested in more details, there are many, many other references you can find for the cost of a search.

du is the tool for you.

1

The log file might still be open (so kept on disk), but not pointed to by any inode (so not findable by du).

You might have to reboot or restart the service that was logging to that file before the space is freed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.