Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

After working with an external USB backup disk I want to cleanly unmount the drive. When pressing the 'eject' button Finder warns me with the message:

  • "The volume can't be ejected because it's currently in use."


  • "The disk "Diskname" wasn't ejected because one or more programs may be using it.".

or when trying to use the Terminal: umount /Volumes/Diskname

  • "umount(/Volumes/Diskname): Resource busy -- try 'diskutil unmount'"

As far as I am aware, I am not using this disk but Finder says I do, so I must be wrong. I prefer a clean unmount of the drive. As I am in the middle of doing multiple tasks, logging out and logging in is not preferred as is the installation of third party software.

Terminal command lsof might be of use here, but personally I think this is too complex for such a 'simple' problem and to be honest, I do not know how to use it properly.

My question: How do I know what program is using my drive so I can properly quit that program and eject my drive? The volume can't be ejected because it's currently in use. The disk "Camel" wasn't ejected because one or more programs may be using it. The disk "Mammtoh" wasn't ejected because one or more programs...

share|improve this question
"As far as I am aware, I am not using this disk but Finder says I do, so I must be wrong." You trust machines too much. ;-) Often, computers are wrong and we humans are right. – Nicolas Barbulesco Aug 18 '14 at 15:12
So what you are saying is that I am right? ;) – CousinCocaine Aug 18 '14 at 18:03
And if Spotlight is the culprit, save yourself some repetition: – John2095 Oct 19 '15 at 4:33

10 Answers 10

up vote 88 down vote accepted

lsof is indeed your best bet the fastest and easiest way would be this :-

sudo lsof | grep /Volumes/myDrive

which gives you a list of open files on the disk.

share|improve this answer
I found this as well, but I hoped someone has a non terminal solution. If not, you'll get your plus one ;) – CousinCocaine Oct 10 '13 at 10:50
→ Paul: I'd suggest you to improve your suggested command as: /usr/bin/sudo lsof /Volumes/myDrive – daniel Azuelos Aug 26 '14 at 11:11
Oh excellent, I did lsof without sudo which gives a totally different set of results. – alper Nov 10 '15 at 14:14
Yep, sudo is definitely needed in a lot of cases. In my case this revealed that it was due to Spotlight trying to index the disk, so the solution was to disable Spotlight for the disk, then manually stop/restart Spotlight. – Tom Jan 20 at 14:28

Have you tried $ diskutil unmount /Volumes/Diskname ?

Or $ diskutil unmount force /Volumes/Diskname ?

As the manpage points out:

Due to the complex and interwoven nature of Mac OS X, umount may fail often. It is recommended that diskutil(1) (as in, "diskutil unmount /mnt") be used instead.

If your volume has spaces in the name, be sure to escape the spaces with \, eg:

$ diskutil unmount /Volumes/Disk\ Name

Or use quotes to avoid confusion.

$ diskutil unmount "/Volumes/Disk Name"
share|improve this answer
I believe I tried this and it did not work. But next time I'll try it again and update my post accordingly. – CousinCocaine May 1 '14 at 8:30
Your example has quotes, not apostrophes. Which is a good thing. – Nicolas Barbulesco Aug 18 '14 at 15:14
@NicolasBarbulesco: Thanks for pointing that out, I made corrections to the answer. Good catch! – Iason Aug 26 '14 at 13:52
Worked -> sudo diskutil unmount force /Volumes/Diskname – tgkprog Mar 28 '15 at 6:43
@tgkprog Glad to hear it, also thanks for the sudo command, that may help others as well. – Iason Mar 30 '15 at 16:02

Your problem is probably caused by the process mds : Spotlight indexing your disk.

I have this problem, and I have not found a solution (yet).

share|improve this answer

You could try the donationware application "What's Keeping me?" that shows what process/application is using the volume/folder/file.

This program is certified by the developer for Mac OS X 10.6 Snow Leopard, but the RoaringApps page for this application lists it as working fine on OS X 10.7 Lion and OS X 10.8 Mountain Lion.

About What's Keeping Me?

