From owner-freebsd-questions@FreeBSD.ORG Fri Sep 19 18:31:36 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CCE1016A4B3 for ; Fri, 19 Sep 2003 18:31:36 -0700 (PDT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2501843F85 for ; Fri, 19 Sep 2003 18:31:36 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.9/8.12.9) id h8K1VZeF025297; Fri, 19 Sep 2003 20:31:35 -0500 (CDT) (envelope-from dan) Date: Fri, 19 Sep 2003 20:31:35 -0500 From: Dan Nelson To: Doug Hardie Message-ID: <20030920013135.GB10141@dan.emsphone.com> References: <3F6BA134.7040500@trini0.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 5.1-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.4i cc: FreeBSD Questions Subject: Re: File deletion problem X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Sep 2003 01:31:36 -0000 In the last episode (Sep 19), Doug Hardie said: > I have a situation that I have not been able to track down where on > one of my servers some process is writing a log file (I presume) and > it is getting rotated out from under it. The net result is that the > log continues to be written to the original file which eventually is > deleted thus leaving no trace of who or what. It takes several > months before its size becomes noticable, but eventually get grows to > consume remaining disk space. Given that the file has an inode but > no directory entry, how do you find it? All I have been able to come > up with is to use fstat to find all the open files inodes and then to > search with ls for each by hand and removing those I can find. > Unfortunately this is a large web server with lots of files. "lsof +L 1" will display all the open filedescriptors with a zero link count, along with info on the process holding the fd. -- Dan Nelson dnelson@allantgroup.com