The disk “your disk” wasn’t ejected because one or more programs may be using it

trying to safely eject any hard drive

This error message has come up on a number of occasions and I’m sure many people have wondered what is the best way to deal with this. This is for macOS, OSX, Macintosh operating system. These instructions are the same for Mavericks, Yosemite, Sierra, High Sierra, Mojave, Catalina, Big Sur, Monterey.

I have found a few main things that cause this error…

1) There is an application you launched with a file open on that disk. Double check you have no applications running with files open on the disk. You can try quitting applications that opened files on the removable disk.

2) There is a terminal open, and you have changed directory onto the disk path in terminal. Check any open terminal windows and change directory

cd

to go back to your home folder, or

exit

to close them.

3) There is some other application, maybe an operating system application and not one you explicitly launched, holding a file on the disk open.

There is an application called “What’s keeping me” that can help you find which process is keeping your disk from ejecting http://www.hamsoftengineering.com/products/wkm/wkm.html . EDIT: This link is now broken as of 2022

I found QuickLookUIService will often hold on to the disk. QuickLookUIService is used to preview document, photos, or videos and will not properly let go of those files sometimes. In this case it will need to be Force Quit. Open Activity Monitor, sort by name, or search for QuickLookUIService, and click the x button and Force Quit! Or you can do it on the terminal with

killall -9 QuickLookUIService

Good luck ejecting your disks!


Posted

in

,

by

Tags:

Comments

14 responses to “The disk “your disk” wasn’t ejected because one or more programs may be using it”

  1. Antonin Avatar
    Antonin

    Thanks – super helpful. I closed the terminal app and my HD finally ejected properly without the error message.

  2. JAMES ANDERSON Avatar

    Thank you that worked! I use sshfs to connect to a hard drive on my local server. I preview with space and QuickLookUIService was using it! Was able to quit after.

    Thanks

  3. Emma Avatar
    Emma

    Thank you for this!! I was trying to eject my SD card with all of my Switch data (so of course the stakes were SO so high) but killing the QuickLookUIService processes worked!

  4. Angelica Avatar
    Angelica

    This completely solved my problem so thank you very much for writing it!

  5. nacuser Avatar
    nacuser

    Cool! Thank you!

  6. anon Avatar
    anon

    thank you!! getting rid of QuickLookUIService worked 🙂

  7. Mia Avatar
    Mia

    Thank you for writing this! Killing the QuickLookUIService worked! 😀

  8. Peter Avatar
    Peter

    Like many others, the culprit was “QuickLookUIService” for me too, and this post has saved my sanity! Thank you!

  9. name Avatar
    name

    QuickLookUIService was the culprit. This happened to me multiple times. Thank you for the quick tutorial!

  10. Nathan Avatar
    Nathan

    Top man – success – thanks for taking the time to post this

  11. Sujoy Avatar
    Sujoy

    Thanks! Found this in 2022! QuickLookUIService it was!

  12. Marvin Single Avatar
    Marvin Single

    Thank you for your good blog as always.Have a great day today

  13. Andreas Avatar

    Thank you so much for this, it worked!

  14. Chelsea Avatar
    Chelsea

    Was unable to eject from the Finder and Disk Utility, killall -9 QuickLookUIService worked for me, thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *