Controlling the Spotlight indexing on Mac OS X

Sometimes your Spotlight starts to behave by re-indexing your disks over and over again, and you’ll either need to clear the Spotlight index for the drive or just disable the indexing for that particular volume if you don’t use the search often. The Mac OS X Spotlight is controlled by the ‘mdutil’ tool on Snow Leopard and Lion, so first of all get the current state of the things by typing this into your Terminal session:

mdutil -sa

The output will show the Spotlight index status for all connected volumes.

To disable the Spotlight index for your main, system volume, enter this:

mdutil -i off /

This disables completely the indexing processes, and you can force Spotlight to reindex the volume by deleting the Spotlight index storage directory, located in the root directory of the volume:

sudo rm -rf /.Spotlight-V100

Now enable back the indexing, triggering an immediate re-indexing of the volume:

mdutil -i on /

The whole process will take a few hours to complete, depending on how loaded is your volume with files.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.