Sometimes I insert a drive and Spotlight starts to furiously go about indexing it. It the drive is not mine, or I simply don’t want it index, and/or it has a lot of data on it which I don’t want to wait around for Spotlight to index… there’s a quick way to stop Spotlight using a terminal command.

/PATH is most likely going to be /Volumes/[DRIVE NAME] if it is a whole drive you wish to stop Spotlight from indexing. For instance, to stop it from indexing my friend’s backup drive when I plug it in, I use this command:

You will likely be prompted for a password. Type in your administrator password (which is likely your Mac account password, if your username is an administrator).

It is possible to also open the Spotlight preferences and add the drive to its Privacy list. But I understand from research online this is not the best method when the process has started.

Here’s a detailed description:

1. Let indexing begin on the volume.
2. Open Terminal, located in the Macintosh HD > Applications > Utilities folder.
3. At the Terminal prompt, type the following command, exactly as written:

  • sudo mdutil -i off /path_to_volume

where /path_to_volume is the path of the volume being indexed.

4. Press Return.
5. If prompted for a Password, type your Admin password, then press Return.

You will receive the response:

  • /path_to_volume/: Indexing disabled for volume.

under Mac OS X 10.4 or

  • /path_to_volume: Indexing disabled.

under Mac OS X 10.5 or later.

Spotlight will immediately cease to index the specified volume.

6. If you are using Mac OS X 10.5 or later, skip to step 9.

Otherwise, erase the partial index created by Spotlight under Mac OS X 10.4 . At the Terminal prompt, type the following command, exactly as written:

  • sudo mdutil -E /path_to_volume

where /path_to_volume is the path of the volume being indexed.

7. Press Return.
8. If prompted for a Password, type your Admin password, then press Return.

You will receive the response:

  • /path_to_volume/: Volume index removed.
9. At the Terminal prompt, type exit then press Return.
10. Quit (Command-Q) Terminal.