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 most likely no translated for the post!





macOS - See what ap...
 
Share:
Notifications
Clear all

macOS - See what applications are locking your disk (cannot unmount)  

  RSS

Hans
 Hans
(@hans)
Noble Member Admin
Joined: 7 years ago
Posts: 1310
November 16, 2019 2:39 AM  

Sometimes your Mac doesn't like to let go of a disk and unmounting somehow fails.

Often this is because some applications is "locking" the disk and refuses to let it go for an unmount.
Now how do we find out what application this is?

First step; determine where the disk is mounted - in Terminal.
Quite often this is a directory in /Volumes/, for example /Volumes/MyDisk.

Next step we use lsof  (list open files) in Terminal, but we do need sudo (admin) rights for that.

sudo lsof /Volumes/MyDisk

This should display a list, for example something like this:

COMMAND     PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
mds 180 root 23r DIR 53,2 16384 2 /Volumes/MyDisk
mds 180 root 27r DIR 53,2 16384 2 /Volumes/MyDisk
Finder 11722 hans 51r DIR 53,2 16384 2 /Volumes/MyDisk QuickLook 11732 has 9r REG 52,3 1143491 7862 /Volumes/MyDisk/SomePicture.JPG

Here we see that "mds" and "Finder" are currently accessing your disk.
In this care it's very unlikely that either of these "lock" your disk.

"QuickLook" on the other hand seem to have a file open - and is most likely the case the one locking your disk.

To stop this, you can "kill" that particular task as such - CAUTION when killing a task, unsaved data in the application will be lost!
First determine the PID, the Process ID. So here that would be "11732".
Next kill it:

sudo kill 11732

ReplyQuote
brownelon258
(@brownelon258)
New Member
Joined: 2 months ago
Posts: 1
April 7, 2020 1:43 AM  

Hi,Thank you so much for sharing this informative and helpful answer. I must say,the way you elobrate the idea is an incredible, I'm really imaze the way that you describe the things. Please keep doin..

[URL=http://pcactivate.com/]mcafee.com/activate[/URL]


ReplyQuote
Share: