Spotlight corruption

I don't recall this happening pre-SL - or not this frequently anyway.

I'm finding that maybe about weekly I'll be doing a simple search after saving a new file or moving a file to another location (or similar operation), when suddenly without warning Spotlight will freeze up and go into endless beachballing and not find anything. I can sometimes fix it by running a Spotlight re-index, but quite often rebooting the system is the only fix. When that happens it seems to vary 50/50 between the times when all is well after a reboot, and the other times when the system automatically reindexes Spotlight on reboot.

This morning I had the latter occurrence (auto reindex on reboot). Just before rebooting I tried something I hadn't done before ... I launched Cocktail, with the intention of rebuilding the Spotlight index from there. When I got into the relevant panel and clicked a menu to select a volume to index, the menu was empty. On releasing the mouse, I got an error message. Unfortunately I didn't think to note the error message down. But it said something about not being able to find a Spotlight index for any volume, and I think something about it not being built correctly (??). I'm pretty sure it also mentioned "/usr/bin" and "mds" somewhere. (Sorry - I'm not a geek.)

So I'm guessing that I'm getting some recurring corruption in the Spotlight index or something such. I've searched this forum and Google generally, and found various bits about Spotlight not working well. But nothing quite matches this.

Can anyone help? Thanks.

macbook2.16, Mac OS X (10.6.2), Also on home LAN: G4 macmini 1.5G and eMac 1G, both w/ 10.5.8; one PC with XP

Posted on Jan 3, 2010 7:29 PM

Reply
17 replies

Jan 3, 2010 9:44 PM in response to Lance Lawton

no need for disk warrior if no errors are reported. try rebuilding the entire spotlight folders on all drives

run the following terminal command

sudo rm -rf /Volumes/*/.Spotlight-V100


you'll be prompted to enter your admin password (which you won't see). that's normal. after that run this command

sudo mdutil -i on /Volumes/*


this will initiate spotlight reindexing. wait for it to finish and see if spotlight behaves after that.

Jan 4, 2010 4:08 PM in response to V.K.

Thanks, VK. I've now done that, so I guess we'll see what happens over the next few weeks. One possible problem: Something odd happened in the middle of it all. I tried to import a file into iTunes, and iTunes crashed. I then noticed that the indexing had stopped, and it looked like it was finished. But the itunes issue resulted in me needing to restart the system. When it rebooted, it proceeded to rebuild the Spotlight index again. This time it took about as long as it normally does. All seems fine now - but it's early days.

While we wait ... I do note that this process [before the itunes issue] took much longer than the standard index rebuild (which I would usually do through an application that provides that as a menu command). I'd appreciate a "translation" - i.e. what does the combination of these two terminal commands actually do, and how does that differ from "sudo mdutil -E /" ?

Thanks.

Jan 4, 2010 6:10 PM in response to Lance Lawton

the first command deletes the entire spotlight folder for every file which contains a number of configuration files (which may be corrupted )and the index. the second command turns spotlight back on on every file so that those folders are recreated with default contents and then reindexing starts. the command *sudo mdutil -E /* just dumps the index on the main drive. it does not touch other drives and it does not touch some other spotlight configuration files that may have been corrupted.

Jan 14, 2010 4:15 PM in response to Lance Lawton

Well I used the Terminal commands, and left the computer quite awhile. When the indexing & rebuilds were done, I rebooted. Well my trash problems are gone, but it seems that my Admin lock can only be authenticated right after an indexing, and with no restart. If I reboot/restart the authentication will not work. The Admin lock stays locked, and the password panel does not even come up. I've already tried to change my password with the drop-in disk days ago. It does seem to be a Spotlight related problem. I may try more with rebuilds and maintenance with Onyx. I've only installed Onyx a few days ago. Please post any results you experience.

Feb 19, 2010 11:07 PM in response to Lance Lawton

duhg,

Do you perchance use Ironic's Leap or Yep? Or another app that handles file tagging using either OpenMeta or Spotlight or some other tagging thingy?

I ask because I've just had the corruption recur after a decent gap since the last time. (And so I've run the fix described above - again.) I have a growing suspicion that, at least in my case, the issue is triggered by my doing a lot of file tagging in a short space. For the past several weeks I've been keeping up with my file tagging very consistently as I go, and so haven't done it in large volumes at any one time. But the other day I was ploughing through a backlog of tagging in a particular folder, and that was when the corruption recurred. And I seem to recall having such problems before in such circumstances.

Any thoughts?

Feb 19, 2010 11:16 PM in response to Lance Lawton

Separate post for a separate but related question:

When I recently performed the above Terminal operation, it returned the following:
/:

Indexing enabled.
/Volumes/Calvin:
Error: invalid operation.
No index.
/Volumes/Calvin 1:
Indexing enabled.
/Volumes/Ezra:
Error: invalid operation.
No index.
/Volumes/Ezra 1:
Indexing enabled.
/Volumes/Nehemiah:
Error: invalid operation.
No index.
/Volumes/Pelagius:
Indexing and searching disabled.


I'm wondering whether that's significant (but am not geeky enough to know). "Calvin" and "Ezra" are my two main backup and archive disks. "Nehemiah" is my portable backup disk, which I use when away from home (I'm on leave at present, so it's not currently in use). "Pelagius" is my bootcamp partition, and I have it excluded in Spotlight's privacy settings.

I'm especially interested in "Calvin 1" and "Ezra 1". I've noticed these names before and wondered about them. The " 1" bit isn't a part of either volume name in Finder, and never has been. Does this offer any clues to my corruption issue? Or is it a red herring?

Thanks.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Spotlight corruption

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.