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.

(Updated )

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. Let’s 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.

Avoid killing Spotlight services. A process name does not establish whether writes are pending. Wait and retry normal ejection; if it remains blocked, save your work and shut down fully before disconnecting.

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.

Relaunch Finder after file operations finish. Hold Option and right-click the Finder icon in your Dock, then select “Relaunch.” This closes Finder windows and may clear a Finder hold. Do not relaunch it during a copy or move.

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

Close previews first. Close QuickLook windows and Finder preview panes, then retry normal ejection. Do not assume every QuickLook holder is idle or safe to interrupt.

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.

Shut down your Mac. Save your work, shut down completely, then disconnect the drive before starting the Mac again.

When to force eject

Force unmounting attempts to release a volume despite open holders. It can fail, and it bypasses protections that normal ejection provides. See the linked guide before considering this last resort.

An open-file list cannot certify that the volume has no pending writes. Save work, finish copies and backups, and quit recognized apps normally before retrying normal ejection. If you cannot establish what is happening, wait or shut down instead of forcing it.

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. This may reduce indexing-related holds, but other processes can still prevent ejection.

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 detected holders, and offers paid actions to quit supported apps and retry ejection. Save work first; system holders and failed ejections can still require waiting or shutdown.

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.

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 - $29 $9.99