Rebuild the Spotlight Index

Jan 17, 2012 - 38 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. This tutorial will show you how to start the reindexing process of an entire drive in Mac OS X, we’ll do this using the Spotlight control panel, and we’ll cover an alternative method as well just in case you want to take a different approach.

How to Rebuild the Spotlight Index in Mac OS X

Here’s how to start the reindexing process of an entire drive using the Spotlight control panel:

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

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

This should immediately start the Spotlight indexing process for the drive in question.

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.

Manually Rebuilding Spotlight via Terminal

If the aforementioned Spotlight control panel approach 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.

Were you able to successfully rebuild your Spotlight index with this approach? Let us know your experience in the comments.

.

Related articles:

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

38 Comments

» Comments RSS Feed

  1. Pedro says:

    it works for me, only by terminal command…

    thanks a lot.

  2. BABUSHCA says:

    I have a macbook pro early 2013 and a couple of days ago for an unknown reason it almost died :
    -no browser responded,
    -any click extreme sluggish respond
    – everything damn slow
    I did many remedies including your instructions =
    This spotlight reindexing does not even start no matter what I do
    a- syspref-spotlit-privacy-added/dragged Mac os – (-) NO JOY nothing spining or processing
    b- Terminal = the command you outlined. terminal says : spotlight enabled BIT no sign or process sign, clicked on search bar on the left/ searched. still nothing

    AM I DOING SOMETHING WRONG??

    THANKS TO YOU AND ALL

    • oTMNiu says:

      Your hard drive might be failing, or something running in the Background. It likely has nothing to do with Spotlight if everything is slow and there is no spotlight process in Activity Monitor.

  3. Sergitus says:

    It works even with Mojave OS :)

  4. Rohan says:

    Thanks for that. Ran Terminal command which responded indexing disabled so had to run
    sudo mdutil -i on /
    and a year of frustration has come to an end!

  5. Tim says:

    Thank you!
    Would type in a letter or a few letters into a Spotlight Search and then it would crash.
    Also, searches were coming up short.
    Followed your process to force re-index. Now I can type in some letters to Spotlight without it crashing. Just waiting to re-index.

  6. I’ve reindexed my hard drive twice now in order to be able to once again find recently received emails in my Outlook. It’s good finding emails back as far as I have them in my inbox or sent box, but it is still having trouble finding emails that came in over the last week. After reindexing, it will find some, but not all when searching. This was not a problem until I came back from vacation with my computer sleeping for about 11 days. Since then, now for the last month, it has trouble finding recent emails–or doesn’t find them at all.

  7. Knight Yoshi says:

    Had to use the terminal, but I was able to re-index the file system. Thanks!

  8. Eduardo says:

    it works for me, only by terminal command.

    tks a lot

  9. anonymous says:

    Thanks. It worked.

  10. Alex says:

    Rebuilding index via terminal helped me.

  11. DELA JENKINS says:

    I’ve got a MacBook Pro running OS X Sierra. I followed the instructions (i.e. the 5 steps at beginning of your article), but when I clicked on the magnifying glass in the top right of the screen there was no drop down window to show me the progress of the reindexing. However, when I keyed in an item to search for, the Spotlight results window appeared together with the indexing progress bar. Success!

  12. Malcolm says:

    I added the hard disk to the privacy list but then got the error ‘Privacy List Error’ when trying to remove the HD from the list. I closed system preferences, went to Activity Monitor and killed the Spotlight process.
    Spotlight starts back up again, but now I was able to remove the HD from the privacy list in System Preferences.

  13. Mel says:

    It’s indexing! Thank you! (MacBook Pro. OSX 10.8.3)

    Had the motherboard replaced recently and I think that’s what caused the indexing problem.

    For people who say it didn’t do anything: After adding and removing the drive(s) from the list, click on the magnifying glass in the upper right corner of your top menu (the spotlight search). A menu should drop down telling you it’s indexing.

    Hope I’m not surprised later by the “unknown reasons” error some are getting. So far so good!

  14. Murtz says:

    Man, this is frustrating. I’m getting the same message about ‘unknown reasons,’ as many got (above). I cannot add my external drives, nor can I add my Mac HD. And I can’t even find that!

    I have 10.8.5 of OSX, a 2011 Macbook Pro. I’m wondering if the local Mac shop has played some fun on me–they’re known to be a bit mercenary, but I don’t think they’d do this, or if the fellow who recently helped me left some barrier up by mistake–such as permissions altered. I do know I’ve forgotten my admin password, yet the helper fellow said he didn’t need it in the end. My searchlight used to be so useful and fast, and now I must manually locate old files…

  15. christian says:

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

  16. Raj says:

    This didnt work…

  17. 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.

  18. 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.

  19. […] 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 […]

  20. 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.

          • Ken says:

            In addition to fixing permissions as Dave suggested, I also had to do the following:
            % cd /System/Library/LaunchDaemons
            % sudo launchctl load -w com.apple.metadata.mds.plist

            . . . which I found on this page: https://discussions.apple.com/thread/2760349?tstart=0

            NOW it’s working for me, too. :)

  21. 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.

  22. 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.

  23. 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.

  24. […] 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 […]

  25. Jason Bush says:

    sudo mdutil -E / works as well

    • Mike STS says:

      You sure that works for OS X Lion?

    • Pablo says:

      I can confirm that you can rebuild the Spotlight index on MacOS Mojave, macOS High Sierra, macOS Sierra, Mac OS X El Capitan, Yosemite, Mavericks with the following command:

      sudo mdutil -E /

      You need to enter the admin password for sudo.

      Reindexing Spotlight and rebuilding the Spotlight index will take quite a while on a big hard drive with a lot of files, so let it complete.

Leave a Reply

 

Shop on Amazon.com and help support OSXDaily!

Subscribe to OSXDaily

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

Tips & Tricks

News

iPhone / iPad

Mac

Troubleshooting

Shop on Amazon to help support this site