How to Safely Eject an External Hard Drive on Mac

Learn the correct ways to safely eject external hard drives on macOS. Avoid data corruption and fix 'disk in use' errors with our comprehensive guide.

Unplugging an external hard drive from your Mac without ejecting it first is a gamble. While modern macOS versions are more resilient than they used to be, pulling a connection mid-write can lead to corrupted files, a broken directory structure, or a drive that refuses to mount the next time you plug it in.

To ensure your data stays intact, you must follow a specific protocol that tells macOS to finish all pending write operations and safely unmount the file system.

The Standard Ways to Eject a Drive

macOS provides several built-in methods to trigger a safe ejection. Depending on how you prefer to navigate your system, you can use any of the following:

1. Using the Finder Sidebar

The Finder sidebar is often the quickest way to manage multiple drives. Open a Finder window and look at the “Locations” section in the sidebar. Next to your external drive’s name, you will see a small eject icon (a triangle with a line underneath). Clicking this icon initiates the unmounting process.

2. Using the Desktop Icons

If you have your Finder settings configured to show external disks on your desktop, you can simply click and drag the drive icon into the Trash in your Dock. You will notice the Trash icon transforms into an Eject icon during the drag. This is a visual confirmation that macOS is preparing to disconnect the device.

3. Using the Right-Click Menu

For users who prefer context menus, you can right-click (or Control-click) the drive icon on your desktop or in a Finder window. Select Eject “[Drive Name]” from the dropdown menu.

4. Using the File Menu

If you already have a Finder window active and selected, you can go to the top menu bar and select File > Eject “[Drive Name]”.

Tip: If you are working with a keyboard-centric workflow, you can select the drive icon in Finder and press Command + E to trigger the ejection immediately.

Why macOS Says “Disk in Use”

The most common frustration for Mac users is the “Disk Not Ejected Properly” warning or the “The disk wasn’t ejected because one or more programs may be using it” error dialog.

This happens because macOS uses a system of “caching.” To improve performance, macOS doesn’t always write data to your physical hard drive the exact millisecond you save a file; instead, it holds that data in a temporary buffer (RAM). When you attempt to eject, macOS checks to see if any processes are still holding a “lock” on the drive or if there is data in the buffer that hasn’t been physically written yet.

If a process is still accessing the drive, macOS will block the ejection to prevent that process from attempting to write to a drive that is no longer there, which is the primary cause of data corruption. If you find yourself stuck in this loop, you may need to consult a guide on macOS ‘Disk In Use’ Error: Troubleshooting Guide to understand the underlying system behavior.

Common Culprits Blocking Your Drive

When macOS tells you a disk is in use, it rarely tells you which app is the offender. Usually, it is one of the following background processes:

Spotlight Indexing

Spotlight is constantly scanning connected drives to index files for search. If you just plugged in a large drive or moved thousands of files onto it, Spotlight is likely working hard in the background. This can keep the drive “busy” for several minutes.

Cloud Sync Services

Services like iCloud, Dropbox, and Google Drive are notorious for keeping drives locked. If you have a folder on your external drive that is being synced to the cloud, these applications will maintain a constant connection to the drive to monitor for changes. You can learn more about managing these specific interruptions in our guide on How to Stop iCloud and Dropbox From Blocking Drive Ejection.

QuickLook Previews

If you have a Finder window open and you are scrolling through files, macOS uses a feature called QuickLook to generate previews. If you have a large video file or a complex PDF selected, the QuickLook process may hold onto the drive to finish rendering that preview. If this is your primary issue, see QuickLook Is Holding Your Drive Hostage.

Professional Video Editing Software

For creative professionals, Final Cut Pro or Adobe Premiere Pro are frequent culprits. These apps often keep “background render” tasks or media connections active even after you think you’ve finished your session. If you work in video, check out Using External Drives With Final Cut Pro Without Ejection Problems for specialized workflows.

Advanced Troubleshooting: Using Terminal

If the standard GUI methods fail and you cannot identify the culprit through Activity Monitor, you can use the Terminal to gain deeper insight.

Finding the Blocking Process with lsof

The lsof (list open files) command is a powerful tool that can tell you exactly which process has a file open on your external volume.

  1. Open Terminal (found in Applications > Utilities).
  2. Type the following command, replacing [DriveName] with the actual name of your drive: lsof | grep /Volumes/[DriveName]
  3. This will return a list of processes. The first column will show the name of the application or process holding the drive.

For a deeper dive into how to use this command effectively, read The lsof Command Explained for Mac Users.

Forcing Ejection via diskutil

If you are confident that no critical data is being written, you can attempt to unmount the drive via the command line:

  1. In Terminal, type: diskutil list to find the identifier for your drive (e.g., disk4s1).
  2. Type: diskutil eject /dev/disk4 (replace disk4 with your specific identifier).

The Role of File Systems in Ejection

The format of your drive can also influence how macOS handles ejection and how prone it is to errors.

Format Best Use Case Ejection Behavior on Mac
APFS macOS-only storage (SSDs) Highly optimized; very fast and safe unmounting.
Mac OS Extended (HFS+) Older Mac-only storage (HDDs) Standard for older macOS versions; very stable.
exFAT Cross-platform (Mac & Windows) Faster for large files, but more prone to corruption if not ejected properly.
FAT32 Small USB sticks / Legacy devices High compatibility, but limited file size and higher risk of errors.

If you are deciding between formats for a new drive, refer to our comparison of APFS vs exFAT: Which Format for Your External Drive on Mac.

What to Do When All Else Fails

Sometimes, you are in a rush, or the system is completely unresponsive. You might be tempted to “Force Eject” or simply pull the cable.

Warning: Force ejecting a drive while it is actively writing data is the most common cause of “unreadable disk” errors. While it may work 90% of the time, the 10% failure rate can result in total data loss on that volume.

If you absolutely must force an ejection, try these steps in order:

  1. Quit the offending app: Use Activity Monitor to force quit the process identified by lsof.
  2. Restart your Mac: This clears all active processes and file locks, making it the safest “nuclear option.”
  3. Force Eject via Disk Utility: Open Disk Utility, select the drive, and click the Eject button there.

To understand the technical risks involved in this last resort, read Is Force Eject Safe on Mac?.

Summary Checklist for Safe Ejection

To avoid headaches in the future, follow this quick mental checklist before you unplug:

  • Close all files: Ensure no documents, videos, or projects from the drive are open in any application.
  • Check Cloud Status: Ensure Dropbox, iCloud, or OneDrive have finished syncing.
  • Wait for the “Blink”: If your drive has a physical activity LED, wait for it to stop flashing before attempting to eject.
  • Use the Eject Command: Always use a formal macOS ejection method rather than just pulling the cable.

If you find that you are constantly fighting with macOS to get your drives to disconnect, you don’t have to do it manually.

Stop guessing which process is blocking your drive.

Try Ejecta to see exactly what is holding your external drive hostage and quit it with a single click.