PDA

View Full Version : Unlock CDROM -> Eject with cd-rom button


Gandalf
January 10th, 2006, 07:39 PM
Hello,

This HOWTO is just for trick to make the cd eject by pressing the eject button on the cd drive which has been included into dapper, but this is how to do it on breezy

Open Terminal and type

sudo sysctl dev.cdrom.lock=0


now your cd can be ejected by simply clicking on the eject button but if you restart it will no longer be available, to make it permenant, then type

sudo sh -c 'echo "dev.cdrom.lock=0" >> /etc/sysctl.conf'


Now it will be permenant

P.S: Taken from Ubuntu Bugzilla (http://bugzilla.ubuntu.com/show_bug.cgi?id=11480)

Hope that help

Gandalf
January 11th, 2006, 06:42 PM
finally it has been approved :D

beerorkid
January 11th, 2006, 07:03 PM
that is fancy. That was one of the little things that made me scratch my head.
Thanks

Gandalf
January 12th, 2006, 12:39 AM
Yeah and the solution was obviously easy :)

Iandefor
January 12th, 2006, 12:59 AM
Awesome! Glad to hear it's being fixed in Dapper. In the meanwhile, thanks for this little workaround!

benplaut
January 12th, 2006, 01:05 AM
that's the coolest thing i've seen in a really, really long time!

now if only it was possible to just pull out a jumpdrive, without unmounting

*grundle grundle*

manicka
January 12th, 2006, 02:59 AM
I have added this How-To to the Ubuntu Document Storage Facility

Gandalf
January 12th, 2006, 03:09 AM
Thank you manicka for informing us, i was going to write it now :D

Bloot
January 12th, 2006, 06:15 AM
It doesn't work with my second dvd+-rw. I tried cdrom1, dvd1, cdrw instead but no luck. :?

frodon
January 12th, 2006, 06:24 AM
Thanks Gandalf, i always forgot the first command.

Really useful !!!!!! :KS

Gandalf
January 12th, 2006, 10:20 AM
It doesn't work with my second dvd+-rw. I tried cdrom1, dvd1, cdrw instead but no luck. :?
Checking man sysctl, I've found that sysctl modify parameters under /proc/sys, so actually

sudo sysctl dev.cdrom.lock=0

is equivalent to

sudo sh -c 'echo "0" > /proc/sys/dev/cdrom/lock'


anyway back to your problem please give me the output of the command

ls -l /proc/sys/dev

Bloot
January 12th, 2006, 07:10 PM
anyway back to your problem please give me the output of the command

ls -l /proc/sys/dev


Here it is

ls -l /proc/sys/dev
total 0
dr-xr-xr-x 2 root root 0 2006-01-13 00:08 cdrom
dr-xr-xr-x 2 root root 0 2006-01-13 00:08 hpet
dr-xr-xr-x 4 root root 0 2006-01-13 00:08 parport
dr-xr-xr-x 2 root root 0 2006-01-13 00:08 raid
dr-xr-xr-x 2 root root 0 2006-01-13 00:08 rtc
dr-xr-xr-x 2 root root 0 2006-01-13 00:08 scsi


Many thanks. ;)

Gandalf
January 12th, 2006, 07:16 PM
hmmm, am a bit confused coz check /proc/sys/dev/cdrom/info u will find the info of ur both cdrom drived so i think the lock file is shared with both drives, it should unlock them both :S but am not sure, anyway i dont see any other cdrom drive :S

Bloot
January 12th, 2006, 08:07 PM
hmmm, am a bit confused coz check /proc/sys/dev/cdrom/info u will find the info of ur both cdrom drived so i think the lock file is shared with both drives, it should unlock them both :S but am not sure, anyway i dont see any other cdrom drive :S
Nevermind, I've survived to this for months, I'll survive 'till dapper. ;)

Thanks for your interest!.

Gandalf
January 12th, 2006, 10:01 PM
oh ok :D
you're welcome anyway :)

quonsar
January 13th, 2006, 01:02 AM
i guess i'm confused at what you're talking about here? i just made a launcher like so and put it on my panel:

http://2trak.com/Launcher-Properties.png

benplaut
January 13th, 2006, 01:38 AM
i guess i'm confused at what you're talking about here? i just made a launcher like so and put it on my panel:

now you can just press the button on the CD drive and it will eject, like it's supposed to! :eek:

quonsar
January 13th, 2006, 01:40 AM
*slaps forehead* :oops:

xcap
February 12th, 2006, 05:10 PM
It doesn't work with my second dvd+-rw. I tried cdrom1, dvd1, cdrw instead but no luck. :?

Oh my, I had the same problem, how can I solve it, no one knows?

christooss
February 12th, 2006, 06:05 PM
My CdRom doesn't open. This is my ls -l /proc/sys/dev

dr-xr-xr-x 2 root root 0 2006-02-12 23:03 cdrom
dr-xr-xr-x 2 root root 0 2006-02-12 23:03 hpet
dr-xr-xr-x 4 root root 0 2006-02-12 23:03 parport
dr-xr-xr-x 2 root root 0 2006-02-12 23:03 raid
dr-xr-xr-x 2 root root 0 2006-02-12 23:03 rtc

Im using Dapper

Gandalf
February 12th, 2006, 06:06 PM
Dapper already have this option, but not using sysctl, using another thing... check the bug link posted at the first post

christooss
February 13th, 2006, 04:11 PM
Hm I have done this but now it doesn't mount CD-ROM any more. How can I undo this. So I can follow instructions from Bugreport

Gandalf
February 13th, 2006, 04:13 PM
edit /etc/sysctl.conf and remove the last line which is dev.cdrom.lock=0 if am not mistaken

rado_london
February 13th, 2006, 08:24 PM
Thanks it worked as a charm on HP Pavilion DV4145ea laptop:D:D:d

mstlyevil
February 21st, 2006, 01:50 AM
I can say for a fact it worked in Dapper also. I did it before I read through the whole thread but hey it worked.

detyabozhye
February 28th, 2006, 09:40 PM
Thx! Works great here.

daredevil
March 1st, 2006, 10:33 AM
REally handy thnk u very much