Home » Questions » Computers [ Ask a new question ]

disable cd/dvd button on linux laptop (ubuntu)

disable cd/dvd button on linux laptop (ubuntu)

My todler is continuosly pushing the cd/dvd button and trying to destroy the tray. I know it should be possible to let her life harder, disabling the eject button. How to do that? This is ubuntu (shouldn't matter) linux. See also the this related question.

Asked by: Guest | Views: 37
Total answers/comments: 3
Guest [Entry]

"You might want to try this out...

Guest [Entry]

"Ubuntu's default automounter doesn't lock the CD/DVD try when it mounts an inserted disc. But if you mount the disc manually (say, with sudo), the tray should lock and stay locked until you dismount the disc.

So this process would accomplish what you want, without disabling other functionality, and you could even script it for quick access:

Insert a disc,
Run sudo umount /media/cdrom, then
Run sudo mount /dev/cdrom /media/cdrom

Obviously, replace those paths and devices with ones your system uses."
Guest [Entry]

"eject -i 1 only works a single time on Ubuntu 20.04 (focal) -- only mildly useful for those of us who accidentally hit the eject button constantly throughout the day.
Simply adding this command to the cron entry (crontab -e) such that the command runs every minute satisfied my need, although the placement of this button over the Del key will forever remain a mystery. For the record, I was NOT able to get this to disable through the Ubuntu keyboard settings.
* * * * * eject -i 1"