How to eject my external drive when my Mac refuses because of Spotlight?

I have plugged an external disk to my Mac. Now, I want to eject it. But my Mac stubbornly refuses and says that an application may be using the disk.

I have not launched any app neither opened any file from the disk.

I have downloaded and installed the app What's Keeping Me? This app is quite nice. She tells me that the process mds is using my disk.

I have killed the process mds and several processes mdworker. These are for Spotlight. But such processes get spawned again.

How can I eject my disk from my Mac ?

I have Mac OS X 10.6.8.


Simply turn indexing off for the drive and erase the contents of the journal on the volume. To do so, open Terminal and enter the following command:

sudo mdutil -Ei off "/Volumes/Name_of_Drive"

You must run this procedure as an admin. Enter your password when prompted. A reboot may be required.

Alternatively, as suggested by Simon White, just shut down the machine and then unplug the drive. The caveat is that the drive will start indexing when connected again, however.


You may try to unmount it from the command line:

diskutil unmount /Volumes/MountPoint

or with force:

diskutil unmount force /Volumes/MountPoint

If it's still failing, check what's using your disk:

sudo fs_usage -w -f filesys | grep Volumes

Or using lsof:

sudo lsof | grep Volumes

(Some processes only turn up when lsof is run as administrator.)


To disable temporary Spotlight, run:

sudo mdutil -a -i off

Then sudo mdutil -a -i on to re-enable.


Other apps which can be helpful: Whats Keeping Me.