X

Cannot eject an external drive

Spotlight may be to blame.

CNET staff
2 min read

[Wednesday, May 21st]

Several users have experienced an issue in which an attached FireWire or USB drive will not eject. Instead, an error message pops up claiming the drive cannot be ejected because it is in use. This may occur with hard drives, flash drives, or any other storage system. As Apple discussion member vburger writes:

"I have a Maxtor 500GB HD attached via USB to my laptop. Quite often, when I want to detach it I get the message: 'The Volume could not be ejected because it is currently in use'. However, I am not aware of any active application that is still using the HD."

Warning: Unless it cannot be avoided, do not unplug or shut off an external drive unless it is first unmounted. Data corruption and potential system crash could result.

Fixes:

Disable spotlight indexing for the drive The most common culprit for this isuse seems to be Apple's Spotlight indexing services, which maintain an index of all local filesystem for quick finding of search queries. Many times the indexing can take a while, and will keep the drive in use. To disable spotlight indexing for the drive, open the Spotlight system preferences and add the drive to the "Privacy" list. If that does not stop the indexing, the drive's spotlight index could be corrupted, in which case Spotless to manually remove the Spotlight index:

  1. Download the utility Spotless.
  2. Use the tool to erase the Spotlight index.
  3. Restart your Mac.

Close all open documents and/or applications If an application has a document open on the drive, then the drive will not eject. Ensure all applications on the computer are closed and try to eject the drive.

Check the file open status on the affected hard drive Sometimes a utility or background process that might not present itself as an open application will access the drive. To see a full list of the files that are open on the drive and the corresponding applications/processes that have those files open, run this command in the terminal:

  • lsof /Volumes/VOLUME_NAME 

This will output a list which will pinpoint the specific process that has an open file on the drive. You can then locate and quit the process using Activity Monitor. If the process is owned by anything but your username then it might be best to restart the system instead of quitting the process, as this may destabilize the computer.

Restart the computer If none of the above works, shutting down or restarting the computer will quit all processes and allow the release the drive. If the problem keeps returning then formatting the drive with Disk Utility may help.

Resources

  • vburger
  • Spotless
  • More from Late-Breakers