Friday, September 03, 2010

Trouble with ejecting cd/dvd roms

Today, I got bored and so decided to watch some favorite movie on my dvd rom.(I use fedora/kde by the way x86). As usual when I popped in the dvd drive, I got the familiar prompt "So and so is mounted.. what do you want to do?". All I wanted was to watch a movie, relax, have a beer(just a figure of speech). To my horror, the dvd drive kept spinning and I never ended up watching the movie. Damn you dvd!
       After convincing myself that hulu will entertain me better, I decided to eject the dvd(It was making crazy amount of noise!). Pressing eject/right click->eject did not work.. linux kept ignoring me and continued to struggle with the drive.

Hmmm... I hate when these things happen and gives people the excuse to say "Oh! Linux? its not ready for desktop users.. try mac(pussies - NOTE: I'm not a sexist)". Okay, back to my conjecture...

I speculated, what if some process was using the dvd rom(must be my file manager-dolphin); what if I killed it? would eject succeed?

so pulled down my yakuake terminal and typed in the following hoping it would work.

ps -ef | grep sr0

Shows up hal-daemon and some other shit.. killed 'em all. Still eject button won't work! After googling around someone who suffered as much as I had suggested firing a bunch of eject commands quickly and seems that did the trick.

Closing my eyes, praying one final time hoping I don't have to reboot to take out the damn dvd.. I typed in the following


for i in `seq 1 20`; do sudo eject -v /dev/sr0 & done

and pressed Enter.....

A slew of outputs flew across the screen and finally success! dvdrom ejected.. I wish there was an option to just say 'shut the fuck up and get the dvd out'. Unfortunately no.