how to see which files are open?

Chris Parkin Lilley [cs12] C.J.Parkin-Lilley at fulcrum.bt.co.uk
Fri Feb 23 14:33:29 AEST 1990


In article <3537 at zorba.Tynan.COM> uunet!unix.sri.com!cole (Susan Cole) writes:
>I found myself wanting to umount a filesystem which as far as I could
>see no one was in (nor in another directory under it) but nevertheless,
>every time I tried to umount it I got "Device busy".  This was
>frustrating.  There must be a way to see what processes have which
>files open but nothing sprang to my eye when I did a 'man -k' of "files",
>"open", and "table".  Will someone please tell me what it is?  Please post
>(this is said in hopes of keeping the responses in the hundreds instead
>of the thousands).  Thanks!
>

Does your system have 'fuser'. If so, you should be able to do something like

	fuser -u /dev/dsk/whatever (a block special file)

This should give you the pids of the processes which have a partition open,
and 
	fuser -k /dev/dsk/whatever

should try and kill them off.

Hope this is OK. Of course, if you don't have fuser, then it won't be any help.
Good luck.
	-Chrisl.

--
--------------------------------------------------------------------------------
Chris Parkin Lilley, CS1.2, BT Fulcrum, UK               chrisl at uk.co.bt.fulcrum



More information about the Comp.unix mailing list