When Spotlight on my MacBook Air that runs OS X Lion didn’t show any results from the file system any more, I tried a lot of options, but only the final one worked: reboot:
MacBookAir:/ SuperUser$ sudo mdutil -i off
Password:
MacBookAir:/ SuperUser$ ls -al /
MacBookAir:/ SuperUser$ sudo rm -R /.Spotlight-V100
MacBookAir:/ SuperUser$ sudo mdutil -E /
/:
No index.
MacBookAir:/ SuperUser$ sudo mdutil -i on /
/:
Error: unable to perform operation. (-400)
No index.
MacBookAir:/ SuperUser$ sudo mdutil -i on -E /
/:
Error: unable to perform operation. (-400)
No index.
MacBookAir:/ SuperUser$ sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
com.apple.metadata.mds: Already loaded
MacBookAir:/ SuperUser$ sudo mdutil -as
/:
No index.
/.MobileBackups:
No index.
/Volumes/Firefox:
Indexing disabled.
/Volumes/MobileBackups:
Index is read-only.
/Volumes/MobileBackups/Backups.backupdb:
Index is read-only.
/Volumes/Opera:
Indexing disabled.
MacBookAir:/ SuperUser$ reboot
It was only later that I found out maybe a simpeler solution would have worked: kill all of the mdworker processes like this:
MacBookAir:/ SuperUser$ sudo killall -9 mdworker
–jeroen
Spotlight refuses to be enabled on Lion – Super User.