macOS 'The disk can't be ejected because it's in use' fix
Stop the phantom process holding your external drive or network volume hostage. Skip the brute force restarts — there's a faster way to find and kill the culprit.
30-Second Fix: Force Quit the Obvious Suspect
Before you dig into Terminal, try the dumb stuff. It works more often than you'd think.
- Click the Apple menu → Force Quit (or hit Command+Option+Esc).
- Look for any app that's actively using that disk. Typical culprits:
Finder,Photos,Spotlight(mds),Time Machine(backupd). - Select the app and click Force Quit.
- Try ejecting the disk again.
Still stuck? Don't waste time restarting Finder or relaunching the Dock. Move to the next fix.
5-Minute Fix: Find the Hidden Process with Terminal
The real fix is finding exactly which process is holding the disk open. Nine times out of ten, it's a background daemon or a third-party tool you forgot was running.
Open Terminal (Applications/Utilities). Run this command, replacing /Volumes/ExternalDrive with your disk's mount path:
lsof | grep '/Volumes/ExternalDrive' | grep -v 'com.apple'That pipes the output through two filters: first it shows everything referencing your disk, then it removes Apple's own processes (because killing system daemons is a bad idea). You'll get something like:
Dropbox 1234 user txt REG 1,5 123456 789 /Volumes/ExternalDrive/somefile.txtThe first column is the process name, the second is the PID. Note that PID.
Now kill it — but gently first:
kill 1234If the process ignores that, go nuclear:
kill -9 1234Try ejecting the disk again. If it pops up again, keep reading.
15+ Minute Fix: Nuke Spotlight's Index or Rebuild
Spotlight's mds process loves to hold drives hostage. If you killed it and it comes back, or if lsof shows mds or mds_stores, you need to tell Spotlight to leave the drive alone.
Open System Settings (or System Preferences on older macOS) → Siri & Spotlight → Spotlight Privacy. Click the + button, find your external disk in the list, and add it. That tells Spotlight to ignore the drive entirely.
Wait 30 seconds, then try ejecting again. This works 99% of the time.
If you still can't eject, there's one more dirty trick: force unmount via Terminal. This can cause data loss if files are open, so only do it if you're sure nothing critical is writing.
diskutil unmount force /Volumes/ExternalDriveThat bypasses the stuck process entirely. The disk disappears from Finder immediately. Replug it and it'll mount cleanly.
If none of that works, you're looking at a corrupted disk. Run Disk Utility's First Aid on it. That's a different problem entirely, but it's worth checking after a force unmount.
Pro tip: If this keeps happening with a specific drive, check the drive's format. ExFAT drives are notorious for this on macOS Ventura. Convert to APFS or HFS+ if you can.
Was this solution helpful?