Find app that's using the disk

Tried to find the solution, can't seem to find the right one.

When I try to eject a disk and I get the warning that the disk can't be unmounted because it's in use, sometimes the only "app" I have is finder, so forcing quit other apps is not the solution, because there's none.

Using the activity monitor, I don't know what to look for. If we had a column that displayed which disk is using each app or process, that would make it easier, but I can't see any.


Is this even possible and kill whatever is using the disk so I can eject it?


Thank you!

MacBook Pro 13″, macOS 10.15

Posted on Jun 17, 2022 7:16 AM

Reply
7 replies

Jul 2, 2022 11:24 AM in response to tiagorocha

1) When using the sudo kill -9, 
do I have to use cd to change to the disk 
or not necessary (I did use that, just in case, 
but I would like to be sure)? 
Does it kill those processes even if I'm not on the disk 
(in this case it's an external disk)?

No. Your process' current working directory has not affect on the kill command.


2) Is it possible that killing those processes will somehow affect the main disk, 
or are these process really just specific to that disk and killing them will have 
no effect on the main one? Hope it makes sense...

A process can have lots of files open, just one of which is on your external disk. Actually it will have files open on the boot disk, if nothing else the executable file, and various library and framework files.


The only downside to killing a process with open files, is if the file has not flushed all modified information from process memory to disk, then that information would be lost.


The integrity of the file and file systems is generally not affected.

Jun 22, 2022 1:17 AM in response to BobHarris

Hi Bob! Thank you so much for your answer.

I was able to find those PID numbers. Then I used sudo kill -9 PID# to kill each one of them

(I tried all options I got offered, just to see what it would show me)


This allowed me to then eject the disk.


2 questions:

1) When using the sudo kill -9, do I have to use cd to change to the disk or not necessary (I did use that, just in case, but I would like to be sure)? Does it kill those processes even if I'm not on the disk (in this case it's an external disk)?

2) Is it possible that killing those processes will somehow affect the main disk, or are these process really just specific to that disk and killing them will have no effect on the main one? Hope it makes sense...


Again, thank you so much for this. This was driving me crazy!

Jun 17, 2022 4:42 PM in response to tiagorocha

Using the Terminal command line you can see what processes have open files on a particular volume. I suggest dragging & dropping the external volume onto the open Terminal window so it auto-completes the correct path after typing the following (make sure to leave at least one space at the end of the line after the "f"):

sudo  lsof  


For example if the external volume is called "ExtDrive", then the command will look something like this:

sudo  lsof  /Volumes/ExtDrive


You need to press the "Return" key at the end of the line to execute the command. You will also be prompted for your admin password, but nothing will display on the screen as you type the password. Press the "Return" key to submit your password.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Find app that's using the disk

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.