Safely ejecting USB flash thumb drives in Linux
Linux external drive write caching can lead to data loss upon unplugging an external flash drive or hard drive. Verify writing to a flash drive is completed by typing:
and wait for the
$ prompt to come back up.
Monitor Linux file write progress with:
or the graphical
Click the Eject icon next to the flash drive’s name in your File Manager.
Flash drives can be slow. Consider a flash drive writing at 2 MB/sec. Then, writing a 1 GB file will take 1000 / 2 = 500 seconds = 8.3 minutes!
Windows external drive write caching: we safely remove devices when removing USB drives, as typical inexpensive flash drives write data quite slowly (less than 5 MB/sec). By default, Windows “write caches”, that is, Windows uses RAM to temporarily store files – making the copy/write operation appear done faster than it actually is. If you remove your drive before the writing is done, that file or even the whole disk can become corrupted and unreadable.