Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Sep 2003 20:31:35 -0500
From:      Dan Nelson <dnelson@allantgroup.com>
To:        Doug Hardie <bc979@lafn.org>
Cc:        FreeBSD Questions <questions@freebsd.org>
Subject:   Re: File deletion problem
Message-ID:  <20030920013135.GB10141@dan.emsphone.com>
In-Reply-To: <FD766CFD-EB08-11D7-B53B-000393681B06@lafn.org>
References:  <3F6BA134.7040500@trini0.org> <FD766CFD-EB08-11D7-B53B-000393681B06@lafn.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030920013135.GB10141>