You are not logged in.

#1 2021-07-02 16:55:52

Strangiato
Member
Registered: 2020-01-10
Posts: 77

CD/DVD/BD disc ejected via button of optical device remains mounted

Hi

My fully updated Arch Linux running Plasma 5.22.2 and default kernel (5.12.14-arch1-1) is not unmounting CD/DVD/BD discs when I press the eject button of the optical device (a blu-ray burner in my case). This behavior/bug is annoying when I need to insert and eject several discs in sequence because a disc inserted after ejecting the previous one is not mounted correctly. A disc is unmounted as expected when ejected via "Eject" feature of my file manager (Dolphin), but leaving the disc mounted after ejecting via button of the optical device is not the correct behavior, I think.

Steps to reproduce:
insert a cd/dvd/bd into your optical device (not reproducible with audio CD)
mount the inserted disc
eject the disc by pressing the physical eject button of your device
run "mount|grep sr0" command (possibly you need to replace "sr0" with your device)

Output of the command above indicates that the ejected disc is still mounted. In my case the output is:

/dev/sr0 on /media/disc type iso9660 (ro,nosuid,nodev,relatime,nojoliet,check=s,map=n,blocksize=2048,uid=1003,gid=1003,dmode=555,fmode=444,uhelper=udisks2)

Can anyone reproduce the problem? Is there any solution/workaround to unmount discs ejected via eject button of the optical device?

Last edited by Strangiato (2021-07-02 17:43:35)

Offline

#2 2021-07-09 01:05:33

Strangiato
Member
Registered: 2020-01-10
Posts: 77

Re: CD/DVD/BD disc ejected via button of optical device remains mounted

This is an old issue. Here is an old topic in Arch forum:
https://bbs.archlinux.org/viewtopic.php?pid=1459388

And here is an old bug report in kernel bugzilla:
https://bugzilla.kernel.org/show_bug.cgi?id=85111

If I'm understanding well, in comments 3 and 6 of the bug report somebody says that a disc can be unmounted on ejecting if the optical drive implements notifiers for the eject button. Also it depends on how the desktop environment (I use KDE Plasma) handles the event when the disc is ejected.
How can I know if my drive supports the mentioned notifiers for the eject button?

Here are details about my drive:

more /proc/sys/dev/cdrom/info
CD-ROM information, Id: cdrom.c 3.20 2003/12/17

drive name:		sr0
drive speed:		48
drive # of slots:	1
Can close tray:		1
Can open tray:		1
Can lock tray:		1
Can change speed:	1
Can select disk:	0
Can read multisession:	1
Can read MCN:		1
Reports media changed:	1
Can play audio:		1
Can write CD-R:		1
Can write CD-RW:	1
Can read DVD:		1
Can write DVD-R:	1
Can write DVD-RAM:	1
Can read MRW:		1
Can write MRW:		1
Can write RAM:		1
$ cd-drive
cd-drive version 2.1.0 x86_64-pc-linux-gnu
Copyright (c) 2003-2005, 2007-2008, 2011-2015, 2017 R. Bernstein
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
The driver selected is GNU/Linux
The default device for this driver is /dev/cdrom

Drivers available...
  GNU/Linux ioctl and MMC driver     
  cdrdao (TOC) disk image driver     
  bin/cuesheet disk image driver     
  Nero NRG disk image driver         

CD-ROM drive supports MMC 3

                       Drive: /dev/cdrom
Vendor                      : HL-DT-ST
Model                       : BD-RE  WH14NS40 
Revision                    : 1.03
Profile List Feature
	Blu Ray BD-RE
	Blu Ray BD-R random recording
	Blu Ray BD-R sequential recording
	Blu Ray BD-ROM
	DVD+R Double Layer - DVD Recordable Double Layer
	DVD+R - DVD Recordable
	DVD+RW - DVD Rewritable
	DVD-R - Double-layer Jump Recording
	DVD-R - Double-Layer Sequential Recording
	Re-recordable DVD using Sequential Recording
	Re-recordable DVD using Restricted Overwrite
	Re-writable DVD
	Re-recordable DVD using Sequential recording
	Read only DVD
	CD-RW Re-writable Compact Disc capable
	Write once Compact Disc capable
	Read only Compact Disc capable

Core Feature

Morphing Feature
	Operational Change Request/Notification supported
	Synchronous GET EVENT/STATUS NOTIFICATION supported

Removable Medium Feature
	Tray type loading mechanism
	can eject the medium or magazine via the normal START/STOP command
	can be locked into the Logical Unit

Write Protect Feature

Random Readable Feature

Multi-Read Feature

CD Read Feature
	C2 Error pointers are supported
	CD-Text is supported

DVD Read Feature

Random Writable Feature

Incremental Streaming Writable Feature

Formattable Feature

Management Ability of the Logical Unit/media system to provide an apparently defect-free space. Feature

Restricted Overwrite Feature

CD-RW CAV Write Feature

DVD+RW Feature

DVD+R Feature

Rigid Restricted Overwrite Feature

CD Track at Once Feature

CD Mastering (Session at Once) Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Profile List Feature

Hardware                                  : CD-ROM or DVD
Can eject                                 : Yes
Can close tray                            : Yes
Can disable manual eject                  : Yes
Can select juke-box disc                  : No

Can set drive speed                       : No
Can read multiple sessions (e.g. PhotoCD) : Yes
Can hard reset device                     : Yes

Reading....
  Can read Mode 2 Form 1                  : Yes
  Can read Mode 2 Form 2                  : Yes
  Can read (S)VCD (i.e. Mode 2 Form 1/2)  : Yes
  Can read C2 Errors                      : Yes
  Can read IRSC                           : Yes
  Can read Media Channel Number (or UPC)  : Yes
  Can play audio                          : Yes
  Can read CD-DA                          : Yes
  Can read CD-R                           : Yes
  Can read CD-RW                          : Yes
  Can read DVD-ROM                        : Yes

Writing....
  Can write CD-RW                         : Yes
  Can write DVD-R                         : Yes
  Can write DVD-RAM                       : Yes
  Can write DVD-RW                        : No
  Can write DVD+RW                        : No

Possibly the second command confirms that my drive implements notifiers for the eject button in these lines:

Morphing Feature
	Operational Change Request/Notification supported
	Synchronous GET EVENT/STATUS NOTIFICATION supported

But I'm not sure.

If my drive implements the required notifiers, how can I unmount and eject a disc at once by pressing the eject button of the drive when using KDE Plasma DE?

Last edited by Strangiato (2021-07-09 15:20:24)

Offline

#3 2021-07-16 13:06:04

Strangiato
Member
Registered: 2020-01-10
Posts: 77

Re: CD/DVD/BD disc ejected via button of optical device remains mounted

The following old bug report on Arch bug tracker suggests that systemd controls the behavior when a disc is ejected:

https://bugs.archlinux.org/task/42071

The problem was also reported against other distributions:

OpenSuse: https://bugzilla.opensuse.org/show_bug.cgi?id=909418
Ubuntu: https://bugs.launchpad.net/ubuntu/+sour … ug/1168742

The bug was also reported to systemd devs on the currently inactive freedesktop bugzilla on december 2013:

https://bugs.freedesktop.org/show_bug.cgi?id=72206

I have created a new bug report on the current bug tracker of systemd:

https://github.com/systemd/systemd/issues/20192

Offline

Board footer

Powered by FluxBB