Home > Linux > Why does df and du show different used disk space?

Why does df and du show different used disk space?

August 19th, 2007

Simple answer:

Do a

lsof | grep "deleted"

and see what shows up. du shows the usage, df shows free space BUT still counts files that have been deleted but are open by a process. Some examples of these types of files would be Apache access or error logs that have been deleted but the server has not been restarted or something I came across was a duff MYSQL process locking table data file thats had been deleted.

Simple option to get rid of these files is to restart your server, but, if this is not possible look at the PID that has the file locked and see if you are able to kill or restart the process.

I had no clue, but this guy did:

http://www.walkernews.net/2007/07/13/df-and-du-command-show-different-used-disk-space/

so kudus to him.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Google] [StumbleUpon]

Linux

  1. No comments yet.
  1. No trackbacks yet.