Friday 24 July 2015

Why Do You Need to Eject Your Flash Drive (or Device) Before Removing It?



Why Do You  Need to Eject Your Flash Drive (or Device) Before Removing It?


Image result for Do You Really Need to Eject Your Flash Drive (or Device) Before Removing It



It’s well known that USB flash drives are supposed to be ejected before removing them. Your computer will often display a scary warning if you fail to safely eject the drive. But do you really still need to do this? What happens if you don’t?
Let’s take a look.

Different Protocols

First, we need to consider three different protocols your drive may use when connecting to your computer. Two of them don’t need to be ejected at all.
  • 1. USB Mass Storage: This is the main way a flash drive will connect to a computer. It is assigned a drive letter in Windows. It functions exactly as an internal drive does, so you can use it for storage or even run software off it.


  • 2. Media Transfer Protocol (MTP): This protocol is built into Windows and requires separate software on a Mac. It’s frequently used by Android devices. With MTP, you can copy files back and forth, but as it is seen by the system as a portable device rather than a drive, it does not need to be ejected.
mtp-android
  • 3. Picture Transfer Protocol (PTP): This is used by digital cameras to transfer images to a computer. It’s supported by Windows and Mac, and can be used by any application that supports the importing of images. PTP is very similar to MTP, so also does not need to be ejected.
Smartphones, cameras and other media devices that connect via either MTP or PTP can be disconnected simply by pulling out the USB plug without any damage to its storage.

Why Would You Need to Eject a Drive?

If your drive (or device) connects using the USB Mass Storage protocol then it should ideally be ejected. Although, as we’ll see, it differs slightly depending on whether you’re using Mac or Windows.
This applies even if you’re not actually using the device at the time.
The reason is because operating systems use a process called write caching. The operating system doesn’t always write a file to a drive immediately, but instead caches it and waits until it has multiple write operations to complete.
Doing these all at once improves performance, but if the cache is still full when you remove the drive, your data will become corrupted. Clicking the Eject button causes the cache to be emptied and any remaining data to be written to the drive.
That’s the reason why there’s often a delay of several seconds between ejecting the drive and being notified that it’s safe to remove it.
There are also potential issues with the abrupt removal of the power supply from a flash drive. Flash memory is susceptible to this, and it can cause parts of the drive to become corrupt.

Ejecting a Drive in Windows

By default, Windows has write caching disabled. This results in slightly inferior performance when writing to the drive, but also adds a layer of security to the many users who forget to ever eject them.
If you’re not concerned about the risks, you can activate write caching on drive-by-drive basis.
To do this, locate the Device Manager on your PC — Control Panel > Hardware and Sound > Hardware and Printers > Device Manager on Windows 7; or right-click in the bottom left corner of the screen and choose Device Manager on Windows 8.
windows-write-caching
Right-click on the attached drive, click the Policies tab, change the removal policy to “Better Performance”, and enable write caching setting accordingly.
If you do this, you will always need to ensure you eject the drive via the Safely Remove Hardware option in the system tray.
safely-remove-hardware
And just to note, write caching is already enabled on internal drives by default and you shouldn’t disable this as you will notice a significant drop in responsiveness.

Wrap-up

So, to summarize, media devices don’t need to be ejected. Neither do flash drives on Windows, unless you’ve specifically changed the settings for them. Drives on Macs should always be ejected, as should hard drives.
Improper removal of drives could cause data corruption, or in worse cases, put the integrity of your drive at risk.
Do you always eject your drives before unplugging them? Have you ever suffered data loss or other problems as a result of not doing so? Let me know in the comments below.







No comments:

Post a Comment