Taming Spotlight’s Indexing Problems

| TMO Quick Tip

Spotlight is a great tool for sifting through the files on your Mac's drives to find exactly what you need. It isn't so great, however, when its Index file get corrupted and you don't see all of your files -- or your Mac's fans start spinning incessantly.

If Spotlight is having trouble indexing your hard drive you may see the mds (It's part of Spotlight indexing) process hogging all of your processor. You can check by going to Applications/Utilities and launching Activity Monitor. This handy utility shows how much CPU each app is using, and if you click the Percent column, the apps that are using the most float to the top of the list.

If mds stays at the top, it may be time to force Spotlight to reindex your drives. Here's how:

  • Go to Applications/Utilities and launch Terminal
  • Enter this command in Terminal: sudo mdutil -E /
  • Press Return
  • Enter your administrator password when prompted

Reindexing Spotlight can fix search problems and give your fans a restReindexing Spotlight can fix search problems and give your fans a rest

Spotlight will trash the old index and start over, which could take a couple days depending on how much data it needs to dig through. Once it finishes, however, your fresh index should be fine and your Spotlight problems should be gone.

This tip came up during a discussion I was having with Mike Rose on the TUAW Talkcast, and is one of the reasons I love doing guest spots on so many shows.

Comments

Nancy Gravley

Great tip Jeff. Thanks.

NIcco

I am having exactly this issue, but it appears to be one particular drive.  can i specify which drive to re-index?

brett_x

Good tip Jeff.

Two comments.
First: ever since Spotlight came out, I’ve relied on EasyFind By DEVONtechnologies to be sure of my drive contents. It allows you to search ‘the old fashioned way’ if index searching doesn’t give you the results you expect.

Second:
Yes, NIcco.. You can reindex an individual volume by using Jeff’s command above, but don’t stop at the slash.. add “Volumes/YOUR_DRIVE_NAME” afterwards.

The command:
sudo mdutil -E /Volumes/Macintosh\ HD
would re-index just a hard drive volume named “Macintosh HD”

If you want to find the status of the indexing setting, you can type
mdutil -s /Volumes/Macintosh\ HD

FYI, you can almost always read the manual for any command line utility like this by typing man first.  ” man mdutil ” would give you useful info on what mdutil is and how to use it. 

Brutno

A simpler way to accomplish this task is to open System Preferences, select Spotlight. Select the Privacy section and drag your hard drive icon to the window. Click OK when prompted. This stops indexing for Spotlight. Then select the drive icon and click the minus button, and Spotlight will re-index the drive.

Log-in to comment