Sign up ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free.

I see people unplug a USB e.g. External drive from the port without flagging/ejecting it from the OS first. What are the risks in disconnecting a USB device in the middle of a transfer? Could it damage my hub controller, or blow-up my motherboard or such?

share|improve this question

closed as off topic by Leon Heller, Kellenjb, Brian Carlton, Jason S, JustJeff Dec 30 '11 at 3:43

Questions on Electrical Engineering Stack Exchange are expected to relate to electronics design within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

According to USB standard, all devices must be plug and play and host needs to survive short between any lines. If the device is standard compliant, there must not be any hardware damage at all. The problem with safe remove is that for example file system on a flash drive may be left in bad state or a program using the device may crash (this happened to me with sound cards for example) and so on. – AndrejaKo Dec 29 '11 at 17:26
Forgive me if this is pedantic, but is 'plug-and-play' commutative apropos 'unplug'? I'm thinking whether it would be safe to connect an RS232-USB adapter to a USB port whilst the RS232 receives input from, say, a CW receiver; dare not experiment with it lest it blows up the m/b |+: – Everyone Dec 29 '11 at 17:41
This sounds like a superuser question to me. – Kellenjb Dec 29 '11 at 18:56
Let's try to keep this focused on the low-level implementation issues, rather than high-level usb-drive, motherboard, and Windows 7 issues. That is already addressed at Superuser; see Should I unmount a USB drive before unplugging it? and How to swap non-memory usb devices? for answers to that question. Chris mentioned that an always-unsafe drive could be built; how about an always-safe drive? – Kevin Vermeer Dec 29 '11 at 19:01
@KevinVermeer I do not believe that was the intent of his question at all. There is nothing in the question that shows of sign of caring how it works, rather only what could happen from a consumer point of view. – Kellenjb Dec 29 '11 at 20:10

1 Answer 1

up vote 11 down vote accepted

USB is intended to be electrically hot-pluggable, so the issue is actually one of software state rather than at the hardware level.

Essentially, the concern is that a mounted file system could have uncommitted buffers in ram at the time when the device is unplugged, or could be in the middle of some interruption-unsafe move operation or meta-data modification. Journaling file systems can provide some protection against this if well thought out (or make an even more hopelessly confused mess if badly designed). Further questions about that aspect of the issue would probably belong on superuser.

It would certainly be possible to (accidentally?) design a USB flash controller IC which conducted interruption-unsafe housekeeping operations below the level of the SCSI-like block device interface seen by the host, such that even when the host OS thinks the device is safe to remove it might not yet be. Hopefully that is not the case.

share|improve this answer

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