Quick Tip – When Linux Won’t Give Your CD Back 04/02/08

Just a quick tip I wanted to pass on today. Have you ever had the issue where you want to eject your CD, but it will not eject; no matter how many times you press the eject button? Annoying isn’t it? I remember when I first started using Linux, years ago, (my OS was RedHat then), I actually would reboot the system just to get the CD out! Obviously, that’s not too smart.

One of my friends (a brand new user) just ran into this issue. He phoned me because he thought it was a bug. (It’s not). For any new users out there. Here is a quick fix to force the CD to eject:

sudo umount /media/cdrom0/ -l

Just run the above command in a terminal, and you’ll get your CD back.

You can straighten out a paper clip and push it into the little hole on the front of any CD or DVD drive. Best done with the power off and be sure to push it in straight. You will meet some resistance, keep pushing and the mechanical part of the drawer will move it open.

When this happens, it is often (but not always) because you have some process (e.g. a file browser or a terminal) which is opened to that dir (e.g. open an xterm and cd /media/cdrom0). As long as that’s the case, the directory is “busy” and cannot be unmounted without extra effort. When this happens, first make sure you haven’t got a file or dir open on the drive, or that you aren’t running some process which holds the device open (e.g. k3b). Then try the “eject” command. Don’t use the paper-clip trick on a running system unless you have no other choice.

@Stephan Beal – You are totally correct. A case in point, last week I used the paper clip method and created a coaster out of my CD. I didn’t realize it was still spinning when I forced it open and the noise alone made me think I damaged the CD burner. The CD itself was scratched up like it had been spinning on sandpaper. So, common sense, I should have carefully listened first!

My Backtrack4-livedvd will not eject after ended session.Backtrack 4 is ubuntu-based,the predecessor was not.I tried the above suggestions as well as shutdown -P 0 and poweroff-commands.
Strangely enough in Backtrack3,the live dvd ejected automatically after ended session.I have to use a needle now to manually eject the cd-tray.
I guess this is an inherent ubuntu-issue,but maybe there is some ubuntu-commands i don’t know of.