PDA

View Full Version : USB Problem



B.M.
03-06-2007, 11:05 AM
Can anyone explain just what happens when one plugs in and unplugs a USB device?

I know when you plug them in they are automatically detected, but when you close them down you should do so from the Icon on the taskbar.

The reason I ask, is my daughter has just been plugging her camera into their computers and pulling the cord out when she’s finished. :blush: Now neither computers recognise the camera. So I’m curious as to what happens in the conventional closing down procedure and whether she has damaged the camera or computers.

For instance, does the correct close down procedure remove the 5 volt power supply line before you remove the cord? :confused:

kjaada
03-06-2007, 11:51 AM
This should not be a problem.Are you sure that the camera is not shown as portable media device or another disk in "My computer" I think you will find it there somewhere when the camera is plugged in.

pctek
03-06-2007, 11:59 AM
Even though USB devices are Plug & Play—that is, they're ready to go upon being plugged in—you shouldn't just unplug them. A USB port has current running through it, so the power jolt caused by unplugging a "hot" connection can corrupt data on a storage device, camera, or mp3 player.

B.M.
03-06-2007, 01:19 PM
This should not be a problem.Are you sure that the camera is not shown as portable media device or another disk in "My computer" I think you will find it there somewhere when the camera is plugged in.

Unfortunately, the camera can not be found anywhere, cleverly disguised, in My Computer. :(

Device Manager also shows a clean bill of health.

I even ran SFC /scannow thinking I might find a corrupt file but no such luck.

It’s interesting you say that her unceremonious exits shouldn’t matter despite teachings to the contrary. She has been simply pulling the plug as it were on all her USB Devices for years now. This is her first problem and may still have nothing to do with her actions.
All of which seems to support your view. ;)

I’m still interested to know if the “ceremonious” version of the disconnection, disconnects the 5 volts. :)

beeswax34
03-06-2007, 01:40 PM
There have been plenty of posts about this including camera's and external HDD's that have been corrupted or fried because the owners simply "pulled the plug" It might be safe but why not take the extra 1.5 seconds to disconnect it properly and save yourself a lot of grief down the line.

Like this for example.

Graham L
03-06-2007, 02:28 PM
USB is a hot-plugging interface. It's not the sudden remoival of power which can lead to file loss. It's "surprising" the OS that does the damage.

Any USB device which has a file system is treated like a disk by the OS. For speeed, the directories are kept (and updated) in system memory while the device is active. Buffering might mean that a file is not be written immediately.

The reason for the "removal" icon is that the OS must be told that you are removing the device. That allows it to flush any file buffers, and, most important, write out the updated directories to the device, and ensure that there's no activity when you do remove it.

Rushed removal can mean that the directory does not agree with what's on the device. That is a corrupted directory. Any writing to the file system using an out of date directory will cause file corruption. Pulling the plug while a disk is still writing (even after the transfer is thought to be completed) is a good recipe for disaster.

B.M.
03-06-2007, 02:50 PM
Righty ho Graham I’m getting the picture. (well I wish I was) :D

I can understand how one can loose data and corrupt files, but shouldn’t the Computer and associated devices be able to recover from such an event?.

Imagine a power cut in Auckland. Every computer, (without a no-break supply) and USB device attached, is in jeopardy.

Now, although anything held in RAM is lost, the Computers reset themselves when the power comes back and I guess so do all the USB devices, off which I suggest there are ten’s of thousands.

Surprisingly, the daughter has disconnected her USB devices, in this uncivilised manner, thousands of times over a period of years and everything except one camera is still working fine. :confused:

Graham L
03-06-2007, 03:09 PM
Potential problems don't always bite you. Buffers and directories are written out periodically. But some of those thousands of computers do get problems. We are often told about it here. :D

Usually, if you have just read from a USB device there's no problem. The directory hasn't changed. So, usually, a camera will not be affected.

It is still nice to let the OS know. ;)

Lurking
03-06-2007, 03:12 PM
We have 2 Win98se pcs' with USB connections.

No icon appears on the Taskbar, so we go to My Computer Removable Disk and Right Click and use the Eject function.

We usually put any other appliances into a cold machine and switch on.

Is it any different when the need arises in connecting a usb printer connection, we suppose that will stuff up the buffer memory?. Not that we have moved printers between 4 pcs'.

Lurking

Tony.br
03-06-2007, 03:16 PM
What is the camera BTW

Is it a Canon because canons do not appear as a drive. They have their own software to transfer the data.

B.M.
03-06-2007, 03:20 PM
I agree entirely Graham.

I’m just trying to find the line between Etiquette and Necessity. :D

Agent_24
03-06-2007, 04:25 PM
IF the device needs to be dismounted before unplugging then you will get the 'safely remove hardware' tray icon. That's why it's there. It always gets me when people just rip out their flash drives and say "it doesn't matter, it's always worked for me"

Printers and will not matter, it's only devices with an actual filesystem and storage space of some kind

Lurking
05-06-2007, 03:57 PM
Thanks Agent_24, that solves printer query, although with the Blue Screen of death, the Canon S330 seems to remember after re-booting that there is still printing to be done.

Lurks.

