← Back to Blog

macOS 'Disk In Use' Error: Complete Troubleshooting Guide

A comprehensive guide to fixing the 'disk in use' error on Mac. Covers all causes and solutions in one place.

· 12 min read

You click eject on your external drive and macOS says no. “The disk couldn’t be ejected because one or more programs may be using it.” You’ve closed everything you were working on. Nothing obvious is running. What’s actually using your disk?

This guide covers every common cause of the “disk in use” error and how to fix each one. We’ll start with the quick fixes and work our way to the more involved solutions.

Quick fixes to try first

Before troubleshooting, try these:

Close all Finder windows showing the drive. This is the most common culprit. If any Finder window is open to a folder on the drive, or even has the drive selected in the sidebar, Finder holds a lock on it. Close those windows or navigate them somewhere else.

Wait a few seconds and try again. Sometimes a process is just finishing up. Spotlight might be wrapping up indexing, or an application might be saving a cache file. Give it 30 seconds and try ejecting again.

Try ejecting from the sidebar instead of the desktop. Click the eject icon next to the drive name in Finder’s sidebar. Some users report this works when right-clicking the desktop icon doesn’t.

If those don’t work, it’s time to figure out what’s actually holding the drive open.

Finding the blocking process

macOS won’t tell you which program is using the drive, but Terminal will. Open Terminal and run:

sudo lsof /Volumes/YourDriveName

Replace “YourDriveName” with your drive’s actual name. If it has spaces, wrap the path in quotes: sudo lsof "/Volumes/My Drive"

You’ll need to enter your password. The output shows every process with files open on that drive. Look at the COMMAND column to see the process names.

Common processes you’ll see:

  • mds, mds_stores, mdworker: Spotlight indexing
  • Finder: A Finder window or file operation
  • QuickLookUIService: Thumbnail or preview generation
  • backupd: Time Machine backup in progress
  • fsevents: Filesystem change monitoring
  • bash or zsh: A Terminal shell with its current directory on the drive

Spotlight indexing

Spotlight is the most frequent cause of ejection problems. When you connect an external drive, macOS starts indexing it immediately so you can search its contents. The processes involved (mds, mds_stores, mdworker) keep files open while they work.

Wait for indexing to complete. On a new or changed drive, indexing can take anywhere from a few minutes to several hours depending on how many files are on it. You’ll see a progress bar in Spotlight’s search results if indexing is active.

Disable indexing for this volume. If you don’t need to search the drive with Spotlight, you can exclude it:

sudo mdutil -i off /Volumes/YourDriveName

This tells Spotlight to ignore the drive. After running the command, try ejecting again.

Add to Spotlight Privacy list. For a permanent solution, open System Settings, go to Siri and Spotlight, scroll to Spotlight Privacy, and add your drive. It won’t be indexed again until you remove it from this list.

Kill the Spotlight processes. As a last resort, you can force quit the mds processes in Activity Monitor. Search for “mds,” select each one accessing your drive, and click the X button to force quit. Spotlight will restart automatically, but your drive should be free.

Finder and file browsing

Finder can hold onto drives in ways that aren’t obvious.

Close all Finder windows. Even if no window is visibly showing your drive, Finder might have it open in a background tab or as the default location for a window.

Restart Finder. Hold Option and right-click the Finder icon in your Dock, then select “Relaunch.” This closes all Finder windows and releases any locks Finder was holding.

Check for copy operations. If you recently copied files to or from the drive, Finder might still be cleaning up in the background. Open Finder and check if there’s an active progress bar anywhere.

QuickLook and previews

macOS generates thumbnails and previews for files as you browse them. The QuickLook system (QuickLookUIService, quicklookd) can keep file handles open even after you’ve moved away from the folder.

Reset QuickLook. Run this command to clear QuickLook’s cache and restart it:

qlmanage -r cache

Kill QuickLook processes. In Activity Monitor, search for “QuickLook” and force quit any processes accessing your drive.

Terminal and shell sessions

If you’ve used Terminal to navigate to your external drive, that shell session keeps the drive in use. The process name will show as bash, zsh, or whatever shell you’re running.

Check your current directory. In each Terminal window, run pwd to see where you are. If it shows a path on your external drive, run cd ~ to go back to your home folder.

Close Terminal windows. If you have multiple Terminal windows or tabs, close them or navigate each one away from the drive.

Applications with recent files

Many applications keep references to recently opened files. Even after you close a document, the application might maintain a connection to it.

Quit applications that accessed files on the drive. Think about what documents you opened from the drive and quit those applications entirely (Command+Q), not just close their windows.

Check Recent Items. Some apps list recently opened files in a menu. Opening that menu can re-establish a connection to the files. If an app seems to be the culprit but quitting it doesn’t help, try removing it from the Dock, then quitting it, then opening it fresh.

Time Machine

If your drive is a Time Machine backup drive, the backupd process manages backups and can hold the drive during and after backup operations.

Wait for backup to complete. Check the Time Machine menu bar icon to see if a backup is in progress. Wait for it to finish before trying to eject.

Skip the current backup. Click the Time Machine icon and select “Skip This Backup” to cancel an in-progress backup. Wait a minute for cleanup, then try ejecting.

Disable Time Machine temporarily. Go to System Settings, click Time Machine, and toggle it off. After a moment, the drive should release.

System processes and daemons

Some system-level processes watch for changes on mounted volumes. These include fsevents, fseventsd, and various kernel tasks.

These typically don’t prevent ejection on their own, but they can compound with other issues. If you’ve addressed everything else and still see system processes in the lsof output, try:

Log out and back in. This restarts most user-level processes and can clear stubborn locks.

Restart your Mac. If nothing else works, a restart will definitely release the drive. Shut down completely, then disconnect the drive and boot back up.

When to force eject

Force ejecting tells macOS to unmount the drive regardless of what’s accessing it. You can do this by holding Option and right-clicking the drive, then selecting “Force Eject.”

This is generally safe if the blocking process was only reading from the drive. It’s riskier if something was actively writing. If you’re not sure, try to identify and quit the blocking process first.

Never force eject (or physically disconnect) a drive during a visible copy or save operation. That’s how you get corrupted files.

Preventing future issues

Exclude drives from Spotlight. If you don’t search your external drives, add them to the Spotlight Privacy list. Ejection will be nearly instant.

Close apps before ejecting. Make it a habit to quit applications that accessed files on the drive before trying to eject.

Use the sidebar eject button. Get in the habit of using Finder’s sidebar rather than the desktop icon. Some users find it more reliable.

Keep your Terminal tidy. If you use Terminal, be aware of what directory you’re in. Don’t leave shells sitting in external drive directories.

A better workflow

Diagnosing ejection problems requires understanding Unix processes, remembering Terminal commands, and sometimes guessing at what might be wrong. For something that should be as simple as unplugging a drive, it’s a lot of friction.

Ejecta removes that friction. It sits in your menu bar, shows you which drives are ready to eject and which are blocked, identifies exactly what’s blocking them, and lets you resolve the issue with one click. No Terminal, no Activity Monitor, no guesswork.

The underlying problem (macOS’s vague error messages and lack of diagnostic tools) isn’t going away. But you don’t have to keep solving the same mystery every time you need to unplug a drive.

Tired of drive ejection issues?

Ejecta shows you exactly what's blocking your drive and lets you fix it with one click.

Get Ejecta for $14.99