• ARTICLES
SEARCH

How-To Geek

When Should You Properly “Eject” Your Thumb Drive?

When do you safely remove a device? Some users put caution to the wind and yank out any device, while others perform religious rituals every time. Here are some tips and guidelines for practicing safe drive removal.

Removable storage has been around as long as the personal computer and safely removing or “ejecting” drives is something that OS X and Linux users are very familiar with. Whenever an external storage device is plugged into those operating system it becomes mounted to a location, and if you just pull it out without warning your OS, typically you receive a nasty warning saying you may have just lost all your data.

In Windows, however, drive mounting is different. It doesn’t always require you to safely remove a device and rarely does it send out nastygram popups when you remove a device without warning. At most, you may get a popup the next time you plug in the device asking you to scan and fix the drive.

So how can you know when you should eject a drive before unplugging it? Here are some never, always, and sometimes situations to consider.

Never Eject

Let’s start with the easy scenarios first; devices you never need to eject before removing. This includes the following:

  • Read only media like CDs and DVDs as well as write protected USB, CF, or SD cards. When a device is in read only mode there is no way to corrupt the information on the device because Windows does not have the capability of changing information. For USB devices, make sure there is a physical switch on the casing that allows you to switch between read and write modes.
  • Network drives stored on a NAS or in “the cloud”. This doesn’t mean the information won’t ever become corrupt by disconnecting your network while writing files, but these drives do not need to be safely removed like other devices because they are not controlled by the same plug n play subsystem.
  • Portable devices like media players and cameras connected via USB. These devices hold a special place in Windows and do not need, nor can they be, ejected before removing. For portable devices you won’t see a safely remove option in the menu.
  • Devices with ReadyBoost. I know no one uses ReadyBoost anymore, but if you are using a device for a swap space boost, you should always let the operating system know before you remove it. Thanks to the readers below I found that Microsoft does not require ReadyBoost devices to be ejected before being removed. The ReadyBoost files are simply a cache for the real files being written to disk and removing the drive without ejecting does not harm the system.
  • There is one more type of device you should never eject and that is a device you have booted an OS from. By “never eject” we mean don’t ever pull the drive out of the system unless the computer is turned off or the entire operating system is loaded into RAM like winPE. Most typical live Linux distributions only load what is needed from the disk when asked for it. Because the OS needs access to the drive to load files and software you should never pull out the boot device while the OS is running. The same goes for your Windows system drive (C:) because technically you could install Windows on a removable device and Windows 8 will have the option for a portable workspace.

Always Eject

On the other end of the spectrum are storage devices that you should make a habit out of safely ejecting every time you remove it. This includes:

  • USB Hard drives that are powered via USB. Spinning disks do not like when power is abruptly cut off from the device, and by ejecting the device first you can allow Windows to park the read/write heads off to the side so no damage occurs.
  • Storage devices you have specifically turned on write cache for better performance. Turning on write cache greatly increases the devices performance, but the downside is you should always use the eject prompt before unplugging the device to prevent file system corruption.
  • Drives that are in use. You won’t be able to safely remove these devices until you close all the open files or the read/write operations finish. If you were heavily using the drive, it is good practice to eject the drive first to make sure Windows is still not using the files. Technically you only need to safely remove a drive when you are writing to the drive, but if you have files open you may get a file not found error in the program or crash if the device is no longer available. If you are copying files from the device you will probably end up with corrupted files in your destination which can be just as bad.
  • Drives with encrypted files or file systems. If you are decrypting files so you can read them you should always make sure you eject the drive before removing it from the system. This should allow your encryption software to properly re-encrypt any changes you have made before pulling the plug.
  • Devices with ReadyBoost. I know no one uses ReadyBoost anymore, but if you are using a device for a swap space boost, you should always let the operating system know before you remove it.

Because it is sometimes a pain to eject a drive, here are two how-tos for creating a shortcut or hotkey to quickly eject your drive(s). Create a shortcut using disk ejector or create a shortcut using built in functionality.

Sometimes Eject

The drives that are left are the typical USB flash drives you probably carry in your pocket all the time. Here are some guidelines and tips to follow before removal.

