From owner-freebsd-questions Mon Jun 5 6:23:51 2000 Delivered-To: freebsd-questions@freebsd.org Received: from durango.picus.com (durango.picus.com [209.100.20.19]) by hub.freebsd.org (Postfix) with ESMTP id AE03737BBF9 for ; Mon, 5 Jun 2000 06:23:46 -0700 (PDT) (envelope-from troy@picus.com) Received: from arcadia [209.100.20.198] by durango.picus.com (SMTPD32-5.05) id A97E24801F8; Mon, 05 Jun 2000 09:22:06 -0400 From: "Troy Settle" To: "Jeff Gray" , Subject: RE: df - du leakage Date: Mon, 5 Jun 2000 09:23:27 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 Importance: Normal Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Jeff, I'm suprised you didn't see a couple different threads from me having smililar problems. What's happening is this: Something moves/renames/deletes an open log file. The filename is gone, but the inode is never released. In fact, the process that has the file open will continue to write to it. Killing the process *after* the fact doesn't work in all situations because the inode and file still exist, even if it's not in the directory listing. Trust me, I've had this happen, and in an attempt to fix it, I'v e taken down *every* process possible, and nothing worked. I had to boot to single user mode and run an fsck manually. If you want to rotate a log file manually or from your own script, you need to follow a few rules. I'll use apache for an example: #!/bin/sh foo=`date +'%Y%m%d'` # rename the file mv /var/log/httpd-access.log /var/log/httpd-access.$foo # tell apache to close/reopen it's files kill -HUP `cat /var/run/httpd.pid` # do what you will with the now-out-of-service log file webalize /var/log/httpd-access.$foo [gzip|rm|mv] /var/log/httpd-access.$foo [/some/other/location] Other programs might behave differently. For example, (cistron) radiusd opens and closes it's files for every write. You can safely delete the detail files without causing damage to the filesystem, though I would reccomend that you rename it first (the next write will create a new detail file). HTH, -Troy ** -----Original Message----- ** From: owner-freebsd-questions@FreeBSD.ORG ** [mailto:owner-freebsd-questions@FreeBSD.ORG]On Behalf Of Jeff Gray ** Sent: Monday, June 05, 2000 9:08 AM ** To: freebsd-questions@FreeBSD.ORG ** Subject: df - du leakage ** ** ** Could not find an answer in the archives, good explanations of what is ** going on by Doug Barton but no hint on how to find the difference. ** ** I have been monitoring the difference between ** df [Used storage on /var mount point] ** and ** du /var ** ** The difference in result is fine, but the difference is growing. ** That is, ** more and more of /var is being Used according to df, which apparently ** shows the correct amount as it monitors the fs. du is not telling me ** where the leakage is occuring. ** ** I assume if one can find the process that is doing this then the process ** can be killed, freeing the space again from the fs. ** ** Thanks in advance ** Jeff ** ** ** ** ** To Unsubscribe: send mail to majordomo@FreeBSD.org ** with "unsubscribe freebsd-questions" in the body of the message ** To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message