Ejecting mounted CDs using eject button on drive

Bug #17764 reported by Wouter Stomp
38
This bug affects 1 person
Affects Status Importance Assigned to Milestone
eject (Ubuntu)
Fix Released
Wishlist
Martin Pitt

Bug Description

It would be great if in breezy we could eject a cd from the cdrom drive with the
eject button on the drive (without first unmounting it). The button on the drive
not working is very, very confusing to new users and keeps being annoying to
most other people. I believe it is possible in other linux distro's? I don't see
any reason why it would useful to have it the way it works now.

Revision history for this message
Wouter Stomp (wouterstomp-deactivatedaccount) wrote :

Perhaps using supermount-ng could fix this?

http://supermount-ng.sourceforge.net/

Revision history for this message
Wouter Stomp (wouterstomp-deactivatedaccount) wrote :

At the very least it should be possible to eject cd's by rightclicking them in
the places menu.

Revision history for this message
Alexander van Loon (avanloon) wrote :

I don't think it would be great, I think such a thing is simply essential. I'm
amazed that this bug hasn't received any attention at all.

This will indeed be very confusing for newbies, when they can't eject a CD they
will immediatly think that Linux is buggy and that it sucks. How do you expect
newbies to know that they have to right click the CD drive and then click eject?

This problem should have such a high priority that it should be fixed in Breezy,
if you ask me. I hope the Ubuntu dev's at least respond to this bugreport.

Revision history for this message
Matt Zimmerman (mdz) wrote :

I can understand your excitement, but a feature like this isn't as simple to
implement as it might appear. So far we are aware of no solution to this
problem which is robust and mature enough for use in Ubuntu. If such a system
is developed, we will gladly evaluate it for inclusion.

Revision history for this message
Wouter Stomp (wouterstomp-deactivatedaccount) wrote :

From the description it looks like supermount/supermountng does exactly this,
but I have no idea how stable or robust it is. I found some posts about problems
with usbsticks and camera's, but as far as I can see it would only need to be
enabled for cd drives? Just wondering if there are any particular reasons not to
use it...

(supermounts description):

Supermount is a pseudo-filesystem which manages filesystems on removable media
like floppy disks and CD-ROMs. It frees you from need to manually mount and
unmount media.

With supermount, you can change the disk in the drive whenever you want (with
the obvious exception that you shouldn't do it when the filesystem is actively
in use). You don't need to "cd" out of the directory first, and you don't need
to tell the kernel what you're doing --- supermount will detect the media change
automatically.

Supermount will automatically detect whether the media you are mounting is
read-write or readonly, and if you mount a write-protected disk, then the subfs
will be mounted as a readonly filesystem.

Supermount detects when you have finished activity on the subfs, and will flush
all buffers to the disk before completing the operation. So, if you copy a file
onto a supermounted floppy disk, the data will all be written to disk before the
"cp" command finishes. When the command does complete, it will be safe to remove
the disk.

Revision history for this message
Matt Zimmerman (mdz) wrote :

(In reply to comment #5)
> From the description it looks like supermount/supermountng does exactly this,
> but I have no idea how stable or robust it is. I found some posts about problems
> with usbsticks and camera's, but as far as I can see it would only need to be
> enabled for cd drives? Just wondering if there are any particular reasons not to
> use it...

You can see by looking at the page that it doesn't support the kernels we use;
the kernels it does support are several years old. This not only makes it
impractical for us to even try, it shows that it isn't actively maintained.

Revision history for this message
Artem Vakhitov (artem-vakhitov) wrote :

Why is it possible in virtually every Linux distro I tried and all Windows
versions, but not in Ubuntu Breezy? Just curious :-)

Revision history for this message
Hussam Al-Tayeb (hussam) wrote :

This USED to work in breezy but it stopped working a while ago

Revision history for this message
stanislas (sipos-s) wrote :

There exists a systcl wich achieves such cd ejecting:
sudo sysctl dev.cdrom.lock=0

To make this change permanent:
sudo sh -c 'echo "dev.cdrom.lock=0" >> /etc/sysctl.conf'

Revision history for this message
Martin Pitt (pitti) wrote :

That's easy to fix and we should probably get it into Dapper.

Revision history for this message
Tony Lewis (tonylewis) wrote :

