command lsof

David Curry dsccable at comcast.net
Tue Apr 5 03:37:02 UTC 2005


Charles Malespin wrote:

>>Thomas Cameron wrote:
>>    
>>
>>>On Mon, 2005-04-04 at 21:17 -0500, Charles Malespin wrote:
>>>      
>>>
>>>>Hi, I am trying to figure out why my CD rom drive wont open when I use
>>>>the eject command.  It tells me that the device is busy and that it is
>>>>being used, but to my knowledge it isnt.  So I tried ' lsof ' to list
>>>>what was going on in the /media/cdrecorder drive but it tells me that
>>>>lsof command not found.  
>>>>        
>>>>
>>>It's /usr/sbin/lsof so regular users don't "see" it in their search
>>>path.  If you want to use commands which are typically only available to
>>>root, you can become root from a command prompt by issuing the command:
>>>
>>>su -
>>>
>>>Note the trailing hyphen.  This will allow you to become root
>>>temporarily until you exit the shell.
>>>
>>>Thomas
>>>      
>>>
>>Charles, some additional info that might be useful to readers.
>>1. Which desktop you are running - gnome, kde, xfce, etc.?
>>2. Have you used the drive before and removed a CD from it?
>>    
>>
>I am using Gnome... And I have used the CD before and gotten it to
>eject many times before.  I actually got the lsof command working and
>this is what it tells me....
>
>[root at localhost ~]# lsof /media/cdrecorder
>COMMAND    PID     USER   FD   TYPE DEVICE  SIZE  NODE NAME
>nautilus  5352 malespin   27r   REG   3,64 53570 26124
>/media/cdrecorder/DELLNIC.inf
>gam_serve 7765 malespin   27r   REG   3,64 53570 26124
>/media/cdrecorder/DELLNIC.inf
>
>To explain a little more, I upgraded kernels today and then I had to
>install ndiswrapper again to get my wireless card running.  So I did
>that and the CD that is "stuck" in there had my wireless card's
>drivers on it.  But I copied the driver files locally and ndiswrapper
>should be using them from the folder I put em in.  But it looks like
>its using them from the CD, right?  Does this help explain my
>situation better?
>Charles
>
It appears that the driver(s) on the CD are being used (at least to me 
it does).  So, if you kill PID 7765 you might be able to unmount the cd 
and eject it. 
More expert FC3 users might advise you to go ahead and kill PID 5352 
also, but as an FC2 user and no linux expert I'm a bit hesitant to 
suggest that.
You might see if you can find a nautilus window somewhere on your gnome 
panel and unmount the CD there before trying to kill the nautilus pid.

For possible help in locating a nautilus window running in background.  
FC2 uses a slightly older and somewhat different gnome version than 
FC3.  On my system, the gnome panel at the bottom of the screen show 
four "windows" one can choose between with a mouse click.  When one 
chooses an active window, a fifth "window" icon pops up to the right of 
the four window display and placing the cursor on that fifth window will 
display a count of the windows actually running in that space.  Left 
clicking on the fifth window icon will bring up a menu of the foreground 
window plus all windows running in background.

ps - please avoid top posting on this list.   An unofficial guide to 
conventions many on this list try to follow can be found at 
http://www-personal.ksu.edu/~seabra/linux/FedoraRules.html





More information about the fedora-list mailing list