Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

stanw

macrumors 6502a
Original poster
Aug 29, 2007
842
5
I keep receiving the message that my external hard drives can not be ejected because one or more programs may be using it. The only option is to do a force eject or I reboot the iMac and unplug it while it reboots or after it reboots I can safely eject it. This keeps happening with different hard drives and it just happened when copying files from one drive to another, and the drive was not using any programs.

1. is it bad for the drive to not safely eject it and just reboot the mac instead?
2. is there some way to safely eject it when I receive this message? I quit every single program and even re launch finder and check the force quit menu and none of that seems to help.

Thanks!
 
I've had this happen on occasion, where even when I quit every single application, it still won't eject because it claims the drive is in use. Generally, what happens is some application has a rogue file descriptor locking some file on that volume. If you lsof and grep for the volume name, you should be able to locate the process locking a file on the volume, and you can (hopefully) kill the PID, then eject / unmount the disk, without having to restart.
 
OP> I get that sometimes when Spotlight it trying to index an external drive. You can prevent this by adding each of the drives to the exclude list in Spotlight settings. This fixed it for me on two different external drives I use.
 
Last edited:
  • Like
Reactions: Gav2k
It would help to know what kind of files are on the external disk(s). If there are text files and you haven't done what was suggested in post #4, Spotlight will try to index all of the textual content, which can take some time if there are a lot of files with textual content. For non-textual files, it'll index the file names and metadata, if present. That could explain the problem when doing the file copy, particularly if both drives are being used for the first time on the computer.

For some (all?) Apple apps if there are no files open, the app appears like it isn't running in the dock when it still is running and still has a hold on a file. I have also had issues since Yosemite with Terminal preventing an eject even after the current directory is not on the external drive. I have to close the Terminal window or the app to eject.
 
Sometimes Preview keeps an unholy grip on files after you close them.
The cure is to open a different file, in this case on a different drive, with Preview, then quit again.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.