In Mac OS X, the terms “ejecting” and “unmounting”, as they relate to removeable media, are considered interchangeable by most end users. Most people will talk about “ejecting” their USB flash drive, even though this doesn’t cause the drive to pop out like a CD or DVD. Apple explain this thus:
Ejecting a volume may not mean that it is physically ejected from the computer, but that it is no longer available (mounted) on the desktop or in a Finder window.
There is a wide array of devices that can be attached to Mac OS X – floppy drives, zip drives, firewire and USB hard drives, DVDs, CDs, iPods and other MP3 players, flash drives, cameras, and memory cards.
When devices are attached, they appear in the Finder – on the Desktop, and in Finder windows in the side bar.
Drives can be ejected in a number of ways too. You can press the “eject” icon next to a mounted drive in a Finder window, you can drag a volume to the Trash (which will change its icon to show an Eject symbol as you start the drag), and if you are ejecting an actual CD/DVD, you can just press the eject key on the keyboard.
At this point, with all these methods, why on earth would I be writing about improving ejection of removable media on OS X?
Saving to a flash drive
My wife has to use Windows at work. So she’s used to the Windows way of doing things. At home we don’t have any Windows machines, so she uses my Mac, and she doesn’t generally have a problem.
A short time back she came to me with a flash drive and asked me if she could save something a friend sent her in email to the drive. I said “of course”, and set about explaining to her how to do this.
I plugged in the flash drive, and started Mail. We found the mail item with the file attached and I said to her “Ok, we can use Exposé. We drag the attachment, and press F11, then drop it on the drive…”.
At this point, Kaoru asks me “Can you show me a ‘normal’ way to do this?”. Normal? Ok, what she meant was something a little more like you’d do on Windows. I thought for a second, and then said “Yep!”.
Back to the mail item, I clicked on the “Save” button on the mail item, next to the Attachments label. It brought up a save dialog, I chose the USB flash drive, and clicked “Save“. I laughed a little, as it was probably faster than the Exposé method I was going to use – I’m just so used to using drag and drop for everything.

At this point Kaoru asks for her flash drive back. “Ok, we have to eject it”, I said. “To do that we use Exposé to go to…”.
Ok, so here’s the issue. Without switching to the Desktop, or a Finder window, how do you eject removable media?1
Ejecting without the Finder
On Windows, when you plug in removable media, there is a little icon in the bottom right of the start bar that you click. It brings up a dialog, and from that you can eject the media. It’s not pleasant as you have to read a lot of text and press a few buttons on a couple of dialogs, but at the same time, it isn’t too pleasant having to switch over to the Finder or Desktop to eject media.
Now, OS X actually comes with an Eject Menu Extra. I hadn’t played with that for a long time, so I set about installing it. For those who don’t know, a Menu Extra is a little icon that appears in the right hand side of the Apple bar – like Volume and the Clock in OS X. This seemed like the solution we needed – it would be like Windows, though quicker to use as you just choose the drive from the list and it ejects.
To find this menu extra, go to the root of your hard drive and open System/Library/CoreServices/Menu Extras. Inside that window, double-click on the icon labelled Eject.menu.
In your menu bar you’ll now find the new Eject icon.

But there is a problem. This menu extra only works for CD and DVD drives! The USB flash drive, iPods, hard drives etc. don’t appear in the drop down menu.

This is a good solution if you have more than one CD/DVD drive. But it isn’t a solution for our needs.
A third party to the rescue
My next thought was to build my own eject menu item. But I figured I couldn’t be the only one who’d seen this shortcoming – someone must have built one already. And yes, it turns out they have.
I soon found Ejector. Ejector gives you an eject menu, and displays all ejectable media. One click, and the media is ejected.

It does have a few issues – the icon is a little ugly (you could replace it with the one from Apple’s Eject Menu Extra), and it lists your startup drive as an ejectable volume, which it isn’t. But overall, it does the job.
One more try
I did have another thought though. What if I put the /Volumes folder in the Dock. Then I could right click on that, then right click on a Volume and choose “Eject“. No need for a Finder window to pop up.
Unfortunately though, objects in dock popups from a folder are not real objects. They do not allow context menu clicks – they act as left clicks, opening a Finder window. So this doesn’t work either.2
What can Apple do to improve here
There are two possible solutions I can see here. Either Apple updates the Eject Menu Extra to work with all volumes, not just CD/DVD drives, or Apple creates an additional ejection method along the following lines.
If the only ejectable volume on your Mac is an inserted CD/DVD, and you press the Eject button on your keyboard, the CD/DVD should eject as it currently does.
If you have other media however, OS X should pop up a dialog. A simple dialog, perhaps even a cool dark translucent window like changing volume, that shows the other items that could be ejected. Pressing the eject button again would eject the CD/DVD drive – since that is probably the default mechanism for most users. However, clicking on the icon of one of the other volumes in this dialog would eject that volume.

In doing this, the menu bar wouldn’t get cluttered with yet another icon, and the eject button would still maintain the function you’d expect – “ejecting”.
Further, ejecting media would be a very simple process, not requiring switching applications. Simple and clean.
Something for developers
I did actually play around with some code in Objective-C and AppleScript to see how you find and list removable media. The results might be interesting for developers – I’ll write another article on that soon.
1 A friend did point out one way. You could go to “save” again in Mail, and from the side bar of the save dialog, press the eject button. This will work, but is perhaps a bit unintuitive, and is certainly an ugly hack solution.
2 I’ve been told that Stacks in Leopard also do not contain real objects, so you can’t get context menus on these items either. So this solution won’t work in Leopard. I can’t confirm this, as I don’t have Leopard, but I believe my sources are accurate.


Now if only there was software that would hear the pushing of the eject button on external optical drives and tell OS X to eject the disc…
Comment by Nonsanity — September 20, 2007 @ 2:23 pm