Graham L
05-06-2007, 04:45 PM
You'll find that it's not the printer which "remembers"; it's the OS. That means that there is some of the print file which hadn't been sent to the printer when the printer became inaccessible. (Unless it's a very clever printer, usually a networked one with a hard disk so it can do its own spooling.)

SurferJoe46
05-06-2007, 06:15 PM
Goto the PROPERTIES>>HARDWARE>>POLICIES on any of your drives and see if the "WRITE CACHING" is enabled on whatever device you want to unplug.

The grayed-out print will tell you what you need to know.

If "OPTIMIZE FOR QUICK REMOVAL" is engaged, you can plug in and out to your heart's content.

If you've "OPTIMIZED FOR PERFORMANCE" then..NO..don't yank it out..(the verb, not the noun).

B.M.
05-06-2007, 06:55 PM
I haven’t had the opportunity to enter into in-depth dialogue with this Camera yet as I was only told about the problem whilst visiting the Daughter the other day.

However, I shall be checking the cord, as it’s bound to have been “Yanked Out” on many occasions. :D

Interesting topic though and it appears that the correct disconnection process does not remove the 5 Volt feed, so the apparatus would still be exposed to power spikes. :confused:

Hmmmmm? :cool:

dugimodo
05-06-2007, 07:06 PM
to add to what surferjoe said I've found that USB flash drives tend to default to "optimise for safe removal" meaning that as long as you dont pull it out half way through copying something you should be fine.

For cameras though it would pay to check at least once to see what the setting is, and don't expect it to be remembered if you change it.

If the camera's memory card or internal memory has been corrupted a reformat from the cameras menu ought to sort it out.

As for the 5v thing - if the manufacturers haven't taken into account that people WILL just yank thing out they need shooting.

Graham L
05-06-2007, 07:22 PM
If you look at a USB "A" plug, you will see that the two outer contacts are longer than the two others. The outer contacts are the power supply ones. So power is connected before the data lines are connected, and the data lines are disconnected before the +5 and earth pins.

What power spikes? The +5 is from a regulated supply. This is a "hot plugging" protocol. The devices are designed to be plugged in to or removed from "live" sockets. That's how the computer recognises that a device has been plugged in. The device powers up, and sends its ID to the CPU.

If the users would just follow the instructions in the Fine Manuals ... :groan: Of course they would have to Read The FMs.

Agent_24
05-06-2007, 07:28 PM
As for the 5v thing - if the manufacturers haven't taken into account that people WILL just yank thing out they need shooting.

Not the manufacturers fault, the USB spec doesn't call for prevention against idiots and there is always a warning in the manual somewhere saying do not do it.

If people want to risk ruining their devices by going against warnings and common sense then it's fully their responsibility


What power spikes? The +5 is from a regulated supply. This is a "hot plugging" protocol. The devices are designed to be plugged in to or removed from "live" sockets. That's how the computer recognises that a device has been plugged in. The device powers up, and sends its ID to the CPU.

it's not really the electrical connection that is a problem though, it's the filesystem on the devices usually, but maybe there are some cases where saying 'safely remove' causes the device to power down in some way also??

http://www.usb.org/developers/docs/usb_20_040907.zip should set everyone right :D

Graham L
05-06-2007, 07:42 PM
If you remove a CD-R while you are writing to it, don't expect to be able to read from it. That's because the filesystem has not been closed properly. But the disk looks OK;it hasn't been physically dameged. ;)

All USB devices can be plugged in, or removed, without notice, without damaging the device. But if a device has a file system, that can be corrupted if the OS hasn't been given warning, and time to close the file system properly before the device is removed. Joe suggests that the OS can be told to keep the USB filesystem up to date at all times. I'd still use the icon. ;)

Agent_24
05-06-2007, 07:55 PM
If you remove a CD-R while you are writing to it, don't expect to be able to read from it. That's because the filesystem has not been closed properly. But the disk looks OK;it hasn't been physically dameged. ;)

All USB devices can be plugged in, or removed, without notice, without damaging the device. But if a device has a file system, that can be corrupted if the OS hasn't been given warning, and time to close the file system properly before the device is removed. Joe suggests that the OS can be told to keep the USB filesystem up to date at all times. I'd still use the icon. ;)

I imagine you'd also have to find some way to unlock the drive (paperclip??) which may or may not cause physical damages to something....

It doesn't matter how much you tell the OS to constantly update the filesystem, someone will find a way to ruin it.

All it takes is a half-second to click your device and choose remove or eject or dismount or whatever applies to your OS and you have no problem, vs staying up all night downloading recovery programs in the hopes that you can retreive your highly important whatever it is

B.M.
05-06-2007, 11:05 PM
Ok, so what is the consensus of opinion?

From what I’ve read it shouldn’t matter a bit if you unceremoniously disconnect any USB device as long as your not transferring data when you do it.

If you do, the Data will be shot, but the Device should still be fine.

Is that it? :confused:

winmacguy
05-06-2007, 11:12 PM
If you do, the Data will be shot, but the Device should still be fine.

Is that it? :confused:

Sounds about right.

B.M.
06-06-2007, 11:33 AM
Thanks Guy's.

We got there in the end. :thumbs:

Agent_24
06-06-2007, 12:14 PM
or if the OS hasn't fully written out any cached data

The_End_Of_Reality
06-06-2007, 12:49 PM
I have all my USB storage devices set to "Optimize for quick removal" which means I can just pull the plug with out worrying about safely removing it...

BUT if it was set to "Optimize for performance" then I will lose data if I just unplug it... (depending on if there was data in the cache)

Agent_24
06-06-2007, 12:56 PM
Now why didn't I remember about that option ...?? :D

The_End_Of_Reality
06-06-2007, 07:12 PM
Not sure... but it seems Joe posted about that before... up ^^ there ^^ :p

Agent_24
06-06-2007, 07:31 PM
What do you know.. Musn't have read the posts properly

SurferJoe46
06-06-2007, 07:44 PM
YES...I did !