Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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)

share|improve this question
2  
Related, almost a duplicate: Does Windows flush drive caches on standby? –  Ilmari Karonen Feb 16 at 11:52
4  
...and also Is it safe to disconnect a SATA disk during sleep? and is it safe to unplug a USB drive while Windows is in sleep/hibernate/off mode? The latter one is an exact duplicate, except for being explicitly about Windows, whereas your question doesn't indicate a specific OS. –  Ilmari Karonen Feb 16 at 12:01

2 Answers 2

up vote 8 down vote accepted

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)

share|improve this answer
4  
People still use floppies!? –  tomasz Feb 16 at 12:53
8  
"While there are indeed no transfers going on, the reason you do the Safely Remove Hardware dance is not because of the tranfers." Do you have any sources to support this? It contradicts both Windows's description of the Safely Remove Hardware feature and Microsoft's online documentation. –  Marcks Thomas Feb 16 at 13:12
1  
Your answer is incorrect. It is not mandatory to use Safely Remove Hardware, unless you are actively writing files to the removable drive. Read this for a very clear explanation: 7tutorials.com/… –  Corporate Geek Feb 19 at 16:24
    
If a program has handles to files open on the drive, the next time it tries to write, it will crash if you yanked the drive off. –  kinokijuf Feb 20 at 10:25
1  
@kinokijuf: That would be a bug. Any modern OS will just return an error code to the application, and an application which properly handles error codes will just show an error message to you. "Failed to write H:\thesis.doc" may be a scary message, but it's not a crash. –  MSalters Feb 20 at 11:09

Unplugging a USB device while the host system computer is live might be dangerous to the USB device. The problem is easily explained, but rarely have I seen a technical reason why this is so. It has to do with the 5VDC power supply to the USB device from the outlet on the host PC. Plugging IN the device is safe enough, but unplugging it is where the problem arises. By suddenly pulling OUT the USB device, the 5VDC current drops abruptly causing a possible collapse of magnetic flux .. and a sudden high-voltage spike that could ZAP the USB device. That high-voltage might be very much higher than the expected 5VDC. So, you have been warned. If you truly value the data on such a USB device, first click on the system tray icon to STOP that particular USB device, which cuts the power to that device before you unplug it safely. If more people realized what was going on, they might tend to be more careful.

share|improve this answer
5  
Citation needed. –  Wyzard Mar 4 at 22:02
    
Agreed. This information is false and misleading –  Canadian Luke Mar 5 at 2:05
    
Also, Microsoft writes in "USB Port Remains Active for Disabled or Safely Removed USB Device": "In Windows Vista, Windows Server 2008, Windows 7, and Windows Server 2008 R2, when a USB device is marked as Removed, the USB hub port to which it is connected is not Disabled." So, cutting the power may occur on some OS's, but certainly not on all. –  Arjan Mar 16 at 9:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.