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 or Catalina.
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
to go back to your home folder, or
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 .
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
Good luck ejecting your disks!