By default Windows sets removable storage devices to allow for quick removal. This means you should be able to just pull the drive from the system so long as it is not in use. There are still a couple situations you may want to consider though.

  • When running portable apps from a USB drive. The software should run completely from memory, but if the software needs to save a configuration file or reload a portion of the program and the drive is not available the program may crash. In this case, ejecting the drive won’t necessarily help, but you should consider closing the programs before removing the drive.
  • Devices with CD emulators or launchers like U3. These launchers are just programs that autorun when the device is plugged in which means the program may be running in memory and prevent you from safely removing the device. Of course we’d just recommend you uninstall the launcher completely.
  • After writing files to the drive. Even if the light on the drive stops flashing, Windows may still be waiting for the device to become ready or another task to finish first. Any time you write files to a flash drive, ejecting is a good idea or you might get the dreaded “delay write failed” error and have to start your file copy all over again.
  • When using file systems with a journal like NTFS and HFS+. A journal helps with errors when power is lost or a drive disconnects allowing the system to continue with its file actions once power is restored. This is great for internal hard drives but can lead to unwanted consequences on a device that plugs into multiple different computers and operating systems. For most removable drives you are probably better off sticking with FAT32 for drives that need to also be used in OS X or Linux or exFAT for drives that are strictly kept to new Windows systems and OS X.
  • USB hard drives with external power adapters. USB hard drives are treated different from USB flash drives and even if the drive has external power, it is still a good idea to let Windows park the heads before removing the USB cable from the computer. Windows removal policy will allow the drive to be removed without major reproductions, but larger drives typically hold larger files too (>2 GB) which means you also probably have the drive formatted with NTFS. As we just stated above, ejecting NTFS drives is good practice.

Justin is a Linux and HTPC enthusiast who loves to try new projects. He isn't scared of bricking a cell phone in the name of freedom.

  • Published 08/9/11

