How to eject USB device safely is still a concern for many computer users today.
What are the USB devices?
USB devices are external electronic devices that we plug into our computer’s USB port.
Flash Disk and external hard disk are the most popular USB devices in use today.
Many computer users wonder if there is an effect when you unplug your USB device manually.
Read through to the conclusion to see why it is safe in Windows OS but not in MAC and Linux OS.
We start by understanding how a USB device works.
The computer OS either reads or writes a USB device connected to it.
For example, the OS starts reading from USB when you open a pdf file stored in a flash disk.
Of course, you expect your computer to read from your USB device fast and accurately.
To achieve this, Computer OS uses write caching technology.
How does write caching work?
Write caching is optimal instruction queuing technique used by computer OS to read and write USB drives.
Instead of writing each instruction to the USB device separately, the OS keeps these instructions then implements all these instructions at once.
For example, if you are saving 3 files from your computer to a USB device, the OS will save the file in a cache first.
After the 3 files are loaded in the cache, the OS now writes all 3 files in the external device at once.
If you start saving your files and then eject the USB manually, chances are that the OS was still writing the USB after write caching process.
If that happens, it means some files will not be written completely hence the file will get corrupted.
You may have saved a file in your flash disk only to find that it is not opening on another computer later.
Most likely that data got corrupted while you were saving it.
This is perhaps the reason why some OS like MAC and Linux will warn you in advance to first ensure you eject the USB using task manager before unplugging.
Why is it safe to Physically Eject USB in Windows?
Microsoft was cognisant of human behaviour when it comes to the USB.
It is almost certain that the majority of computer users are ignorant or in rush to eject USB devices physically rather than through task manager.
Windows OS has write caching capability disabled by default for any drive the OS recognizes as “removable.”
Therefore, windows OS writes data to the USB device directly without first caching.
Such prevents data loss or data corruption should the USB device be ejected manually.
So what happens when you eject the USB manually?
Ans, the Windows OS retains the other data or instructions avoiding data corruption.
Why it is not safe to eject USB device in MAC and Linux Computers
Unlike Windows, Linux and MAC OS use write caching when writing to external devices like Flash disks.
Therefore, Linux and MAC OS first store in the memory before writing it to the disk at once.
Therefore, if you happen to eject the USB device manually, data stored in your computer might be corrupted.
Computer OS use write caching technology to write or read external USB devices. Ejecting USB device manually in Window computers is safe since write caching feature is disabled by default.
On the other hand, MAC and Linux OS use write caching to read and write to the external USB devices. Therefore, it is not safe to eject USB devices manually for computers using MAC and Linux OS.