Rebuild the Spotlight Index

Jan 17, 2012 - 19 Comments

Rebuild the Spotlight Index

Do you need to rebuild the entire Spotlight index on a Mac? It’s easy to do, but can take a while. Here’s how to start the reindexing process of an entire drive using the Spotlight control panel:

  • Launch System Preferences from the  Apple menu
  • Click on “Spotlight” and then click on the “Privacy” tab
  • Drag Macintosh HD (and other drives if necessary) into this window
  • Rebuild Spotlight index in Mac OS X

  • Click “OK” when asked to confirm
  • Now select the drive(s) you just added and click the “-” minus button to remove it from the list
  • Reindex Spotlight

If this doesn’t spur a reindexation of the drive, you may need to initiate it manually through the command line. Open Terminal and use the following command string to do so:

sudo mdutil -i on /

Rebuilding a drive index can take a long time, so be prepared to wait whether you do it through the System Preference panel or the command line.

Note: if an item is left under the “Privacy” list, it will exclude from Spotlight indexing completely.

Spotlight will immediately begin to reindex the drive(s) you added and then removed from the Privacy list. How long it takes to reindex the drive varies, ranging from 30 minutes to several hours, depending on the speed of the drive and it’s contents. At any point, you can pull down the Spotlight menu and check the progress:

How long it takes to reindex Spotlight

The Mac will probably feel sluggish during reindexing as the mdworker and mds processes run and consume a lot of CPU and cause a lot of disk activity.

Rebuilding and reindexing Spotlight is an excellent troubleshooting technique when you encounter problems with the Mac search client. If you find Spotlight isn’t working at all, try some of these other troubleshooting tips too.

Enjoy this tip? Subscribe to the OSXDaily newsletter to get more of our great Apple tips, tricks, and important news delivered to your inbox! Enter your email address below:

Related articles:

Posted by: Paul Horowitz in Mac OS X, Tips & Tricks

19 Comments

» Comments RSS Feed

  1. Jason Bush says:

    sudo mdutil -E / works as well

  2. […] the Spotlight index for one reason or another, you may need to reindex the drive manually. This is easy from the Spotlight control panel, and can also be achieved through the command line as we’ll […]

  3. Brad says:

    I receive this message when trying to reindex.

    Privacy List Error:
    The item couldn’t be added or removed because of an unknown error.

  4. PMG says:

    Brad, I had the same error message… The item couldn’t be added or removed because of an unknown error. I have nothing in the spotlight privacy box.

  5. User90876756 says:

    I am getting the same error message “The item couldn’t be added or removed because of an unknown error”. I am using a Macbook Air 1.7GHz core i5, 4GB with Outlook 2011.

  6. Brendan says:

    I added and removed and literally nothing changed…

    • Brendan says:

      spotlight did not start to re-index at all

      • Chris says:

        Same here. 10.8, didn’t do a thing.

        • Dave says:

          I believe this used to work for me, but like others here, it now does nothing. Even with closing the entire System Preferences in between and then coming back in to removing Macintosh HD.

          • Dave says:

            …and sudo mdutil -E / isn’t doing anything either :(

          • Dave says:

            Okay, I got it working.

            I did two things, so I’m not sure which made the difference.

            1) Ran Disk Util to Fix Permissions, and I saw this:

            Permissions differ on “System/Library/CoreServices/Search.bundle”; should be drwxr-xr-x ; they are dr-xr-xr-x .

            2) Then I also ran:

            sudo mdutil -i on /

            Now it’s reindexing.

  7. […] slow down a Mac. This is typically worse after reboots between major file system changes when the index is rebuilt, a major system update, or when another hard drive full of stuff is connected to the Mac. Typically […]

  8. John Smith says:

    You have to add it to the list, close the window, come back to it and remove it. It will work at that time.

  9. Bonnie says:

    The method illustrated on the top of this page is also what I was told to do at genius bar, but am unable to drag hard drive into the privacy tab window. When I drag it to window, no icon appears, although the + sign appears when I drag it. Am I doing something wrong?

    • Paul says:

      Make sure you drag the icon and then DROP it into the Privacy tab window, so that the + sign goes away and is replaced by the drive icon.

  10. Raj says:

    This didnt work…

  11. christian says:

    thank you so much it work just perfect on os x 10.9.1

Leave a Reply

 

Shop for Apple & Mac Deals on Amazon.com

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates