Spotlight is broken on my main partition in OS X 10.7.4

Not long after updating my main OS X installation from Snow Leopard to Lion, Spotlight stopped working on that partition, and I'm desparately trying to get it working again. It will find no files for any search, though it is working normally for other partitions and network volumes.

I'm running OS X 10.7.4 on an early 2009 Mac Pro. My main partition is 1 TB, and at about 75% capacity.

For what it's worth, I remember this started shortly after I installed a developer preview of Mountain Lion, but that could be a coincidence.

'mdutil -s /' prints the following:

/:
    No index.

I've tried many, many things to fix this problem, and all of them have been unsucessful. They are:

  • Repaired disk permissions

  • fsck'd my main drive

  • double checked that in Spotlight Privacy preferences my system volume wasn't excluded

  • Tried 'sudo mdutil -E /' but it prints:

    /:
        No index.
    
  • Tried 'sudo mdutil -i on /' but it prints:

    /:
    Error: unable to perform operation.  (-400)
        No index.
    
  • Other people who got the -400 error reported that terminating all mdworker processes and quickly recursively deleting /.Spotlight-V100 would fix it, but I tried that (several times) and it didn't resolve the error.

  • Ran my drive through DiskWarrior

Also, importantly:

  • I reinstalled Lion using Lion Recovery (not a fresh installation), which fixed Spotlight for about a day or two, and then it became broken again in exactly the same way.

I'm totally out of ideas on how to fix this problem. I could resort to installing OS X fresh to a blank partition, but it would take hours and hours to migrate all of my data, settings, scripts, tweaks, and to reinstall all of my professional software. I really don't want to have to do that.

Any help would be greatly appreciated!


I found this issue when searching for the web. Though it's been some time since the original asker has posted his question, I thought that it would be worth noting that, as of October, the Mac OS X 10.7.5 supplemental update resolved my Spotlight issues.

I was experiencing symptoms similar to the original poster's, with the same error messages that he encountered.


I also had strange Spotlight issues on my boot volume after upgrading from 10.6.8 to 10.7.2 and again after applying a combo update to 10.7.3.

I finally got things working again by trying the Spotless 4 demo

http://www.fixamacsoftware.com/software/spot4/index.php

On the boot volume, I shut off indexing, deleted the index and then turning indexing back on. After the rebuild, Spotlight worked.


For the record, I have solved this problem by doing a completely clean installation of OS X 10.8 on a new hard drive, and manually migrating over my old files, apps, and settings. It's unfortunate it came to that, and I wish I could offer a better answer that actually fixes the problem, but a reinstallation has finally solved my problem and I can use spotlight again.


I ran into a problem that was pretty much like this. In my case I had moved the /Users directory to another drive and mounted that drive on /Users. I wasn't getting errors, but no files were showing up in All My Files.

I tried the suggestion J.C. put forward, but the only way I could purge the .Spotlight-V100 directories was:

    host:Users itsme$ sudo killall -9 mdworker; sudo rm -Rf /Users/.Spotlight-V100/ 
    host:Users itsme$ sudo mdutil -i on -E /

Unless I put the mdworker kill on the same line with .Spotlight-V100 directory purge, mdworker would restart and hang the directory purge. Note that I never turned on indexing specifically for /Users. When queried to see if Spotlight was already indexing /Users, it was:

    host:Users itsme$ mdutil -sv /Users
    /Users:
            Indexing enabled.