CDDVD drawer opens immediately after closing in ubuntu 18.04

I don't use the internal DVD drive often, but when I used it last night each time I closed the drawer the drawer opens immediately. I thought the drive might have gone bad, but I exactly the same behavior with an external drive as well. Note: I tried the external DVD drive on a different machine running Debian and it doesn't exhibit this behavior.

What I've looked at so far:

sudo setcd -s /dev/sr0 Auto close tray: set Auto open tray: cleared Use O_NONBLOCK flag: set Lock tray: set Check CD type: set

I tried changing the settings using setcd. The only change that seemed to have any effect was

sudo setcd -f0 /dev/sr0

which clears the "Use O_NONBLOCK flag."

 Auto close tray: set Auto open tray: cleared Use O_NONBLOCK flag: cleared Lock tray: set Check CD type: set

When the "Use O_NONBLOCK flag" is set using

sudo setcd -f1 /dev/sr0

the problem resumes.

I tried

sudo udevadm monitor

with the Use O_NONBLOCK flag set, and there was a flood of messages like the ones below. This make me think that something is wrong with the driver or some obscure setting got changed someplace after a software update.

KERNEL[7862.150043] change /devices/pci0000:00/0000:00:1f.2/ata2/host1/target1:0:0/1:0:0:0/block/sr0 (block)
UDEV [7862.627306] change /devices/pci0000:00/0000:00:1f.2/ata2/host1/target1:0:0/1:0:0:0/block/sr0 (block)

I'm not quite sure what's going on with the DVD drive, or possibly the driver. I am open to suggestions for a fix.

Thank you!

More info: With a disk in the drive,

sudo lshw -C disk

Shows this:

*-cdrom description: DVD-RAM writer product: BD-ROM BDC-TD02 vendor: PIONEER physical id: 0.0.0 bus info: scsi@1:0.0.0 logical name: /dev/cdrom logical name: /dev/cdrw logical name: /dev/dvd logical name: /dev/dvdrw logical name: /dev/sr0 logical name: /media/someone/somedisk version: 1.02 capabilities: removable audio cd-r cd-rw dvd dvd-r dvd-ram configuration: ansiversion=5 mount.fstype=iso9660 mount.options=ro,nosuid,nodev,relatime,norock,check=r,map=n,blocksize=2048,uid=1001,gid=1001,dmode=500,fmode=400 state=mounted status=ready *-medium physical id: 0 logical name: /dev/cdrom logical name: /media/someone/somedisk configuration: mount.fstype=iso9660 mount.options=ro,nosuid,nodev,relatime,norock,check=r,map=n,blocksize=2048,uid=1001,gid=1001,dmode=500,fmode=400 state=mounted
1

1 Answer

FYI: This looks like it was a boot image or kernel problem.

Ubuntu did update this morning (2021-09-27). CD/DVD repeatedly ejecting problem seems to be fixed in boot image:

Linux 5.4.0-87-generic

Running

setcd -s /dev/sr0

Shows these as the default settings for the DVD drive (above) in my original question:

 Auto close tray: set Auto open tray: cleared Use O_NONBLOCK flag: set Lock tray: cleared Check CD type: cleared

Problem still exists in both of these boot images:

Linux 5.4.0-86-generic
Linux 5.4.0-84-generic

The temporary workaround for the two boot images above is:

sudo setcd -f0 /dev/sr0

which will temporarily change the Use O_NONBLOCK flag to "cleared" and stop the drive from immediately opening the drawer after it's closed.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like