Steve Siegfried wrote:
Dan Track wrote:
Hi
I've got a server with 59G /opt partiition. Currently df -h reports
that I'm using 59G, however if I run "du -hs" on /opt the size of the
indidivaual dir's sitting in /opt are much smaller and don't sum up to
59G. So my question is what is making the server think that more disk
space is being used?
Any help would be appreciated.
It might be useful if you showed the du & df output, and that you should
remember to run du as root in order to see all the directories and not
just the ones you have permission to read as a normal user.
Suggest also that you read the fedora archives for the topic "df cmd
calculates wrong percent usage (FC6)".
-S
Also remember that space is not freed when a rm command is issued. It
is freed when the file is afterwards closed.
It is quite possible to have files open that do not show in the
directory listing.
Imagine a large file such as a database file that is being used by a
mysql process. Lets also assume that this mysql process is involved in
heavy access to that very file doing a report that takes hours.
It is possible to rm that file out from under the process. However, as
long as that process holds the file open, nothing has happened except
the inode has been removed from the directory listing. At that point,
df does not show any more space available than before the rm command.
That is because the kernel driver for the file system does not need to
free up the space until the file is closed.
Different types of file systems behave differently, but most of them
will behave this way.
Never trust df on a busy file system except at boot up. :)
Good luck!