Macintosh Problems Finding Results

I recently came across two completely unrelated installations of Mac OS X 10.5.6 where Spotlight had failed to index any new searches and was either holding onto a previous index or contained nothing at all. If you’re encountering Mac Spotlight problems, you might find the following useful.

The two macs I was dealing with were a 24 inch iMac – Intel Core 2 Duo 2.93GHz with 4GB RAM and 640GB hard drive installed. Spotlight seemed to be working properly with the iMac. You could perform a search and find a file, BUT if the file was newer it would not find it. The other was a Xserve with two 2.66GHz Quad-Core Intel Xeon Nehalem with 3GB RAM, 160GB Hard Drive installed and had a Promise VTrak E-Class RAID subsystems attached via Fiber Channel. I installed this Xserve out of the box with Mac OS 10.5.5 installed and updated it to Mac OS 10.5.6. Once the XServe was configured I attached it to the Promise VTrak subsystems and began transferring the companies archive files to it. After this was complete I began searching with Spotlight to see if I missed anything. I found that spotlight worked locally on the first and second Hard Drive but failed when asked to search the Promise VTrak.


There are two ways of handling this type of problem, either through the System Preferences or Terminal. Before starting either option please remember to always REPAIR PERMISSIONS before starting. The System Preferences route is mainly for those who have not used Terminal before and want to use something that is already part of the Mac OS 10. Simply launch System Preferences and Click on Spotlight. Once open, click on the Privacy Tab and then on the “+” (plus) button and add the volume you are trying to index. Wait a few minutes (5-10) and select the volume again on the Privacy Tab and click on the “-” minus button to remove it again. This will force Spotlight to perform a clean re-index of the volume.

In both cases I used the mdutil command in Terminal to resolve the issue. If you are not familiar with mdutil, its the command used to manage the metadata stores of mounted volumes that are used by Spotlight. The mdutil options include:

-p Publish metadata.

-i (on|off) Turn indexing on or off.

-E Erase and rebuild index.

-s Print indexing status.

-a Apply command to all volumes.

-v Display verbose information.

To perform this command you will need to launch Terminal and type the following to turn off indexing:

username$ sudo mdutil -i off /Volumne
Password: (your password here)

With Terminal still open, type the following to get an index of the volume you are trying to repair spotlight on.

username$ cd/
(This gets you into the volumne structure)
username$ sudo ls
(This give you an index of all the hidden files on your Hard Drive)

You should see something similar to the following:

.DS_Store      Library      home

.Trashes      mach_kernel

.fseventsd       Shared Items      mach_kernel.ctfsys

.hotfiles.btree     System      net

.vol       Users      private

Applications      Volumes      sbin

bin      tmp      cores      usr

dev      var

Groups      etc

The two files you are after here are the .metadata_never_index and .Spotlight-V100. In one of my cases the .metadata_never_index was missing as in the example above. Don’t freak out if it is. The next two commands will remove these two files.

username$ sudo rm -r /.Spotlight-V100
username$ sudo rm .metadata_never_index

the sudo rm of the .metadata_never_index might return the following as mentioned about. Not to worry – that’s why we are working through these steps to get everything up and running again.

rm: .metadata_never_index: No such file or directory

Now let’s get everything back up and running. Type the following:

username$ sudo mdutil -i on /
/:
Indexing enabled.
username$ sudo mdutil -E /
/:
Indexing enabled.
username$ exit

That should do it. You will see the Spotlight icon in the upper right corner start pulsing a small dot in the center and if you click on it you can find out how long it will take to re-index.

Similar Posts:

2 Responses to “Mac Spotlight Not Working: OS X Spotlight has problems Finding Results”

  1. barrylewis says:

    Thanks for this info. I have gone through the steps and see the pulsing dot… hopefully this will fix Spotlight since I have come to rely on it as being a fast way to get what I need.

    If you feel like making some typo updates, Volume is spelled a bit weird, and there is a space between “cd /”

    Again, I am grateful for you posting this info.

  2. wmike1503 says:

    Hi,

    Thanks for this.

    Worked well. Unfortunately, like a lot of solutions offered for the OS X – the indexes are lost when rebooting – back to square one.

    Very frustrating ( I am new to Mac – from many years with windows).

    I am amazed that such a fundamental need for searching a network is so badly served by the World’s best OS (Apple’s words).

    In the world of windows this is no problem.

    Question – is there any way to make your solution persist on reboot?

    Many thanks!

    Mike

Leave a Reply

You must be logged in to post a comment.



Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Mac Users Guide Forum

    It Seem There Is Something Wrong With BBLD Configuration, Please Check It.