Is it safe to remove USB media when a computer is suspended?

Solution 1:

While there are indeed no transfers going on, the reason you do the Safely Remove Hardware dance is not because of the transfers.

You are doing this to cleanly unmount the file system — programs may be still using the drive, and some files may be still unwritten to the disk even after the application using them is closed. This is the same reason why you don’t just hibernate and switch operating systems — a mounted filesystem is never guaranteed to be in a consistent state.

Ever wondered why the OS slows down to a crawl when using floppies? It is because the cache is flushed after the write of each sector, so the floppy can be removed at any time when not in use.

(Still, you will get a dialog and your program will hang if you try to access a floppy that got removed behind your back. Just insert the floppy back and be done. This won’t work with USB drives because they get a different identifier each time — the program will just crash, and the OS may too if a driver was accessing a file)

Solution 2:

There are two options in Windows that affect the ability to simply unplug at will. 1) Optimize for fast file writes (technically a lie) by caching on the hard drive before writing to the USB device. 2) optimize for quick removal by ensuring Windows flushes every write to the USB drive immediately.

Back when USB drives were first introduced, you had to use the safely remove hardware feature because the operating system would cache any files you wrote to the hard drive first in order to present a high speed experience. USB 1.0 devices were exceptionally slow. When you click to safely remove hardware the operating system would ensure that it finished copying is local cache to the USB drive before unmounting it.

Web USB 2.0 drives came along they were fast enough to write dukes in nearly real time. Windows preferences changed to default to the USB quick removal option. Since then, if you plug in a USB device and don't manually change the option to cache mode, your drive is already set for quick removal. That means you can take it out as soon as it's stopped writing (light on drive quits flashing).