[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Different reported sizes with df and du

From: Bob Proulx
Subject: Re: Different reported sizes with df and du
Date: Fri, 1 Nov 2002 19:47:15 -0700
User-agent: Mutt/1.4i

Thomas Preissler <address@hidden>:
> Thank you very much, for your help.
> But I already fixed the problem. A MySQL-logifile has been deleted,
> but MySQL was not restartet. After restarting it, all was ok.

Glad to hear your problem is resolved.

Yes this will cause df and du to report different sizes.  If you
search around you will find several other discussions of the reference
counting of filesystems.  I had not thought of that from your posting.
But now that you say this above it I am sure that was your problem.

The filesystem is reference counted.  Only when the last pointer to
the file is gone will the file actually be deleted and the file space
reclaimed for the system.  Until that time the filesystem may have
much space consumed by files that are not listed in any directory but
are still open by a program.  The deleting of logfiles which are still
open by a running daemon is a common source of this.

Something for the future is to truncate the file instead of deleting
it if you suspect that a program still has it open.  Truncating the
file will reclaim the disk space immediately.  I usually truncate by
using normal shell redirection of a do nothing command like 'true'.
(That is ':' to the long time unix user.)

  true > logfile


reply via email to

[Prev in Thread] Current Thread [Next in Thread]