When trying to eject a disk, e.g. an external volume, via Finder then sometimes macOS is not able to name the exact application still accessing files on that disk – and leaves you wondering with a rather generic message: «One or more apps are using it». But we also learned that force-ejecting disks is a big No-No.

So how can you find out which exact application is preventing a disk from being ejected from your Mac?

Back in the day there was a neat tool «What’s keeping me?» that gave you a simple UI to quickly list all programs accessing and blocking open files on a volume, and closing them. In the meantime this app is no longer supporting modern macOS versions – and the UI-driven help even provided by Apple Support won’t do the job either, as sometimes a background-process has files open on the affected volume.

Here’s a step-by-step guide to find & close apps or processes, that still access files on a disk, in order to unblock the disk to be ejectable again.

🕵️‍♂️ Advanced approach to find apps blocking a disk from being ejected

This is a solid and compatible way for many macOS-versions. Unfortunately it means to resort to the technical Unix Terminal.app on your Mac. Optionally however you can use it in combination with Activity Monitor.app.

Open the Terminal.app

Find it in macOS Finder under Applications » Utilities (or shortcut ⌘CMD+⇧Shift+U).

Type the following command* targeting the affected disk’s name

lsof /Volumes/MyDisk

* optionally you can prefix the command with sudo lsof in order to also list system processes

This will list apps / processes currently accessing something on the disk

Similar to the following example.

Note: the most important information you need later is the «COMMAND»-name (= app / process name) and the «PID»-number (= unique Process Identifier).

COMMAND   PID  USER  FD    TYPE DEVICE SIZE/OFF NODE NAME
zsh     45355  me    cwd   DIR  1,24   512      2    /Volumes/MyDisk
bash    47740  me    255r  REG  1,24   73   34903    /Volumes/MyDisk/run.sh
lsof    47389  me    cwd   DIR  1,24   512      2    /Volumes/MyDisk
lsof    47390  me    cwd   DIR  1,24   512      2    /Volumes/MyDisk

Quit or kill the blocking apps / processes to allow ejecting the disk

While you are in the Terminal.app already, you can either use the Unix command to «kill» a process (app) by using its «PID»-number as follows:

kill 477740

…or you can use the Activity Monitor.app from the Utilities folder in Finder:

  • on the «CPU»-tab search for the process based on «COMMAND»-name or the «PID»number
  • select the app / process and click the «🛑Stop»-icon: then choose «Quit» or «Force Quit».
Screenshot from the macOS Activity Monitor.app showing a running process by Process ID and how to stop it

Now you should be able to eject the disk properly!

Kudos

Share:
  • 0
  • 0

Questions? Suggestions? Let us know with a comment!

This site uses Akismet to reduce spam. Learn how your comment data is processed.