Spotlight Troubleshooting Via the Terminal

These are the basic troubleshooting steps when working with stubborn Spotlight index files. The GUI does not always work and you need to use the Terminal to get the job done. It's always good to repair the permissions on a volume before using these steps.

Disable spotlight on all volumes:

sudo mdutil -a -i off


 

Enable Spotlight on all volumes:

sudo mdutil -a -i on


 

Enable Spotlight on a particular volume:

sudo mdutil -i on /

The above example shows the root path.  If your using a different volume then use the full path.  I.E.  /Volumes/Data


 

Disable Spotlight on a particular volume:

sudo mdutil -i off /

The above example shows the root path. If your using a different volume then use the full path.  I.E.  /Volumes/Data


Delete the spotlight index file on a volume.

First navigate to the volume that you want to delete the index file on.  I.E.  /Volumes/Data

Then runls -alhto see a listing of all files at the root of the volume.  You should see a file called: .Spotlight-V100

Run this command to delete it:

rm -rf .Spotlight-V100

Then runls -alhagain and you should no longer see the .Spotlight-V100 file.


Create a new spotlight Index file on a volume.

mdutil -i on /  

The above example shows the root path. If your using a different volume then use the full path.  I.E.  /Volumes/Data

Runls -alhand you should see a file named .Spotlight-V100 file.


Find Spotlight Index file size.

Spotlight index files are normally large in size.  If you want to check the progress on an index file that's re building, run this command:

sudo du -hsc /.Spot*

You should see something similar to this:

675M /.Spotlight-V100

675M total

If you just rebuilt an index, run this command a few times and the file size should continue to grow.


Show the indexing status of all volumes:

mdutil -as

Locations
New York
ConnecticutFloridaLouisianaChicago 

Tel: (866) 518-9672

Corporate Headquarters
New York

3900 Veteran's Memorial Hwy. Suite 110
Bohemia, NY 11716
Tel: (866) 518-9672
hcs-ny@hcsonline.com

Connecticut

65 High Ridge Road #510
Stamford, CT 06905
Tel: (866) 518-9672
hcs-ct@hcsonline.com

Florida

3321 SW 194th Terrace
Miramar, FL 33029
Tel: (866) 518-9672
hcs-fl@hcsonline.com

Louisiana

218 Barksdale Drive
Broussard LA 70518
hcs-la@hcsonline.com

Chicago

4 Knollwood Place
Joliet, IL 60433
hcs-il@hcsonline.com

London

10 Grosvenor Court
Rayners Road
London SW15 2AX UK

Apple Consultants Network