Linux: “du” values don’t match “df” values.

If you do a df, and you compare those values with ‘du’, it is possible that those values don’t match. There are multiple reasons why this can happen, and one of those reasons if that files where deleted, but that the files are still in use by an application.
In that case, it is possible that you need to stop/restart the particular application. This is of course depending on the application itself.
With ‘lsof’ you can see if you have such a situation where an application is still ‘locking ‘that space, and it will show which application is causing this.
Below an example:

machine:/ # lsof | grep "/mymount" | grep deleted 
  myapplication 51789 root 3r REG 254,4 526066393088 6466832291 /mymount/backup.dat (deleted) 
  myapplication 51789 51791 root 3r REG 254,4 526066393088 6466832291 /mymount/backup.dat (deleted)
Share your love