Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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."

or

  • "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

5 Answers 5

up vote 12 down vote accepted

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

lsof | grep /Volumes/myDrive

Which would give 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
    

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 apostrophes 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 at 8:30

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

If you get this message when you are sure there are no open files on the volume, it may be a sign that the file system is corrupt. I've had this a few times, and running Disk Utility (or if that wasn't enough, DiskWarrior) solved the problem and made the disk ejectable again.
Why Not Unmount is another GUI tool that can indicate open files on a disk.

share|improve this answer
    
In my case, the system was not corrupt. –  CousinCocaine Apr 8 at 11:14

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 at 6:44

Your Answer

 
discard

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.