Fedora 20 and Locking the CD-ROM Drive From Ejecting

I have an 18 month old toddler that loves to run up to my laptop while I’m working and push the eject button on CD-ROM drive and pull on the tray. One of these days, I’m worried he’s going to break it off.

It is possible, using the ‘eject’ command, to lock the tray and prevent it from being ejected by the button.

On Fedora 20, you’ll need to perform a few steps as root to get it working.

  1. Copy
    /lib/udev/rules.d/60-cdrom_id.rules
    to
    /etc/udev/rules.d/
  2. Open the copied file, and comment out the line beginning with ENV{DISK_EJECT_REQUEST}==
  3. You may need to force udev to trigger your rules: udevadm trigger

You can now use the eject command to enable the lock. Executing eject -i on will spit out eject: CD-Drive may NOT be ejected with device button, effectively locking your toddler out of your CD-ROM drive.

Click to share: Share on FacebookShare on Google+Share on RedditTweet about this on TwitterPin on Pinterest

One thought on “Fedora 20 and Locking the CD-ROM Drive From Ejecting”

  1. Thanks. That works great. I’m usually the fool who taps the button when I move the computer from bedroom to kitchen in the morning. That really annoys me as I use the CD drive every other blue moon.

Leave a Reply

Your email address will not be published. Required fields are marked *