Why Spotlight Blocks Disk Ejection on Mac (mds & mds_stores Fix)
Spotlight indexing (mds, mds_stores, mdworker) is one of the most common reasons a Mac external drive won't eject. Learn how to check holders and stop indexing safely.
Quick answer: When Spotlight indexes an external drive, background processes (
mds,mds_stores,mdworker, ormdworker_shared) keep open file handles on the volume, causing macOS to report that the disk is in use. Wait for indexing to finish and retry a normal Finder eject, exclude the drive in System Settings → Spotlight → Search Privacy, or runsudo mdutil -i off "/Volumes/YourDriveName"in Terminal. Do not routinely force quitmdsormds_storesor force eject the drive, as process names cannot prove that no writes are pending.
You try to eject your external drive and macOS refuses. You check Activity Monitor or lsof and see processes named mds or mds_stores accessing your drive. Congratulations, you’ve met Spotlight indexing.
This is one of the most common reasons external drives won’t eject on a Mac. Spotlight indexes connected volumes so you can search them later, and as long as its indexing processes keep files open, normal ejection can fail.
What Spotlight is actually doing
Spotlight’s indexing system runs through several macOS background daemons:
| Process Name | Role on Your External Drive | Can Block Normal Eject? | Safe to Force Quit? |
|---|---|---|---|
mds |
Metadata Server coordinating Spotlight indexing across volumes | Yes (holds .Spotlight-V100 handles) |
No — system service; wait or adjust Spotlight settings |
mds_stores |
Manages and writes indexed metadata store files on the volume | Yes (reads and writes index data) | No — interrupting index writes can corrupt the index or leave work incomplete |
mdworker / mdworker_shared |
Sandboxed worker processes scanning and extracting file metadata | Yes (holds individual files open while scanning) | No — wait for scanning to finish or disable indexing for the volume |
When you connect an external drive, Spotlight scans files, extracts metadata, and updates the hidden .Spotlight-V100 index directory at the root of the volume. As long as those file descriptors remain open, macOS considers the drive “in use” and refuses a normal unmount.
How to check if Spotlight is the culprit
Open Activity Monitor and look for mds, mds_stores, mdworker, or mdworker_shared. You can also inspect open files on your volume directly from Terminal (see our complete guide to finding what process is using a drive on Mac):
lsof "/Volumes/YourDriveName"
If access restrictions hide system processes, running sudo lsof "/Volumes/YourDriveName" in Terminal can surface root-owned mds or mds_stores handles:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
mds 123 root 12r DIR 1,15 960 2 /Volumes/YourDriveName/.Spotlight-V100
mds_stores 318 root 18u REG 1,15 327680 44 /Volumes/YourDriveName/.Spotlight-V100/Store-V2/...
Note that r, w, and u in lsof only show how a file descriptor was opened, not whether a write is actively occurring at that moment.
Compare the 3 ways to stop Spotlight from holding a drive
| Method | Best For | Persists Across Macs? | Command / Location |
|---|---|---|---|
| Wait & retry normal eject | Drives where you want to keep Spotlight search working | Yes | Wait for indexing to settle, then press Cmd + E in Finder |
| Spotlight Privacy list | Excluding a specific drive on your own Mac via System Settings | No (per-Mac setting) | System Settings → Siri & Spotlight (or Spotlight) → Spotlight Privacy |
mdutil -i off |
Turning off indexing for a mounted volume from Terminal | Yes (writes volume config) | sudo mdutil -i off "/Volumes/YourDriveName" |
.metadata_never_index file |
Portable SSDs or shuttle drives used across multiple Macs | Yes (travels with the drive) | touch "/Volumes/YourDriveName/.metadata_never_index" |
Fix 1: Disable indexing for the volume with mdutil
From Terminal, you can turn off Spotlight indexing for a specific mounted volume:
sudo mdutil -i off "/Volumes/YourDriveName"
Terminal will prompt for your Mac administrator password. This changes indexing for that volume and may help if Spotlight is the holder. Allow current activity to settle, then retry normal ejection in Finder or with diskutil eject. Other processes can still hold the drive.
When you reconnect the drive later and want indexing back:
sudo mdutil -i on "/Volumes/YourDriveName"
Fix 2: Exclude the drive in Spotlight Privacy
If you don’t need Spotlight search on a specific external drive, Apple’s Spotlight Privacy settings let you exclude specific disks or folders from indexing:
- Open System Settings and select Siri & Spotlight (or Spotlight).
- Click Spotlight Privacy (or Search Privacy) at the bottom.
- Drag your external drive into the list, or click the + button to add it.
Excluding the drive removes its contents from Spotlight search. (Note: if the drive is used for Time Machine, Apple notes that Spotlight indexing is required on Time Machine backup disks, so do not disable Spotlight on a Time Machine volume—use our Time Machine ejection guide instead.)
For non-Time Machine shuttle drives that move between multiple Macs, you can also create an empty .metadata_never_index file in the root of the volume:
touch "/Volumes/YourDriveName/.metadata_never_index"
Spotlight checks for this marker file and skips indexing volumes that contain it.
When Spotlight won’t let go
If Spotlight still holds the drive after you change indexing settings, wait and retry normal ejection. Do not routinely force quit mds, mds_stores, or mdworker. These are system services, and their names do not establish that no writes are pending. Read why force eject is risky on Mac before using force unmount.
Run lsof again to check for other holders (such as QuickLook previews or iCloud and Dropbox sync). Save your work and quit recognized apps normally. If the disk remains held and you cannot wait, shut down the Mac fully before disconnecting it.
Why this keeps happening
Every time you connect an external drive, Spotlight checks and updates its index unless you’ve excluded it. Major macOS upgrades can also trigger re-indexing or reset privacy exclusions, so it is worth checking your Spotlight Privacy list after updating macOS.
A simpler approach
Hunting through Activity Monitor and Terminal every time you want to unplug a drive gets old fast. Ejecta offers free diagnosis of detected holders in the menu bar. It recognizes Spotlight processes as system holders and does not offer ordinary quit or force quit for them. Paid actions can quit supported apps and retry ejection, but indexing may still require waiting or a settings change.
The current app is Ejecta 1.4.3, for macOS 13 or later, on Apple Silicon and Intel. Its current one-time price is $9.99, with no computer or activation limit and refund requests within 30 days. Try the free diagnosis first.
Ejecta offers free drive diagnosis without a timed trial. The paid license unlocks quit and eject actions for supported apps, Eject All and Time Machine controls. System holders may require waiting, authorization or shutdown. Save work and finish transfers first.
Buy Now -Related articles
'Disk Not Ejected Properly' on Mac: Causes and How to Stop It
The Disk Not Ejected Properly warning usually means your Mac slept, not that you unplugged the drive wrong. …
How to Safely Eject External Drives on macOS Sequoia and Sonoma
Apple changed how drive ejection works in recent macOS versions. Here's what's different in Sequoia and Sonoma …
How to Eject an External Drive When Finder Won't Respond
Finder frozen or unresponsive? Your external drive doesn't have to stay plugged in. Here are several ways to …
macOS 'Disk In Use' Error: Troubleshooting Guide
A comprehensive guide to fixing the 'disk in use' error on Mac. Covers all causes and solutions in one place.