Eject your flash drive before unplugging it to prevent data corruption

Pulling a flash drive out of your computer without ejecting it first can corrupt files, especially if your computer is still writing data to it. Ejecting tells your operating system to finish all pending operations and release the drive safely. On Windows, this takes about 10 seconds. On Mac, it's nearly when ready. The process is different on each system, but both are straightforward once you know where to look.

Your computer doesn't always show you when it's using a flash drive — it might be running a background scan, indexing files, or finishing a write operation you started minutes ago. Ejecting forces the system to complete everything before you remove the drive. If you skip this step and the drive was in the middle of saving or copying, you can lose data or corrupt files that won't open later.

Key Takeaways

  • Windows users should right-click the flash drive in File Explorer, select "Eject," and wait for the confirmation message before unplugging.
  • Mac users can drag the flash drive icon to the Trash, or select it and press Command+E to eject it safely.
  • If your system says the drive is in use, close any programs or windows that might be accessing files on it, then try ejecting again.
  • A "safe to remove" notification means the drive is ready to unplug — don't remove it before you see this message on Windows.

Ejecting on Windows

Open File Explorer and locate your flash drive in the left sidebar or under "This PC." The drive usually appears with a removable storage icon next to its name. Right-click on the drive name and select "Eject" from the menu that appears.

Windows will process the eject command, which typically takes 5 to 15 seconds. A small notification will appear in the bottom right corner of your screen saying "Safe to remove hardware" or similar wording. Only after you see this message should you unplug the drive. If the notification doesn't appear within 30 seconds, your drive may still be in use — check if any File Explorer windows are open with files from that drive, or if any programs are running from it.

If you see an error message saying the drive is in use, close any open folders or programs that might be accessing it. This includes web browsers with downloads from the drive, media players with files on it, or any document you had open from that location. Once you've closed everything, right-click and eject again.

Ejecting on Mac

Locate the flash drive icon on your desktop or in the Finder sidebar. You can eject it two ways: drag the drive icon to the Trash (the icon will change to an eject symbol as you drag), or select the drive and press Command+E on your keyboard. Either method tells macOS to prepare the drive for removal.

The drive icon will disappear from your desktop or sidebar once the eject is complete — this is your signal that it's safe to unplug. Unlike Windows, Mac doesn't show a separate notification; the disappearance of the icon is the confirmation. If the icon doesn't disappear after a few seconds, a program or window may still be using files on the drive.

What to do if the drive won't eject

If your system won't let you eject the drive, something is still accessing it. Start by closing every window and program you can see, including your web browser, file manager, and any media players. Then try ejecting again. On Windows, you can also open Task Manager (Ctrl+Shift+Esc) and look for any programs you don't recognize — end those tasks and try ejecting once more.

On Mac, open Activity Monitor (Applications > Utilities > Activity Monitor), search for any program that might be using the drive, select it, and click the X button to force-quit it. Then try ejecting. If nothing works after 5 minutes, restart your computer with the drive still plugged in. After restart, the drive should eject normally.

In rare cases, a file on the drive may be corrupted or the drive itself may be failing. If you've tried all these steps and the drive still won't eject, back up any important files to another location and consider replacing the drive.

Why you shouldn't just unplug it

When you copy a file to a flash drive, your computer doesn't write it all at once. It sends data in chunks, and the drive stores each chunk. If you unplug during this process, the file is incomplete — you'll have a corrupted file that won't open or will open but show garbage data. The same risk applies to any file your system is reading from the drive, even if you're not actively using it.

Some files, like system files or temporary files your computer creates automatically, may be accessed without your knowledge. Ejecting ensures all these hidden operations finish before the drive disconnects. It's a small step that takes seconds and prevents hours of lost work.

Frequently Asked Questions

What happens if I unplug without ejecting?

If your computer was writing data, that file becomes corrupted and won't open. You might also lose data that was in the process of being saved. If the drive wasn't actively in use, unplugging is usually harmless, but there's no way to know for certain without ejecting first.

Do I need to eject external hard drives the same way?

Yes. External hard drives, SD cards, and any removable storage should be ejected before unplugging. The process is identical to ejecting a flash drive on your operating system.

Can I eject a flash drive while a file is copying to it?

No. Wait for the copy operation to finish — you'll usually see a progress bar or notification. Once the copy is complete, then eject. Ejecting during a copy will corrupt the file being transferred.

Why does my Mac show the drive icon again after I eject it?

This sometimes happens if the drive reconnects briefly during removal. If the icon reappears, eject again before unplugging. If it keeps reappearing, the drive may have a loose connection — try a different USB port.

Is it safe to eject a flash drive while my computer is sleeping?

No. Wake your computer first, eject the drive, and then put the computer back to sleep if you want. A sleeping computer may still have pending operations on the drive.