2

Ubuntu 20.04

I have tried below solutions provided in Ubuntu forums but it has not solved the problem.

eject -v -a off - Tried this but did not solve the problem sudo setcd -s /dev/sr0 - This solution id for Dell PC but nevertheless tried. Did not work

  • 1
    Could you add the full output of sudo eject -v -a off to your question? – Eduardo Trápani May 12 '20 at 04:26
  • govind@Saras:~$ sudo eject -v -a off eject: using default device cdrom' eject: device name iscdrom' eject: expanded name is /dev/cdrom' eject:/dev/cdrom' is a link to /dev/sr0' eject:/dev/sr0' is not mounted eject: /dev/sr0' is not a mount point eject: disabling auto-eject mode for/dev/sr0' govind@Saras:~$ – Govind Soundararajan May 12 '20 at 04:30
  • Looks like the only way is pull off power cable to CD Drive to stop opening randomly. But then, I will not be able to use CD Drive when needed. – Govind Soundararajan May 16 '20 at 15:54
  • 2
    You should rule out hardware malfunction. Turn on the computer but don't let it boot into Linux, you can go to the setup menu, or the boot menu and then do nothing. If the drive opens up by itself after a while, or even at boot, then Linux is not the problem. – Eduardo Trápani May 16 '20 at 16:06
  • Similar issue discussed below. https://superuser.com/questions/1343049/dvd-drive-opening-automatically – Raghav Dec 17 '20 at 03:59
  • Anyone else suffering this should also tick "this bug also affects me" on Launchpad, here: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1942299 – Liam Proven Jan 27 '23 at 13:18

1 Answers1

-1

As indicated in the comments, this problem is probably the same as https://superuser.com/questions/1343049/dvd-drive-opening-automatically

My alternative solution to avoid changing systemd is by simply inserting a '0' into /proc/sys/dev/cdrom/autoeject

Pick one:

Using rc.local: ( edit file /etc/rc.local )

echo 0 > /proc/sys/dev/cdrom/autoeject

Or using /etc/crontab: ( edit file /etc/crontab )

@reboot root    echo 0 > /proc/sys/dev/cdrom/autoeject

Then as a one-time, non-persistant across boots, command line use sudo:

echo 0 | sudo tee /proc/sys/dev/cdrom/autoeject

Which will take effect immediately. No sysctl or service file restart. needed... On the next boot, the modifications to rc.local or /etc/crontab. will take effect, inhibiting the AutoOpen function.

dave58
  • 191