LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Unable to Eject a DVDROM (https://www.linuxquestions.org/questions/linux-hardware-18/unable-to-eject-a-dvdrom-606547/)

carlosinfl 12-13-2007 09:55 AM

Unable to Eject a DVDROM
 
I am unable to eject a DVD from machine as it indicates it is in use by another program but I have no programs that I can see using it nor do I have that mount point open.

How can I force the umounting of my cdrom?

Code:

cwilliams:~# umount /media/cdrom
umount: /media/cdrom0: device is busy
umount: /media/cdrom0: device is busy
cwilliams:~# mount
/dev/md0 on / type ext3 (rw,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
procbususb on /proc/bus/usb type usbfs (rw)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
/dev/sda2 on /boot type ext3 (rw)
/dev/sdb2 on /tmp type ext3 (rw)
/dev/sdc1 on /media/disk type ext3 (rw,nosuid,nodev,uhelper=hal)
/dev/sdd1 on /media/disk-1 type vfat (rw,nosuid,nodev,uhelper=hal,shortname=lower,uid=1000)
/dev/scd0 on /media/cdrom0 type udf (ro,noexec,nosuid,nodev,user=cwilliams)


MS3FGX 12-13-2007 10:26 AM

Does this show anything:

Code:

sudo lsof | grep /media/cdrom0

carlosinfl 12-13-2007 10:30 AM

Quote:

Originally Posted by MS3FGX (Post 2989480)
Does this show anything:

Code:

sudo lsof | grep /media/cdrom0

Ah,

Code:

cwilliams@cwilliams:~$ sudo lsof | grep /media/cdrom0
Password:
smbd      21546        root  cwd      DIR      11,0      136        265 /media/cdrom0

One of SMB shares is my CDROM. Can I simply kill this PID and then try?

kill -9 21546?

kilgoretrout 12-13-2007 10:42 AM

Yes, that should do it. You can accomplish the same thing with the fuser command:

# fuser -vm /dev/scd0

lists all processes accessing the device and:

# fuser -km /dev/scd0

kills all processes accessing the device. Note, fuser will only work on the device file, not the mopunt point.

carlosinfl 12-13-2007 01:43 PM

Thanks for all your help!


All times are GMT -5. The time now is 11:55 PM.