• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 603
  • Last Modified:

ejecting cd rom

i have fedora linux installed in my system , when ever i try to unmount or eject  my cdrom error message comes that  "the device is busy" . it is not possible to  take it by pressing the button why? is it possible to take it out by killing the process ,if possible which process is associated with the cdrom?
1 Solution
try typing "eject"
at the console, that is.
A device is busy when something is accessing it. Try making sure that you have closed all programs that are using the CD-ROM. Also, make sure any terminal/command-line sessions do nto have a path on the CD-ROM as their current working directory.
Build your data science skills into a career

Are you ready to take your data science career to the next step, or break into data science? With Springboard’s Data Science Career Track, you’ll master data science topics, have personalized career guidance, weekly calls with a data science expert, and a job guarantee.

am... sorry, I think you already tried that.

Check that the folder isn't in use too (like you're inside it when you are trying to do unmount or eject)

   run "fuser -k /mnt/cdrom" as root to kill whatever process access /mnt/cdrom
or use "lsof" to check which process access cdrom and kill that process. Then you should be able to eject cdrom.

This exact problem happens to me a lot. There are two common variations:

1. Pop a CDROM into the drive, GNOME / KDE destop mounts the CDROM automatically and brings up a navigator window showing the contents of the CDROM. Need to remember to close that window before ejecting the CDROM or it will refuse to eject (because the navigator window has the CDROM as it's working directory)

2. Insert a CDROM, mount it manually with a "mount" command, "cd" into the CDROM filesystem, do some stuff. Need to remember to "cd" *out* of the CDROM filesystem or it will refuse to eject (becuase my shell has the CDROM as it's working directory).

Less common variation is that some other user or process is using the CDROM. In that case, need to read up on the "fuser" command.
umount /dev/cdrom
or type mount and see if there is a cd mounted
after its unmounted you can press button
that is just because some of your processes are still using your cdrom.

easy help, Lets say that you have mounted your cdrom to /mnt/cdrom and now you can't unmout it and device is always busy so you can use this commnad:

# fuser -mk /mnt/cdrom
# unmout /mnt/cdrom
This command will find all processes using you /mnt/cdrom and kill them.

but please do not use this commnad to you mounted partitions use it just in case that you can't unmont your cdrom otherwise it can cause damage to your system.

Very simple in 2 steps

1. Change directory to anything else than cd #cd will take u to ur home directory
2. #eject


I get this a lot, KDE seems to keep a device open even when you navigate away from it in the directory structure.

What I do is run something like

"lsof | grep cdrom"

This will list all open files which include the word cdrom, usually you'll get some KDE programs (kdeinit I think) - if you use KDE. Now, lsof lists the pid (process ID) of the processes accessing the file, just kill the process (eg "kill 1204") and you should then be able to "eject /dev/cdrom".

I'd not come across tha fuser util though, will check it out.

Sorry for the "me too" will read the thread more closely next time!!

Make sure your logged in as root and do

umount /mnt/cdrom

Hope this helps

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now