Physical CD eject button unmount on Fedora 21

asked 2015-07-06 18:09:43 -0500

I am very used to using the physical eject button on the CD/DVD/Bluray drive to eject a disk. However, in Fedora 21 this does not unmount the disk but still ejects the medium. This leads to all sorts of problems (for example, if another disk is inserted then it won't be read right, and in some cases requires a system reboot before the drive will read right again - no amount of unmounting, ejecting, and remounting helps).

I know that I can work around this by making sure I always eject the disk from within the system (e.g. eject /dev/sr0 or the little eject button in the GUI), but the fact that I am so used to using the physical button and can really screw things up with the physical button is bad.

Is there any way to get the disk to unmount before ejecting when the physical button is pressed. This should be possible as it has worked great in Windows for decades...

I am running Fedora 21 with kernel v4.0.6 on x86_64. The drive is a HL-DT-ST BD-RE WH10LS30 according to Hardware Lister (lshw). I am using the Cinnamon Desktop.

I have done searching and found little answers, mostly people hoping it would one day work. Here are some results:

edit retag flag offensive close merge delete

Comments

It is a ROM, right? Is the problem the remnant mount item in the file manager that is present and will not go away until after reboot? Otherwise, there is no damage done. Only that predefined error message for missing.

It is tricky to code, because Mac and Windows mount differently from other operating systems: Macs do a file system juncture, since it is HFS all around; Windows does lazy mounting, where the things are copied into RAM and are often still available when the disk is ejected; Linux ties whatever is mounted to the existing file system, through a special device that constantly poll

NuuN gravatar imageNuuN ( 2015-07-07 01:22:49 -0500 )edit

Yes. Read-only disk (not being written). Stays in the OS. The annoyance is that to use another disk accurately I have to restart which is annoying. I know that the OS and software can ask for a lock to be placed on the drive (burning software does this while burning to prevent ejection). If the OS could also know if the button is pressed, couldn't these be combined: lock the drive, if the button is pressed unmount, unlock, and eject.

coderforlife gravatar imagecoderforlife ( 2015-07-13 02:00:59 -0500 )edit

Udev rules seem to be the most fitting. I do not know the trigger for the button though. If not udev, it would be the module for the drive if it exists.

NuuN gravatar imageNuuN ( 2015-07-13 10:07:54 -0500 )edit