Fixing the mds Error on Your Mac: Spotlight Troubleshooting
In this article
An mds or mds_stores error on a Mac almost always means the Spotlight indexing process hit a corrupt index, a stuck file it cannot read, or a disk problem. Rebuilding the Spotlight index with a single terminal command fixes the large majority of cases.
Time 20 min · Steps 6 · Level Medium
Most mds errors trace back to three causes, in order of likelihood: a corrupted or half-finished Spotlight index, a file or folder on the disk that the indexer cannot read, or a failing drive that is interrupting the process. The fixes below run from a two-minute restart to a full reindex, and each one tells you how to confirm it worked.
Work Through the Six Fixes in Order
- Restart the Mac first. A reboot clears a stuck mds or mds_stores process and restarts indexing cleanly. After logging back in, open Activity Monitor (Applications > Utilities), search for "mds" and watch CPU usage for a minute or two. A brief spike right after restart is normal; if it settles back under about 10 percent, the problem was a stuck process.
- Check what Spotlight is indexing. Click the magnifying glass in the menu bar and type a few letters. If results are stale or missing, the index itself is the problem. Also click the Spotlight icon and look for a progress bar under the search field, which means indexing is still running; on a large drive this can take an hour or more, so give it time before assuming failure.
- Rebuild the Spotlight index. Open Terminal (Applications > Utilities) and run:
sudo mdutil -E /. Enter your admin password when asked. This erases and rebuilds the index on the startup drive. Expect high mds_stores CPU and a warm machine for a while afterwards; that is the rebuild working, not a new fault. When Activity Monitor settles and Spotlight returns fresh results, it worked. - Reindex a specific volume or folder. If errors point at an external drive, run
sudo mdutil -E /Volumes/DriveName(replace DriveName with the drive's actual name; quotes are needed if the name has spaces). For a single stubborn folder, runmdutil -Eon its volume, or add the folder to Spotlight's exclusion list and remove it: System Settings > Siri & Spotlight > Spotlight Privacy (labels may differ slightly by version). Adding and then removing a location forces a fresh index of just that spot. - Verify the disk. Open Disk Utility, select the drive, and run First Aid. A drive with errors will keep tripping the indexer no matter how many times you rebuild. If First Aid reports the disk is failing, stop rebuilding and copy your files elsewhere first, then plan a drive replacement.
- Reset Spotlight settings if errors persist. Toggle off all categories under System Settings > Siri & Spotlight, restart, and turn them back on. This clears preference files that can keep mds in a crash loop. If mds still crashes repeatedly after a clean reindex and a healthy disk, the system files themselves may be damaged and reinstalling macOS over the top (which keeps your files) is the next step.
Confirm the Cause Before You Rebuild
A quick check saves you an hour of needless reindexing. Open Console (Applications > Utilities), click the search field, type "mds", and reproduce the error. The log lines usually name the exact file path or volume involved, which tells you whether to reindex the whole drive or just one folder. If the log repeats disk I/O errors instead, the drive itself is the suspect and First Aid comes before anything else.
High CPU alone is not an error. After a macOS update, after attaching a new external drive, or after moving large amounts of data, mds_stores can run near full CPU for an hour or more. Only treat it as a fault if it stays pinned for many hours with no indexing progress bar, or if it keeps crashing and relaunching, which shows up in Console.
Run the Rebuild Safely and Know When It Finished
Two safety points around the sudo mdutil commands. First, they need an admin account and the password typed blind; nothing appears on screen as you type, which is normal. Second, do not force-quit mds_stores in Activity Monitor to stop a rebuild; let it finish, because killing it mid-write is one way indexes get corrupted in the first place.
You know the rebuild is done when three things line up: Activity Monitor shows mds_stores back to low single-digit CPU, Spotlight searches return current results for recently changed files, and Console shows no new mds error entries after a few minutes of normal use. Test with a file you created minutes earlier; if Spotlight finds it, the index is live.
What the mdutil flags mean
-E erases and rebuilds the index. -i off turns indexing off for a volume, and -i on turns it back on; running off then on is a softer reset than -E and worth trying first on external drives. -s shows the current indexing status for a volume without changing anything, which is the safest way to see what Spotlight thinks is going on.
Handle the Rarer Cases: External Drives and Repeated Crashes
External drives cause a disproportionate share of mds errors because they can disconnect mid-index. If the error mentions a volume that is no longer attached, eject the drive properly in Finder before unplugging in future, and reindex it with mdutil -E once it is reattached. Excluding a backup or media drive from Spotlight under Siri & Spotlight privacy settings stops the problem recurring if you never search that drive anyway.
Repeated mds crashes after all of the above usually point to damaged system files rather than Spotlight itself. Reinstalling macOS in place, through Recovery mode, replaces the system files while leaving your data and apps alone; back up with Time Machine first regardless, since any reinstall carries a small risk. If a failing drive was confirmed by First Aid, replacement is the real fix, and no amount of reindexing will hold on a disk that keeps dropping writes.
Official source: Apple Support