Ejecting external optical drives in OS X

If you have an external optical drive in OS X, the built-in Eject key on the keyboard may not work with it, so here are some options for handling external discs on your Mac.

When an optical disc is mounted in OS X, it cannot be ejected by pressing the button on the optical drive, as is the case with Windows PCs. In fact, even though some of Apple's OEM drives contain the standard eject button, it is hidden by the system's chassis. When mounted, the disc is locked by the system so to eject it you will have to do one of three things:

  1. Drag to the trash
    Dragging a removable disc to the trash has been in the Mac OS since early on. It is how floppy disks were ejected when they were prevalently used, and migrated up to being used for optical discs as well.

  2. Select it and press Command-E
    If you select the optical disc in the OS X Finder and press Command-E, the disc will eject. This is an evolution to the Command-Y option in the classic Mac OS for "Put Away" that could be used for ejecting among other options in the classic Mac OS.

  3. Eject using the keyboard
    The first two options will work for any drive in the system, be it internal or external; however, even though Apple includes an Eject key on its systems, the key will only work for internal drives (if you have two optical drives, holding the Option key when pressing Eject will eject the secondary drive).

If you have an external drive attached to your Mac, then the Eject key will not work; however, there are options for managing external drives using the keyboard. To eject an external optical drive in OS X, just enter the following command in the Terminal:

drutil eject -drive external

Automator workflow
You can use Apple's "Automator" tool to create a system service out of the Terminal command (click for larger view).

Entering this command in the Terminal will work, but doing so every time would be a bit cumbersome, so you can set this up as a service that you can then bind to a custom keyboard shortcut for quick access. To do this, do the following procedure:

  1. Open Automator, and create a new "Service" workflow.
  2. At the top of the service, set the "Service Receives" option to "no input" in "any application."
  3. Add the "Run Shell Script" action to the workflow, replacing the default "cat" command with the full command to eject the external drive (above).
  4. Save the workflow and name it something appropriate (e.g., "Eject External Disc").
  5. Go to the "Keyboard Shortcuts" tab in the "Keyboard" system preferences.
  6. In the "Services" section, check the new "Eject External Disc" option and click to the right of the service's name to edit the shortcut for it (you should see an edit field appear).
  7. Type your keyboard shortcut (ensure it is unique--I use Control-Option-Command-E)
  8. Close the system preferences.

With the keyboard shortcut set, now whenever you want to eject a disc in an external optical drive, you can press the keyboard shortcut and the drive should eject. Sometimes applications may not pass the keyboard shortcut to the system services, in which case you can usually get it working by activating the Finder and pressing the shortcut again.



Questions? Comments? Have a fix? Post them below or e-mail us!
Be sure to check us out on Twitter and the CNET Mac forums.

Tags:
Computers
About the author

    Topher, an avid Mac user for the past 15 years, has been a contributing author to MacFixIt since the spring of 2008. One of his passions is troubleshooting Mac problems and making the best use of Macs and Apple hardware at home and in the workplace.

     

    Join the discussion

    Conversation powered by Livefyre

    Don't Miss
    Hot Products
    Trending on CNET

    HOT ON CNET

    Delete your photos by mistake?

    Whether you've deleted everything on your memory card or there's been a data corruption, here's a way to recover those photos.