Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!uunet!convex!news From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.unix.questions Subject: Re: How can I find out who is on a filesystem when I can't umount it? Message-ID: <1991Feb28.212253.13245@convex.com> Date: 28 Feb 91 21:22:53 GMT References: <10425@ncar.ucar.edu> Sender: news@convex.com (news access account) Reply-To: tchrist@convex.COM (Tom Christiansen) Organization: CONVEX Software Development, Richardson, TX Lines: 33 Nntp-Posting-Host: pixel.convex.com From the keyboard of fredrick@acd.acd.ucar.edu (Tim Fredrick): :We have a CDROM on our Sun SPARCstation where I constantly have the problem :where umount yields: : : umount /cdrom : /cdrom: Device busy : :How can I find out what process is using that filesystem, and is there a :way to force the umount to happen anyway? So far I've had to reboot the :system each time. --Tim You can use fuser(missed'em five), ofiles(public domain), or fstat(l^Hbsd). Of these, the last seems the nicest to use, as it does these things: given a partition, find out what's open there given a proc, find what files (including pipes etc) it has open given a file, find what procs has it open give a user, find out what file he has open trace down netstat -aA output to a given process plus more You can get fstat from the bsd sources on uunet, but that won't work for suns. I got my sun version from Vic Abell, abe@mace.cc.purdue.edu, that he posted to comp.sources.something a couple years ago. This should really go in the FAQ. --tom -- "UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things." -- Doug Gwyn Tom Christiansen tchrist@convex.com convex!tchrist