Spotlight index broken on OS X Lion

This morning I tried to open Mail on my Mac and was using Spotlight for it as usual. But despite a dictionary-, web- and wikipedia-search nothing was found.

The Spotlight index was somehow corrupted and I tried to fix it by running mdutil (manages the metadata stores used by Spotlight). Unfortunately my boot volume was not in the list of indexed volumes.

$ sudo mdutil -as

Trying to turn the indexing on was not possible for “/” or “/Volumes/Macintosh\ HD”.

$ sudo mdutil -i on -E /Volumes/Macintosh\ HD
/:
Error: unable to perform operation. (-400)
No index.

After I deleted the Spotlight directory and killed all “mdworker” processes via the Activity Monitor, mdutil was finally willing to start rebuilding the index. A system reboot should have made it as well as killing the mdwokers directly, I guess.

$ sudo rm -Rf /.Spotlight-V100
$ sudo mdutil -i on -E /

About these ads
This entry was posted in lion, mac and tagged , , , . Bookmark the permalink.

7 Responses to Spotlight index broken on OS X Lion

  1. Jacob Møhl says:

    My Spotlight also broke. I followed your guide up to the last command. But when i try to “restart” the Spotlight with “$ sudo mdutil -i on E /” i get a “Error: unable to perform operation. (-400) No Index”. Error.

    Do anyone have a solution?

  2. dockthirteen says:

    Hi Jacob, removing all mdworker processes seems to be essential. Good to hear that a system restart started the indexing. A colleague said “sudo killall -9 mdworker” is the recommended way to get them all out of the system.

  3. Pingback: Spotlight unter Lion

  4. vodar_shan says:

    It worked! I just quit the SystemUIServer with Activity Monitor before using your command lines. Thank you

  5. Thank you all, this solved the problem here:)

  6. Still actual info as of 2013… deleted /.Spotlight-V100 … However now I had no mdworker at all, so I killed mds instead and viola – got a new mds and a bunch of hard working mdworker reindexing my drive

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s