Have you ever have the problem where you can’t empty the Trash or eject a disk because something is preventing you? Usually the reason is because some application has a file open, and thus you can’t get rid of the disk or trash the file. That’s why we made What’s Keeping Me! What’s Keeping Me will identify the application that is holding the item open. You can then use What's Keeping Me to quit the problem application (or kill it if needed) so you can perform your task. What’s Keeping Me includes an Automator workflow so you can perform searches directly from the Finder too!

share|improve this answer
This looks like valid software, but I really prefer OS X native solutions. – CousinCocaine Oct 10 '13 at 17:05
By native you mean something Apple provides? There's nothing like that on the GUI front. Plus, WKM has been around for several years. – M K Oct 10 '13 at 20:24
Thanks for your addition. Native is not the correct word, what I meant was 'non-third party'. WKM is a nice solution, but personally I prefer lsof. – CousinCocaine Oct 14 '13 at 7:56

I've had this message despite being sure there are no open files on the volume. I checked this with Why Not Unmount, a GUI tool that can indicate open files on a disk.

In my case, it was a sign that the file system is corrupt. Running Disk Utility (or if that wasn't enough, DiskWarrior) solved the problem and made the disk ejectable again.

share|improve this answer
In my case, the system was not corrupt. – CousinCocaine Apr 8 '14 at 11:14
Seems unlikely. More likely Spotlight, or some other app or service has a lock on the disk. – Tom Jan 20 at 14:33

There is a GUI alternative to the CLI app lsof:
fseventer is a great file system access monitoring utility for various purposes. It runs with super user permissions (sudo), so it sees all read/write access of all mounted file systems, and presents them in a very clear overview.

My experience: I had a Volume which constantly could not be ejected properly (as in the OP's screenshots), and always needed a "force eject", sometimes even a forceful physical disconnection (nor recommended! could damage your filesystem(s) on that disk) or a system shutdown to bypass that brute method.

My fix: Summarized: The ejection issue can be caused by corrupted or legacy file content on that Volume. Removing the troubled content can fix this permanently. In detail:

  1. Determine which file is accessed (with lsof or fseventer). In my case it was a Classic Mac OS file with a resource fork that remained open, likely as some background disk parsing process (Spotlight, QuickLook, or thelike) hung on it.

  2. Backup that troubling data into a file archive (which preserves (Classic) Mac specific resource data). I simply used Finder's native "Compress" function from it's context menu.

  3. Delete the troubled file/folder.

    • With Finder as usual. Likely this will fail, as it's a "troubled file/folder".
    • With Finder plus holding down ALT while emptying the Trash. This creates a little more force, but likely it will still fail.
    • Through the Terminal with sudo rm -R /path/to/troublesome/FileOrFolder. This eventually worked after Finder's delete attempts have failed.
  4. Try unmounting the volume again. It may still fail, as the background processes, which failed, could be still in a irrecoverable state.

  5. Restart. Then try unmounting again. From then forth the Volume worked fine again. Normal mounting, unmounting, read/write operations. Only when a file was indeed open by a user process, unmounting was prevented. Perfectly normal behaviour again.

share|improve this answer

Both the command line solution and What's Keeping Me work great.

To recap, command line in terminal is:

lsof | grep /Volumes/myDrive

The GUI application is What's Keeping Me, available at Hamsoft Engineering.

Screenshots of both with the same search going on.

Command line output GUI for What's Keeping Me

I prefer the command line just slightly, as it's always there with you. On the other hand, What's Keeping Me is quicker and easier to use if you've got it installed.

share|improve this answer

Solution Make sure all programs are closed. Click the Apple icon in the top left of the screen, then click Force Quit. In the list click Finder. Now click the Relaunch button. Then try ejecting the drive again.

share|improve this answer
Did you see this solution work? – Nicolas Barbulesco Aug 16 '15 at 11:45

Try to relaunch the Finder. Here it works

share|improve this answer

I restarted my Mac and that fixed it :-)

share|improve this answer
I prefer a clean unmount of the drive. As I am in the middle of doing multiple tasks, logging out and logging in is not preferred as is the installation of third party software. – CousinCocaine Jul 24 '14 at 6:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.