TechBuzzPro

How to Fix USB Mass Storage Eject Problems

· 5 min read · Windows & PC

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Yes, you can resolve a USB mass storage ejection problem by safely stopping any active processes, using the operating system’s eject command, and, if necessary, fixing lingering file handles or driver issues.

What You'll Need

  • A computer running Windows 10/11 or macOS 10.15 or later
  • The USB mass storage device that won't eject
  • Administrator privileges (or an account with sudo rights on macOS)
  • Basic knowledge of Task Manager (Windows) or Activity Monitor (macOS)

Step-by-Step

  1. Close all visible programs that might be using the drive. This includes file explorers, media players, backup software, and any command‑line windows that have the USB drive as the current directory.
  2. Check for hidden background processes. On Windows, press Ctrl+Shift+Esc to open Task Manager, click the Details tab, and look for processes that reference the drive letter (for example, D:). Right‑click and choose End task for any that you are sure are safe to stop.
  3. On macOS, open Activity Monitor from Applications › Utilities, type the drive’s name in the search field, and quit any processes that show a blue “%CPU” usage.
  4. Use the built‑in safe‑removal feature. In Windows, locate the Safely Remove Hardware and Eject Media icon in the system tray, click it, then select the USB device and choose Eject. On macOS, drag the drive’s icon to the Trash (which turns into an eject symbol) or press Cmd+E while the drive is selected in Finder.
  5. If the OS reports that the device is still in use, open a command prompt (Windows) or Terminal (macOS) with administrative rights.
  6. On Windows, type handle -a D: (replace D: with your drive letter) if you have the Sysinternals handle.exe utility installed, or use openfiles /query /fo table to list open handles. Identify the PID of the offending process and terminate it with taskkill /PID 1234 /F.
  7. On macOS, run lsof | grep /Volumes/YourDriveName to list open files. Note the PID column, then kill the process with sudo kill -9 5678.
  8. After terminating the offending processes, repeat the safe‑eject command (step 4). The drive should now release.
  9. If the device still refuses, restart the computer. A reboot clears all file handles and often resolves driver lock‑ups.
  10. When the computer boots back up, try the safe‑eject command again before opening any programs. If it succeeds, the issue was likely a transient lock.

Common Mistakes

Many users try to yank the USB stick out of the port before Windows or macOS has finished writing data. This can corrupt the file system and cause the same problem to reappear. Another frequent error is closing only the visible window while a background sync service (such as OneDrive, iCloud, or a third‑party backup tool) continues to write to the drive.

On Windows, selecting “Eject” from the context menu in File Explorer instead of the system‑tray icon can sometimes only close the Explorer window, leaving other processes untouched. On macOS, dragging the drive icon to the Trash while a Finder window is still displaying its contents can also leave an open handle.

Tips

  • Enable the “Show hidden files and folders” option temporarily to see if any stray .tmp files are left on the drive; delete them before ejecting.
  • Use the built‑in “Safely Remove Hardware” icon rather than the right‑click “Eject” option for the most reliable release on Windows.
  • Keep the Sysinternals handle.exe utility on hand; it makes identifying locked files quick.
  • On macOS, consider disabling “Show warning before emptying the Trash” while troubleshooting, as it can interfere with the eject process.
  • Regularly run a disk‑check (Windows: chkdsk D: /f, macOS: Disk Utility > First Aid) to keep the USB file system healthy.

Troubleshooting

If the drive still won’t eject after following the steps above, try the following hierarchy of checks:

  1. Restart the computer. This is the simplest way to clear any locked handles that you may have missed.
  2. Update the USB drivers. Open Device Manager (Windows) > Universal Serial Bus controllers, right‑click each entry and choose Update driver. On macOS, ensure the system is fully updated via System Settings > General > Software Update.
  3. Disable fast startup (Windows). Fast startup can keep USB devices in a semi‑initialized state after shutdown. Go to Control Panel > Power Options > Choose what the power buttons do > Change settings that are currently unavailable, then uncheck “Turn on fast startup”.
  4. Use a different USB port. A faulty port can cause the controller to misreport the device’s status.
  5. Run a full disk scan. Corrupted sectors can prevent safe removal. Use chkdsk /r D: on Windows or Disk Utility’s First Aid on macOS.
  6. Boot into safe mode. In safe mode only essential drivers load, which often releases stubborn locks. After logging in, attempt the eject again.
  7. Format the drive as a last resort. Back up any data, then reformat using exFAT (compatible with both Windows and macOS) or the native file system you prefer. Formatting clears hidden locks but should only be done after all other options fail.

Always back up important files before performing actions that could erase data, such as formatting or using the chkdsk /f command.

Frequently Asked Questions

Why does Windows say “Device is in use” even after I closed all programs?

Background services like Windows Search, antivirus scanners, or cloud sync clients can still hold file handles. Use Task Manager or handle.exe to locate the hidden process.

Can I force eject a USB drive without losing data?

Forcing an eject (e.g., by pulling the plug) risks data loss if pending writes exist. The safest method is to terminate the locking process or restart the computer before removal.

My Mac shows the drive as “Not Ejectable”. What does that mean?

That message appears when the drive is being used by a system service, such as Time Machine or Spotlight indexing. Wait for the indexing to finish or stop the service temporarily.

Does disabling USB selective suspend help?

Disabling selective suspend (Control Panel > Power Options > Change plan settings > Advanced power settings) can prevent the OS from putting the USB controller into a low‑power state that sometimes interferes with safe removal, but it is not a guaranteed fix.

Is it safe to use third‑party “eject” utilities?

Most reputable utilities simply call the same OS APIs as the built‑in eject feature, so they are safe. Avoid unknown programs that claim to “force eject” without warning, as they may bypass safety checks.