Comments (27)

  1. Valens

    Unlike databases, the average filesystem is not ACID-compliant, meaning that it makes no guarantees about your data and its integrity when read/write operations fail, collide, etc. By yanking a drive, what you’re essentially emulating is a sudden power failure.

    For a non-journalled filesystem, this can be a serious problem. Imagine that the filesystem is in the middle of a write operation. It writes an entry in the directory listing, allocates a bunch of free blocks to be used, writes the metadata, and then writes the blocks of actual data. By yanking the drive, the filesystem can be interrupted at any point during that delicate operation. What happens to the file? Partially written, possibly. What happens to the directory index that it was editing? Could be corrupted, pointing to files that never existed. What about the blocks that it allocated but never used? That space is just lost for now. Until you do a disk repair (which basically validates and reconstructs the filesystem indexes and metadata from scratch), you have a basically corrupted filesystem that’s reporting wrong values.

    If you have write-buffering enabled, it’s even worse. Even the data that you thought finished saving could be lost. The thing is, the data may not even exist on disk yet. Write buffering means that the operating system lies to you (“yep, I wrote that data all right”) in the name of speed, but actually is waiting for an opportunity when the system is less busy or when it collects a lot of data to write all at once. By yanking the drive, that buffer is simply lost. The next time you connect the drive, the file you thought ‘saved’ may not even exist.

    A journalled filesystem does better. It still won’t recover lost write operations for you, but at least the filesystem itself is not left in an inconsistent state. It simply reads the journal and restore itself to the last known good state, and your last write operation be damned.

    Rule of thumb: if you left a drive in and haven’t really been writing to it, and/or you don’t really care about the state of its filesystem, go ahead and yank it. If you just finished saving a bunch of files, or if the thing contains critical data, it’s probably not worth risking your data to save yourself 2 seconds.

  2. Lady Fitzgerald

    It doesn’t take long to eject a USB drive, flash drive, camera card, etc., three or four seconds at most. Doing it every time ensures you will never corrupt anything when disconnecting.

    I have an older WD external drive that came with software to spin down the drive. It pops up in the tray when using the drive. It takes no more than five seconds to click on it, select the drive, and spin it down. Then I can safely disconnect.

  3. jim

    i never safely eject a flash drive. never had an issue in my 2389289348928924894 times of using so many of those devices.

  4. Lee

    I usually try to eject flash drives whenever I can, but U3 flash drives are a pain. I use one at school daily and I can almost never safely eject it (I’m assuming because of the emulated cd drive). I’m probably going to remove the U3 software (I disabled it from running a long time ago), but I think it will delete all my data (luckily it’s only a 2gb flash drive so I can just copy it to a computer and kill the stupid software).

  5. Lady Fitzgerald

    @ Lee. Yes, you would delete your data. Transfer it temporarilly to another drive or a computer, then format the U3 drive. I have one of those and that was the only way I could get rid of the software.

  6. MrMagoo

    “Spinning disks do not like when power is abruptly cut off from the device, and by ejecting the device first you can allow Windows to park the read/write heads off to the side so no damage occurs.”

    Actually, hard drives are designed (and have been so for at least 30 years) in such a way that the heads are parked and locked automatically when power is removed. The back EMF of the spinning motor is used to recover enough power to move the arm to the landing zone or ramp.

  7. Jeff

    A bit off topic… but I was wondering why you said “I know no one uses ReadyBoost anymore”? I use it on all of my machines, and it serves me well. Are you implying that there’s a better alternative? If so, please elaborate!

    As to the topic at hand, I’ve had a number of users lose their USB thumb drive data because they just yanked the stick out. You really do have to safely eject thumb drives.

  8. hfrankjr

    LIke Jim, I always just jerked the flashdrive out of the computer. That is, until one time I jerked it out and went to use it again another time and could not get access to anything on it. I now take the time to do it as prescribed. I can wait a few seconds.

  9. Tom Kanat

    I agree with Jim. I don’t trust usb flash drives… I just simply yank it out. Safest way sometimes to get rid or usb virus!!! ha ha.. no.. no

  10. Wigglerthefish

    @Jeff

    The only alternative so far as I know is Eboostr. The program is mo advanced but it messes up a lot, requiring me to reformat all of the drives. What’s nice is you can control the caching in the ram, albeit before the trial ends.

  11. Hamburger

    I used to just yank the usb drives out. I had one drive that I used for work and it was always moving between computers to load up apps. One day I yanked it out and it never worked again. It was going strong for 2 years until that day.
    A second drive failed just hours later, same thing. It was not nearly as old though. I now take the time to properly eject though I have never done so before.

  12. Sherri

    I agree with Hamburger’s comment. Same thing happened to me, which taught me to take the time to properly eject first. Haven’t had a problem since. Those who don’t think this tiny step is necessary may be in for a harsh lesson down the road. Just saying………

  13. Fred

    Some of us do still use Ready Boost. I use a 2GB micro SD card in my daughters mini laptop (it only has 1 GB of memory). Ready Boost substantially increased the performance of her computer. I have pulled the card on many occasions without ejecting and have had no problems. The card still functions just fine after reinserting it.

  14. GeorgiaCowboy

    I’m of the notion that ejecting ISN’T NECESSARY in most cases, but I DO most ALL the time.
    When windows tell me (and I hate the hell out of this) that I need to “try” again “later”, I just use Unlocker that I installed a long time ago. I just go to MyComputer > right click the drive > click Unlocker and let it do it’s thing.

  15. Isi

    I have a Buffalo MiniStation hard drive plugged in via USB. On my computer, I can never eject it. On a different computer I can. Can’t figure out why…

  16. rocinonte

    You should always use the proper ejection command if you are using any form of media encryption such as Checkpoint Media Encryption. Failure to do so can result in corrupted encryption which renders the files useless.

  17. Bob

    I generally eject a drive first, but it drives me crazy when I get an error that I can’t eject because it is in use. Is there an easy way to find out what is using the drive so that the process can be killed?

  18. keltari

    You are incorrect about having to eject ReadyBoost devices. According to Microsoft you can safely remove a USB flash device that uses ReadyBoost at any time. Because ReadyBoost writes to disk first and then copies data to the device, no data is lost and there is no negative impact on your computer. If ReadyBoost looks for the data on the flash media and does not find it, it reads it from the original location.

  19. MaxB

    I bought a 64gig thumb drive from eBay and down loaded about 25 gig of music to it. When I click open I can see the titles of each tune but they wont play. Any suggestions would be appreciated.

  20. snert

    Most of my USB dongles have a little light that flashes when they’re dealing with data.
    There’s a light on the USB ports on the front that does the same thing.
    When those light have not flickered in two or three minutes – unplug – no problems.

  21. Al Lustie

    I have found clients who routinely just pull their thumb drives out of the USB port and whose USB ports seem to “burn out” — at least they no longer work no matter how many reboots they go through.

    On the other hand, my clients (and I include myself and my family) who eject them (Windows) properly have never had a USB port quit working.

  22. keltari

    MaxB — NEVER buy thumb drives from eBay. Most of them are fake. Often taking smaller drives and making them appear as bigger. Actually, just dont by anything from eBay…

  23. crearank

    “perform religious rituals”

    lol, very funny

  24. Michael F.

    I just don’t think about it. My external 500G is always connected and according to the aforementioned information, my Garmin cycling computer and phone don’t need to be ejected so I just grab and go. I will say that there are times when it crosses my mind to eject the devices, but I use USB keys so infrequently, that there’s no way to make proper ejection a habitual occurrence…

  25. zoo

    Is it safe to unplug a device (regardless of type) as long the computer is turned off?

  26. conga

    Windows parking the heads, hahaha, that sounds sooo 80s. Does anyone still use MFM HDDs? Hahaha!

  27. darklord

    it all depends how u have told windows to handle ur flash drive . if u yank it before windows is completely finished writing to it u will corrupt ur data . if u just wait till windows is done copying nothing will happen .

Get Free Articles in Your Inbox!

Join 134,000 newsletter readers

Email:

Go check your email!