Linked List

A personal knowledge base

Mac OS X

#Eject a Drive That Refuses to Unmount Without Force Ejecting

Sometimes when ejecting an external USB drive Finder will complain that the drive may be in use and can't be ejected. A common option to try in this case is to run lsof to try to find what process has files open on the drive but in this particular case it lists not files on the drive. The following alternative steps will generally reveal the culprit:

sudo diskutil unmount /Volumes/Drive\ Name

This will likely fail with an error like:

Volume Drive Name on disk4s2 failed to unmount: dissented by PID=176 (/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Support/mds_stores)

Assuming the process is not one you control directly and looks like it can handle being killed off:

sudo kill 176

Where 176 is the process id (PID=176) in the message from diskutil.

Last modified: 01 May 2016