How-To

Should I Always Safely Eject USB Devices?

If you feel pestered by a notification to safely eject USB devices, it might be time for a second look at it. Windows has a default setting to help data from being lost, but it isn’t flawless.

Whenever you plug in a USB storage device, Windows will usually give you a prompt about whether or not it is safe to eject it. So what’s the deal with this anyway? You’d think with how common of an issue it is that there would be more information on it from the Windows interface, right?

Safe to Unplug USB Drives?

If you’re wondering what this even is, check out the system tray the next time you plug in a thumb drive or other USB storage device. A little USB icon with a green checkmark will  pop up. This is the same icon that you can click to safely eject a device before you physically remove it from the computer.

safely remove hardware and eject media

What Windows Says About It

If you yank a USB drive out without safely ejecting it first Windows doesn’t pop up a warning message like OS X. Instead, it just unplugs — and that’s that. Or is it? If you open up the Device Manager and view the properties of the USB Disk Drive you have plugged in you can see why Windows doesn’t seem to care if you unplug early.
device managerdisk drive properties

Windows has two policies. The default is to automatically disable write caching for devices that it sees as temporary or removable. Under this policy, Windows states that you can always disconnect the device safely without using the Eject option. That isn’t accurate, but we’ll get to that in a minute. The second profile is called “Better performance” and it keeps write caching enabled for the connected device. Interestingly, on a Linux or Mac computer this second policy would be the default as they always leave write caching turned on. To understand what all of this means you need to first understand what write caching is.

write caching policies for usb devices

What is Write Caching?

Write caching is the default method used for storing data on hard disks, and if enabled it can be used for removable drives as shown in the screenshot above. When you copy files over to a disk, Windows doesn’t transfer the data directly to it. Instead, some of the data is temporarily saved to the computers highly-volatile memory cache, or buffer. This is done because the data transfer to the USB is slower, even with modern USB technology. The downside is that the buffer where the data is being stored is erased when power is removed, or when the destination is removed. Such can happen when you unplug the USB device before the cache is completely written to it. Using the Eject command forces the OS to write all remaining data to the USB stick and sever the connection on a software level, so no data is lost.

data write request

Data Can Always Be Lost, Even with Write Caching Disabled

Generally, the default profile in Windows works for most people. But even though Windows says that data is safe with write caching disabled, it isn’t always. If you pull the USB drive out during a data transfer, data loss and corruption can occur. If you’re running a portable app from the USB drive, or using an application on the computer that saves data to the USB drive you can also lose data. There have even been cases where users have had corrupted data just by using a USB stick for ReadyBoost and pulling it out without ejecting.

resource monitor usb

Write Caching Offers Better Performance with Slightly More Risk

Write caching can offer better performance for your system because it prevents transfers to storage devices from hogging all of the I/O bandwidth. The downside is that data is more likely to be caught in the cache and corrupted or lost if the device is unplugged without safely ejecting it first. The Eject function saves data from being deleted by using a cache flushing system embedded in Windows. Cache Flushing forces all of the data in the cache to immediately write to the device and then clear itself out. Once Windows says that the device is safe to remove, that is how you know the cache has finished flushing.

safe to remove hardwareeject device

With all of that said, it’s best to always safely Eject hardware before you physically unplug it from the computer. Also remember that while Windows may have a “feature” that disables write caching, Linux and Mac keep it enabled by default, so be extra careful when using a thumb drive with those operating systems.

1 Comment

1 Comment

  1. Brian Burgess

    August 31, 2012 at 8:40 pm

    When I make a bootable USB flash drive to install Windows 7 or Windows 8 I always safely eject it to make sure it isn’t corrupted and installs successfully.
    https://www.groovypost.com/howto/create-bootable-windows-8-flash-drive/

    Windows users are kind of spoiled about removing flash drives because it doesn’t yell at you like OS X does. Sure it’s an extra step, but it’s a best practice if you want to ensure your data on the drive doesn’t get corrupted.

Leave a Reply

Your email address will not be published. Required fields are marked *

 

To Top