How to turn Spotlight OFF (and ON Again)….


UPDATE: Please see this article if you use Leopard (OSX 10.5+). The procedure below, although not damaging, works for 10.4 and below (Tiger). Thanks to Anonymous for pointing this out.

Got a new Macbook thru work today and after Firewire targeting my profile over from my personal MBP, I started looking around the blog for the entry that shows you how to turn off Spotlight. You see Spotlight is a good idea, but I think it needs a bit more work. I’ve noticed that on my MBP and older Dual G5 machines, the mds service sometimes just goes nuts (usually corrupt files or something like that), and brings the machine to a halt. So I like to turn Spotlight off ASAP. Here is how:

  • Edit /etc/hostconfig (don’t forget to sudo) and change the line that reads
    SPOTLIGHT=-YES-
    to
    SPOTLIGHT=-NO-
  • Run the following two commands from the command line to get rid of existing index files
    sudo mdutil -i off /
    sudo mdutil -E /
  • Reboot

Note that the crazy spotlight icon will still be there, but the backend (the bad stuff) will be disabled after the reboot. You can optionally kill the icon (not recommended) by issuing the command:
sudo chmod 0000 /System/Library/CoreServices/Search.bundle
Later on if you want to turn spotlight back on (why?) you can do it by doing the following:

  • Edit /etc/hostconfig (don’t forget to sudo) and change the line that reads
    SPOTLIGHT=-NO-
    to
    SPOTLIGHT=-YES-
  • Reboot
  • Run the following command from the command line to turn on indexing
    sudo mdutil -i on /

Enjoy….

, ,

17 responses to “How to turn Spotlight OFF (and ON Again)….”

  1. i think your blog is interesting in everyway comecheck out mine but just a little insight im 15!

  2. That’s weird. I use a G4 1.25 Mac Mini with 512 MB of RAM with a LaCie 160GB mini external drive and have never had the problem you describe with Spotlight.

    I did have a problem, once, with hundreds of these weird “temp files” that didn’t actually exist (when i would try to reveal or open them, they weren’t there) showing up in every Spotlight query I ran. I think they were generated by some weird plugin or something, though. I haven’t seen them in a really long time. Reindexing seemed to clear them out.

  3. informative post. Note that it will also disable searches inside aplications that use Spotlight, such as iTunes.

    It probably will also kill Google Desktop – the two products have a somewhat symbiotic relationship.

    Performance hounds note – Spotlight only uses CPU while it is indexing new files. In a typical day’s use, that’s not much activity.

  4. A great little utility called Cocktail allows you to enable or disable Spotlight & erase the spotlight index for a given HD.

  5. I turned off Spotlight and deleted the index file as per guide and the search function inside iTunes still work but not on iPhoto & Mail.

  6. “Note that it will also disable searches inside aplications that use Spotlight, such as iTunes.”

    -Sorry. All the way wrong. iTunes search works fine w/Spotlight disabled. Use it all the time. More FUD, whatever

  7. This is useful for people who use Pro Tools which is not supposed to have background indexing on while recording. Also, quicksilver is a nicer app than spotlight.

  8. the search in Addressbook appears to rely on Spotlight as well.

    (and by the way, your instructions for turning it back on say there are two commands but specify only one, and that one doesn’t work here:

    prompt> sudo mdutil -i on /
    /:
    Could not set indexing status for volume.

  9. Hi Anonymous,

    You’re completely correct. I made a booboo when I copied/pasted the “two commands” portion. Also after modifying /etc/hostconfig to turn spotlight on, you have to reboot (which I had in the wrong order). Hope this didn’t mess anything up for you (it shouldn’t have).

    Thanks for the headsup….. :-)

    TTYL
    Many

  10. I also had to disable spotlight because it was causing several G4 titanium laptops to grind to a halt – literally. The cpu’s would get so hot that the fans would eventually burn up (bearing failure)! After 12 trips to the repair facility I ditched spotlight.

    Getting back 30-70% of my CPU is simply amazing(makes me happy).

    But I can’t search in address or mail.
    I am going to try coctail because I still need those apps for searches.

    Thanks for an amazing blog.
    You shots of SF WWDC made me long to be home.

    Eric in Austin

  11. Hi Eric,

    Glad you found what you’re looking for. Spotlight (as nice as it is when it’s working) is a bit of a unruly pig. I tend to turn it off on pretty much all my machines except the notebook that I use for Email/Office work/Travel……..On that machine what I tend to do is turn off Spotlight once in a while, blow away the DB and turn it back on again to let it redo the Database. That seems to work most of the time. Although the machines that do the heavy lifting (Aperture and FinalCut) have spotlight turned off for good :-).

    BTW…WWDC was a Blast……Loved SF, but had to miss the 08 one……too many projects at work……maybe next year. Enjoy the rest of the posts (and pics)…..

    TTYL
    Many

  12. This does not work. There is no such entry in the hostconfig file. You’ll have to use the chmod 0000 method on all the constituent executables.

  13. Hi Anonymous,

    It works. If it’s not there just add the line (instead of modifying it). It WILL stop the indexing. The chmod line actually does not work anymore under 10.5 (atleast for me) since that search bundle file is not there anymore. But the first part of the Tip works and disables spotlight Indexing (all the metadata reader processes disappear).
    TTYL
    Many

  14. Hi Anonymous,

    Yep, You’re correct. It does not stop the MDS server as outlined in this article. Please see the update at the top of the article for the new link specifically for Leopard.

    TTYL
    Many

  15. I love Spotlight and the option to search quickly. However I wish there was a way to have it index while I am away from work or while my computer is idle. Would be nice to have parameters for it. Or have it index during night hours.

    Everyday it starts to index when I am doing graphic design work. Its frustrating because it slows down my computer.

  16. this is absolutely awesome. i've always wanted to do this (especially when i started using QuickSilver, and started hating on Spotlight). And removing the index files? wow.. that's even better. I'm curious, how did you find out about mdutil? did you find it on Apple's site?

  17. Hi Jon,

    I'm not sure where I found out about mdutil…..it's been a while…but if I had to take a guess it would be google more than likely….

    TTYL
    Many

Leave a Reply