(In reply to comment #9)
> There exists a systcl wich achieves such cd ejecting:
> sudo sysctl dev.cdrom.lock=0

Works once (i.e. it ejects), but then putting in a different CD gives varying
results. In one case, my new /cdrom/ or /media/cdrom0 pointed to a directory on
the CD that was other than the root dir. In another (a different second CD),
the second CD inserted could not be used. In both cases a umount then mount
fixed it.

Revision history for this message
Wouter (woutervanwijk-netscape) wrote :

I guess it's not possible to hook the code from the right-click eject menu to
the eject-button event in some way?

Revision history for this message
Guillaume Desmottes (cassidy) wrote :

(In reply to comment #9)
> There exists a systcl wich achieves such cd ejecting:
> sudo sysctl dev.cdrom.lock=0
>
> To make this change permanent:
> sudo sh -c 'echo "dev.cdrom.lock=0" >> /etc/sysctl.conf'
>
>
I use this in computers rooms (running Ubuntu) i administrate at the university
and have no problems with this issue.

Revision history for this message
Martin Pitt (pitti) wrote :

*** Bug 25603 has been marked as a duplicate of this bug. ***

Revision history for this message
Martin Pitt (pitti) wrote :

This should now work on most drives in dapper:

 gnome-volume-manager (1.5.7-0ubuntu1) dapper; urgency=low
 .
   [...]
   * Add debian/patches/03_no_hal_mount.patch: Directly call pmount-hal,
     pumount, and eject instead of invoking Hal functions. These are utter
     crack, and do not even exist yet. This also finally makes the CD drive's
     eject button work with mounted CDs.
   [...]

It won't for drives which do not notify the computer when the eject button is
pressed, but it should already be a huge improvement.

The sysctl approach has it's own warts, e. g. some drives forget the setting if
you change a CD.

I close this for now. Please cry out loudly if you encounter a drive that
doesn't eject with the new g-volume-manager, but works with the sysctl approach.

Revision history for this message
Ralph Wabel (rwabel) wrote :

(In reply to comment #15)
> This should now work on most drives in dapper:
>
> gnome-volume-manager (1.5.7-0ubuntu1) dapper; urgency=low
> .
> [...]
> * Add debian/patches/03_no_hal_mount.patch: Directly call pmount-hal,
> pumount, and eject instead of invoking Hal functions. These are utter
> crack, and do not even exist yet. This also finally makes the CD drive's
> eject button work with mounted CDs.
> [...]
>
> It won't for drives which do not notify the computer when the eject button is
> pressed, but it should already be a huge improvement.
>
> The sysctl approach has it's own warts, e. g. some drives forget the setting if
> you change a CD.
>
> I close this for now. Please cry out loudly if you encounter a drive that
> doesn't eject with the new g-volume-manager, but works with the sysctl approach.

I've a Toshiba DVD-ROM SD-M1612 and when using sysctl eject works. I'm using
dapper with all the latest upgrades.

Revision history for this message
Ralph Wabel (rwabel) wrote :

(In reply to comment #16)
> (In reply to comment #15)
> > This should now work on most drives in dapper:
> >
> > gnome-volume-manager (1.5.7-0ubuntu1) dapper; urgency=low
> > .
> > [...]
> > * Add debian/patches/03_no_hal_mount.patch: Directly call pmount-hal,
> > pumount, and eject instead of invoking Hal functions. These are utter
> > crack, and do not even exist yet. This also finally makes the CD drive's
> > eject button work with mounted CDs.
> > [...]
> >
> > It won't for drives which do not notify the computer when the eject button is
> > pressed, but it should already be a huge improvement.
> >
> > The sysctl approach has it's own warts, e. g. some drives forget the setting if
> > you change a CD.
> >
> > I close this for now. Please cry out loudly if you encounter a drive that
> > doesn't eject with the new g-volume-manager, but works with the sysctl approach.
>
> I've a Toshiba DVD-ROM SD-M1612 and when using sysctl eject works. I'm using
> dapper with all the latest upgrades.
>
>
>

forgot to be more precise in the last reply :-) with sysctl eject works but
without it doesn't. So it doesn't work with the new g-volume-manager for my drive.

Revision history for this message
Martin Pitt (pitti) wrote :

FYI, I filed bug 35695 about the sysctl default value. Fixing this in /etc/sysctl.conf is not optimal since it would produce errors on computers without CD-ROM drives.

Revision history for this message
Tomi Urankar (tomi0) wrote :

just installed DAPPER BETA! And eject button wont work.
I have NEC 4500 DVDRW

Revision history for this message
Martin Pitt (pitti) wrote :

@ashrack: beta is too old, this was fixed after the Beta release. Try beta-2 :)

Revision history for this message
miroslav (mirostri) wrote :

Ubuntu developers,please make it possible to eject the CD when the button is pressed,it's such a common thing,every other OS has it,for a good reason,it should be possible by default,it's very annoying to many people

Revision history for this message
Martin Pitt (pitti) wrote :

miroslaw, this was fixed ages ago (in dapper or so).

Revision history for this message
miroslav (mirostri) wrote :

but it isn't,I'm using edgy eft and somethimes I can't eject without using right click -> eject

Revision history for this message
David Losada Gacio (losadaz) wrote : Re: Ejecting mounted CDs using eject button on drive: Multiple problems here.

I am using Kubuntu 6.06 updated and if you have konqueror showing the Cd's directory list the button doesn't run. I have to close konqueror (even if it is only showing the content, without opening archives).
Another thing is that it takes ages to eject the cd/dvd (10 seconds on a Pentium 3 600 with optimized kernel).
And the last thing to improve is that sometimes right after ejecting the Cd it closes again (and I didn't press the button two times), I think it has this behaviour when the system is loaded and takes more time to eject; like if the system are sending multiple petitions of open it... I don't know.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.