Re: Disk space error
There are a few things that I'm aware of that can give the difference
Deleted files might still be in use by an application; du will not see them but df (the filesystem) will still see them as in use. If you open a huge file in vi, vi will create an equally huge swp file. If you keep vi open and delete the swp file, du will immediately reflect the change but df will not as vi still has it 'open'. If you close vi after that, df will reflect it.
The command lsof can be of help here. A reboot should mostly get rid of this discrepancy.
du traverses directories that it can see. If you mount a partition over a directory (like /dev/sda6 on /home), du will not count the original /home directory but what is mounted on it. If your /home directory (before mounting /dev/sda6 over it) contains a few gigs of data, df will reflect this in the reporting of /dev/sda2 and du will not (as it can't see it).
Last edited by Wim Sturkenboom; July 19th, 2012 at 09:19 AM.
If you don't make backups of your important data, your data is obviously not important to you.