How Safe is a USB Flash when Removed From a Suspended Computer?
I have had lots of arguments with different persons, who say it's very wrong to unplug a USB device while the operating system is suspended.
Today, i came across the same question "Is it safe to remove USB media when a computer is suspended?" on Superuser.
Image credit: Liliputing |
Here's the Question
We are often cautioned against unplugging USB drives in case it is currently being read from or written to. When a computer is suspended, hibernated, or asleep is it obviously not writing any data; it may have been in the middle of a read/write, however, it will have put such an operation on hold.
Since no arms are moving (for USB hard-drives), or bytes on the drive flickering on and off (for flash drives), is it then "safe" to unplug a drive?
Is this true even if data is being written to it, but the operation temporarily "suspended"? (assuming you don't mind that specific file only having been half-written to the drive)
Here's the Answer - the most upvoted answer
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.
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).
I have now come to a conclusion.
I really agree with this. This is good information. Nice blog.
ReplyDeleteThanks, David
ReplyDelete