Page 1 of 1
Forum

Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!

Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.

Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!



macOS - Fix device ...
 
Share:
Notifications
Clear all

[Solved] macOS - Fix device cannot be ejected because it is in use ...

1 Posts
1 Users
0 Likes
1,752 Views
 Hans
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2678
Topic starter  

Sometimes I run into this issue; I'm trying to eject an SD card or USB stick, but my Mac just keeps telling me its in use and cannot be ejected ...
Messages like:

  • The volume can't be ejected because it's currently in use.
  • The disk "SomeUSBDisk" wasn't ejected because one or more programs may be using it.
  • umount(/Volumes/SomeUSBDisk): Resource busy

Of course none of this is helpful ... what the heck is locking my device?

To find out, we can use disktutil.
In this example I'll try to eject /Volumes/SomeUSBDisk (replace "SomeUSBDisk" with the volume of the disk you're trying to eject).
The output is just an example, on your system this may be another process or application.

sudo diskutil unmount /Volumes/SomeUSBDisk

The output could look like this:

$ sudo diskutil unmount /Volumes/SomeUSBDisk

Password: 

Volume SomeUSBDisk on disk2s1 failed to unmount: dissented by PID 326 (/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Support/mds_stores)

 

What we learn here is that our disk is locked by process 326 (PID 326). It even lists that this is the mds_stores tool.

If this is an application, then close it nicely. As an alternative you can try to kill it from the command line

sudo kill [PID]

or force kill it - be careful though, this is not recommended unless you know what you're doing.

sudo kill -9 [PID]

Example:

$ sudo kill -9 326

$ sudo diskutil unmount /Volumes/SomeUSBDisk 
Volume SomeUSBDisk on disk2s1 unmounted

 

 You disk can now be ejected ...


   
ReplyQuote
Share: