CD Drive is busy

one problem which seems simple but i've faced many times is when i've used cd & want to eject, however i'm not in /dev/cdrom/... in any of my Xterms but it gives the message that the the CD drive is busy.
the only thing i could do is /etc/init.d/volmgt stop & eject the CD manually but it doesn't seem reasonable,Pls. give me any comments you know.

Thanks,
--Nikk

you have to unmount the drive first.

try: umount /dev/cdrom

then eject. :slight_smile:

If you do lsof /mnt/cdrom
it will tell you which processes are using the cdrom. If you are using a GUI you may find that File Managers seem to hang on to your drive for an inordinate amount of time.
If you are ruthless, like myself, you can just kill them.

'lsof' is an ideal command; however on may systems it is a value added program and doesn't come with the base OS. You can utilize 'fuser' as well to hunt down who has your device locked.

Cheers,

Keith

Another command you can use when a 'device busy' is presented is the lazy umount.

umount -l /dev/scd0

and add another command

umount -l /dev/scd0 && eject /dev/scd0

I had the same Problem on Solaris. I had an share on the CD-ROM in my NFS Server, and I just uncommended the line in /etc/dfs/dfstab and the problem was gone. Maybe thats the problem if you share your drive..

fuser works as well on the device file, like
fuser /dev/cotodo
depending on your unix flavour
It will give you the process locking your device.