df and du disk usage report mismatch

I had a server with a very big difference in the disk usage report of df and what du said I was actually using. The cause was that Apache had many open file descriptors to deleted log files. You can see all the deleted file descriptors with:

# ls -ld /proc/*/fd/* 2>&1 | fgrep '(deleted)'

Or using lsof:
# lsof +L1
# lsof -a +L1 /home

Seen in: http://www.noodles.net.nz/2011/07/27/df-not-reporting-correct-disk-usage/
and: https://mradomski.wordpress.com/2007/01/08/finding-an-unlinked-open-file-and-other-lsof-uses/


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s