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 problemsudo setcd -s /dev/sr0 - This solution id for Dell PC but nevertheless tried. Did not work
51 Answer
As indicated in the comments, this problem is probably the same as
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/autoejectOr using /etc/crontab: ( edit file /etc/crontab )
@reboot root echo 0 > /proc/sys/dev/cdrom/autoejectThen as a one-time, non-persistant across boots, command line use sudo:
echo 0 | sudo tee /proc/sys/dev/cdrom/autoejectWhich 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.