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

Re: determining what makes a filesystem busy



On Mon, May 29, 2000 at 10:10:12PM -0400, Dan Christensen wrote:
> Is there an easy way to determine what makes a filesystem busy, e.g.
> what prevents me from remounting /usr readonly after an upgrade?
> Usually some file that was erased is being held open by a process,
> but I don't know an easy way to determine which file or process.
> "lsof | grep usr" is a start, but provides too long a list.  Is
> there an easier way?

lsof +L1 

this will show you all files that are open and have a zero link count
(ie deleted) what happens is this:  say you have a ssh session open to
somewhere, and you upgrade ssh, well /usr/bin/ssh is deleted and
replaced with a new copy.  but the old copy is not deleted until the
ssh process you are running exits.  

unfortunatly the lsof trick won't always work, it seems that if you
replace a library it will not show up as a open file with zero link
count.  i have not yet found a simple way to deal with these.
sometimes i can guess and kill processes i think are using libraries i
know to be upgraded...

BTW you will need the lsof from potato to use the +L1 feature, it is a
recent feature. 

-- 
Ethan Benson
http://www.alaska.net/~erbenson/

Attachment: pgpaHjfh4zIHq.pgp
Description: PGP signature


Reply to: