When macOS fans spin up or Activity Monitor shows mds, mds_stores, or mdworker_shared consuming 100% to 300% CPU for hours, Spotlight is usually stuck scanning fast-changing developer directories, virtual machine disks, or a damaged metadata index. Checking Spotlight status with mdutil -s /, excluding noisy build folders in System Settings, and running a clean rebuild with sudo mdutil -E / solves most runaway indexing loops without disabling Spotlight altogether.
All commands in this guide were verified on Apple Silicon running macOS 27.2.1 (arm64). Wait 30 to 60 minutes right after a major macOS upgrade before rebuilding anything, because a brief indexing spike after an OS update is expected.
Step 1: Confirm Spotlight is actually the process burning CPU
Before touching Spotlight settings, confirm which metadata workers are active and inspect indexing status on your main volume:
mdutil -s /
ps -arcwwwxo "pid,%cpu,%mem,comm" | grep -E "mds|mdworker" | head -n 10
A normal Mac prints Indexing enabled. for / and shows mds_stores near 0% CPU once idle. If mdworker_shared stays pinned near 80% to 200% CPU for more than an hour while you are not copying large folders, one of three triggers is normally behind it: a build folder writing thousands of tiny files per minute, an external drive mounted with damaged metadata, or a stuck Spotlight database on the internal SSD.
Step 2: Exclude fast-changing folders before rebuilding
Rebuilding the index first without fixing the trigger makes Spotlight loop again the next day. Open System Settings > Spotlight > Search Privacy (or Spotlight Privacy) and drag noisy, non-searchable directories into the exclusion list:
- Local code workspace directories containing
node_modules,target,.venv, or build artifacts if you search code inside your IDE or withripgrep. - Virtual machine disk folders (Docker, OrbStack, UTM, Parallels) and raw video scratch volumes.
- External Time Machine or rsync mirror drives whose contents duplicate files already indexed on your internal disk (see our 3-2-1 Mac backup strategy).
You can also place an empty file named .metadata_never_index inside an external scratch drive root, or add .noindex to a custom cache folder name, so Spotlight skips it automatically.
Common Spotlight triggers and targeted fixes
| Observed behavior | Likely cause | Targeted fix |
|---|---|---|
High mds_stores CPU for 30 to 60 minutes after a macOS update | Routine post-upgrade metadata refresh | Leave plugged in and wait; do not erase the index yet. |
CPU spikes every time you run builds or npm install | Spotlight indexing thousands of generated files in real time | Add project build folders to Spotlight Search Privacy. |
| Search misses obvious apps or files, or never finishes indexing | Corrupt local Spotlight database | Run sudo mdutil -E / to erase and rebuild cleanly. |
| Fans ramp up whenever one specific external SSD connects | Broken index or exFAT metadata loop on the external drive | Disable indexing on that volume with sudo mdutil -i off /Volumes/DriveName. |
Step 3: Rebuild a corrupt Spotlight index cleanly with mdutil
When Spotlight returns missing apps, blank results, or stays stuck indexing for hours after excluding noisy folders, tell macOS to erase the existing index and build a fresh one on the boot volume:
# Erase and rebuild the index on the main volume
sudo mdutil -E /
# Confirm indexing is enabled
sudo mdutil -i on /
mdutil -s /
For a troublesome external drive that you only use for cold archives or video footage, turn off Spotlight indexing on that single volume instead of rebuilding it repeatedly:
sudo mdutil -i off /Volumes/YourExternalDrive
sudo mdutil -X /Volumes/YourExternalDrive
Keep your Mac plugged into power while the main volume rebuild runs. On an Apple Silicon SSD with 300 to 500 GB of files, a full re-index normally finishes in 15 to 45 minutes. Avoid disabling Spotlight globally on / permanently, because Apple Mail search, System Settings search, and several Finder Smart Folders rely on the Spotlight index to work.
Step 4: Check disk space and memory pressure if slowdowns persist
Low free SSD space can make metadata writes crawl and stall indexing repeatedly. Check true free blocks with df -h /System/Volumes/Data and clear oversized caches or local snapshots via our macOS System Data storage guide. If the Mac still feels sluggish after mds_stores drops back to near 0% CPU, inspect Activity Monitor with our memory pressure guide and review Apple Silicon battery health tips to confirm no other sleep blocker is running.
Verify the fix once re-indexing finishes
After the progress bar inside the Spotlight search popover disappears, run two quick checks in Terminal to confirm the index is healthy and CPU draw has settled:
# Confirm Spotlight responds instantly to a metadata query
mdfind "kMDItemKind == 'Application'" | head -n 10
# Confirm mds processes are back to idle
ps -arcwwwxo "pid,%cpu,comm" | grep -E "mds|mdworker" | head -n 10
If mdfind returns installed applications immediately and mds_stores sits under 1% CPU, the rebuild succeeded cleanly.
Sources and verification
- Apple Support: Rebuild the Spotlight index on your Mac and
man mdutil/man mdfind. - Commands checked on Apple Silicon macOS 27.2.1 (
arm64), December 2, 2026.
Stay in the loop
Get tested Mac, terminal, and workflow guides when new tutorials publish. Unsubscribe anytime.
Comments
Questions, corrections, and useful counterpoints are welcome. Keep comments specific and on topic.

Leave a Reply