mds_stores High CPU When an External SSD Is Plugged In
Fix mds_stores hitting 90% CPU when an external SSD mounts, including Spotlight Privacy's "unknown error". Terminal and settings fixes, plus a checklist.
TroubleshootingUpdated 6 min read
On this page
A typical report: you plug in a Samsung T5 (or any external SSD), mds_stores climbs past 90% CPU, the fan spins up, and adding the drive to Spotlight Privacy fails with "The item could not be added or removed because of an unknown error." The original report was a 2018 MacBook Air on macOS Monterey 12.3, and creating a .metadata_never_index file on the drive fixed it. We haven't re-tested that on every later macOS, so the mdutil fix below is the fallback.
Why it happens
mds_stores is part of Spotlight's indexing. Spotlight builds a local index of what's stored on your disks, and Apple says indexing can take hours or even days, depending on the amount of data. A newly mounted drive counts as new data.
Causes, most common first:
- First-time indexing of a drive Spotlight hasn't seen. Normal, and it ends on its own. A big, full SSD takes longest.
- Re-indexing every time you mount it. This is the real problem. It can happen if the index on the drive is damaged or can't be saved, for example on a drive formatted for another OS. We don't know the exact trigger in the original report.
- A permissions problem on the drive. Apple notes that an "unknown" error or permissions error may mean your account lacks ownership of some items on the disk or folder. That fits the Privacy list failing.
- Lots of small files. Photo libraries,
node_modulesand similar trees give the indexer a lot to chew on. This is general behavior, not something we measured.
Don't force-quit mds_stores. It's a system service and it restarts. Stop the work at its source instead.
Check that it's really mds_stores
Open Activity Monitor, click the CPU tab and sort by % CPU. If mds_stores or mdworker processes are at the top right after you plug in the drive, you're in the right place. For a walkthrough, see how to use Activity Monitor. If something else is busy, start with why your Mac is slow.
Press Command-Space to open Spotlight. If Spotlight is indexing, a progress indicator appears at the top of its window.
Step-by-step fixes
Fix 1: Add a .metadata_never_index file to the drive
Spotlight skips a volume that has an empty file named .metadata_never_index at its top level. The drive must be mounted read-write.
- Plug in the drive and wait for it to mount.
- Open Terminal (search for it, or open Applications > Utilities).
- Run this, replacing
Samsung_T5with your drive's name as Finder shows it:
touch "/Volumes/Samsung_T5/.metadata_never_index"This creates an empty hidden file. Keep the quotes if the name has spaces.
- Confirm it exists:
ls -a "/Volumes/Samsung_T5"- Eject the drive, plug it back in, and watch
mds_stores.
To undo it, run rm "/Volumes/Samsung_T5/.metadata_never_index". The trade-off: Spotlight won't find files on this drive.
Fix 2: Exclude the drive in Spotlight's privacy list
On macOS 13 and later, open System Settings > Spotlight, scroll if needed, and click Search Privacy. Apple's steps: click the Add button, then select a folder or disk; you can also drag folders or disks into the field. On Monterey and earlier it's System Preferences > Spotlight > Privacy. In macOS 14 the button is labeled Spotlight Privacy and sits under Siri & Spotlight, per Apple's page on preventing Spotlight searches.
If you get the "unknown error," don't keep retrying. Ownership is the likely cause. Try this:
- Select the drive in Finder and press ⌘I (Get Info).
- At the bottom, check Ignore ownership on this volume or the Sharing & Permissions section. If you can't change it, use Fix 1 or Fix 3.
- Retry adding the drive.
To undo, select the drive in the list and click the − button.
Fix 3: Turn indexing off for the volume with mdutil
mdutil is the built-in command-line tool for Spotlight indexing. This switches indexing off for one volume and asks for your administrator password:
sudo mdutil -i off "/Volumes/Samsung_T5"Check the state with mdutil -s "/Volumes/Samsung_T5". To undo it, run sudo mdutil -i on "/Volumes/Samsung_T5".
Fix 4: Let it finish, then reindex cleanly (if you want search)
If you want the drive searchable, leave the Mac on power and let indexing run. If search on the drive is broken afterward, Apple's rebuild method is to add the disk to the Privacy list, wait a few seconds, then remove it again. See Apple's page on Spotlight indexing.
When each fix applies
| What you see | Likely cause | Fix |
|---|---|---|
| CPU high once, then calm | First-time indexing | Wait, or Fix 1 |
| High every time you plug in | Index not sticking | Fix 1, then Fix 3 |
| "Unknown error" in Privacy | Ownership or permissions | Fix 1 or Fix 3 |
touch says "Read-only file system" | Drive mounted read-only (often NTFS) | Fix 2 or Fix 3 |
touch says "No such file or directory" | Wrong drive name | Run ls /Volumes and copy the name |
touch says "Operation not permitted" | Terminal lacks access to removable volumes | Allow the prompt, or search System Settings for "Full Disk Access" |
| CPU stays high after the file exists | Indexing began first, or another volume is busy | Eject and replug, then Fix 3 |
| Returns after reformatting | Reformat erased the marker file | Create it again |
Checklist before you try again
- The drive name in your command matches
ls /Volumesexactly. - The drive is mounted read-write (not NTFS read-only).
.metadata_never_indexshows up inls -aoutput.- You ejected and replugged the drive after creating the file.
mdutil -sfor the volume shows what you expect.- The busy process in Activity Monitor really is on this drive's work, not another volume's.
Using Procowl to see when it started
Procowl can't change Spotlight, so it won't fix this. It helps you confirm the cause and timing.
- Open Processes (⌘2) and type
mds_storesin the search field. - Read CPU %, Read and Write. CPU is per core, so values over 100% are normal.
- If those cells show "—," install Enhanced Access in Settings > General > Enhanced Access > Install… and approve it in Login Items. Details are in Permissions and Enhanced Access.
To look back, drag the timeline scrubber to the moment you plugged in the drive. History is on by default and keeps 7 days. It records the busiest apps once a minute but not drive mounts, and only while Procowl was running. See history and replay. Procowl is part of MacSuite and you can try it free for 7 days, but nothing on this page needs it.
If nothing works
Contact Apple Support, with your macOS version, Mac model, the drive's file system (Disk Utility shows it), the mdutil -s output and the exact error. If the fan keeps running after mds_stores calms down, see MacBook overheating.
Subject: mds_stores high CPU when external SSD is mounted
Mac model: <your model>
macOS version: <your version>
Drive: <name>, file system <APFS / ExFAT / NTFS / Mac OS Extended>
Every time I plug in the drive, mds_stores uses 90%+ CPU and the fan runs.
Adding the drive in Spotlight Privacy fails with:
"The item could not be added or removed because of an unknown error."
Tried: .metadata_never_index file, mdutil -i off, eject and replug.
Output of mdutil -s "/Volumes/<name>":
<paste here>Common questions
Is it safe to leave Spotlight indexing off for an external drive?
Yes. The only loss is that Spotlight won't find files on that drive. Finder search inside the drive still works.
Will the .metadata_never_index file follow the drive to another Mac?
Yes, because it lives on the drive. Other Macs should skip it too, unless you reformat the drive.
Does Fix 1 work on every file system?
Only if you can write to the drive. On a read-only mount, use the Privacy list or mdutil.
Should I quit mds_stores in Activity Monitor?
No. It restarts and the indexing resumes. Stop the indexing itself.