What to do when a hard drive won’t unmount in OS X El Capitan

When OS X won't let you unmount a flash drive or external hard drive, here's what you can do.

Mac hard drive icon

Kurt Jefferson wants El Capitan to let his drives go!

Sometimes the drive won’t unmount no matter what, and I get the dreaded “The disk wasn’t ejected because one or more programs may be using it” or “The volume cannot be ejected because it’s currently in use” messages.

He’s had this happen routinely with a Mac mini using flash drives and external hard disk drives (HDDs). I’ve definitely seen some of this behavior, though it’s not routine. If OS X “understands” why it can’t unmount a drive, starting a few releases ago, it will tell you. But the dialogs Kurt is seeing aren’t the informative kind that tell you which app is involved.

Folks across the Internet seem to have connected the rise of this issue under El Capitan to Spotlight indexing. They’ve tested whether that was the cause by removing the mounted drive from Spotlight, and then they are able to unmount it. (Open the Spotlight preference pane, click the Privacy tab, and drag the volume into the “Prevent Spotlight from searching these locations” area.)

Failing that, logging out of your OS X account and back in should clear the state, allowing you to unmount it. And if that doesn’t work, a full restart should help.

I’ve discovered in El Capitan, unfortunately, that even in 10.11.4 it retains a few bugs that degrade the experience until rebooted, notably the “items disappear from my sidebar” bug. I documented it back in November 2015, and subsequent release of El Capitan (10.11.2, .3, and .4) seemed to reduce the frequency with which it occurs. But I have heard from readers that they are still seeing this disappearance as well.

Because some sidebar items derive from Spotlight searches, it’s possible that Spotlight is the culprit behind both disk unmount and the temporary loss of sidebar items.

If you want to dive down into the command-line level, launch Applications > Utilities > Terminal, and type precisely:

lsof | grep "/Volumes"

mac911 lsof command shows volumes files

The “list all open files” (lsof) command combined with grep to filter lets you see all open files on attached drives.

The lsof command is short for “list open files,” and sending the results via a pipe | to the grep pattern-recognition command and using /Volumes as the match shows only open files related to items on externally mounted drives. You can look through this list of files, and see if there’s a frozen program or something you need to uninstall that you didn’t realize was active.

Ask Mac 911

We’re always looking for problems to solve! Email yours to mac911@macworld.com including screen captures as appropriate. Mac 911 cannot reply to email with troubleshooting advice nor can we publish answers to every question.

Subscribe to the Best of Macworld Newsletter