# USB 2.0 Memory Key Freezing Up

## swingkyd

So I have a strange problem that I've been trying to fix. I have a USB Key,..one of those USB2.0 things (Sandisk Cruzer Micro USB2.0) . It keeps freezing up with the little LED flashing like crazy and never stopping

try 1) I had the USB "Low Speed USB block devices" selected along with the SCSI emulation "USB Mass Storage Device" one set at the same time. 

Results: I could plug my key into usb port, it would assign /dev/uba1, 

- I could mount it, and unmount it without any trouble. But if I mounted it, then tried to copy stuff to it, the copy command would finish but the USB key led would go crazy and never stop. 

- I couldn't unmount it then.  It would just hang on that command. 

- If I unplugged it then, the system would freeze and I'd have to power cycle to get it working again.

try 2) recompile kernel with ONLY "Low Speed USB block devices" selected (with usual HID, USB Printer and USBcore). 

Results: I could still plug and unplug the key without any problems. dmesg says it assigns /dev/uba1 without any problems...I could mount it like this:

```
mount -t vfat /dev/uba1 /mnt/usbkey
```

and unmount it provided I didn't access it any other way.

- but then when I try to write to it again, the cp command ends and the usb light goes crazy again and never stops.

- I try to unmount using : umount /mnt/usbkey (while I was in /mnt) and the message "device is busy"

- i wait and wait and still the light never stops blinking... so I unplug!

- then X crashes and I'm back on the console without too much trouble... 

- but anything I wrote was at 0kB (which from what I understand is what FAT does when you don't unmount after a write access) even though the name of the file is actually there. 

I really would like to use the new block device for it (though I haven't tried the scsi emulation way or really know how to do that either). I'd like to know what's going on when the light is going crazy...but I can't figure out how to do that. dmesg |tail shows nothing other than it was set up at /dev/uba1. 

any ideas?

----------

## jmanning

I'm using just the usb-storage driver. I don't think USB2.0 qualifies as Low speed USB block device - I think that is for special devices, not for common usb keys.

Try using usb-storage (USB Mass Storage Device), ignoring "Low Speed USB block devices" and mounting /dev/sda1 instead of /dev/uba1.

Also, writing to a disk happens asynchronously - meaning cp or mv will return before the data is done writing. Just wait a while, or type sync at a prompt. This will force it to flush all data to disk. When sync returns, it's safe to unmount.

When the light is going crazy, the data is being copied. The kernel does this in the background after the cp command returns.

If you try to unmount while data is being copied, it will do a sync first - and wait until the copy is complete. It might appear to hang, but it's just finishing writing the data.

So, first - be patient. Stick with the usb-storage driver. Try sda1 - it might be faster.

~J

UPDATE: You may have to add the following to your kernel and load the modules:

USB Mass Storage Device (usb-storage), SCSI (scsi_mod), SCSI disk (sd_mod).

----------

## swingkyd

jmanning,

thanks for your advice and response!!!

I will definitely try this now  :Smile: 

Isn't the scsi emulation method only using USB1.0? It's just something I thought I read when I was searching for help on this. 

Is there such a thing as USB2.0 support in the kernel? Or is that just the EHCI? If so, most of the people seem to be having trouble with EHCI when they are using USB-storage and scsi...did you have trouble with it?

thanks again for your help  :Smile: 

----------

## Achille

 *swingkyd wrote:*   

> 
> 
> Is there such a thing as USB2.0 support in the kernel? Or is that just the EHCI? If so, most of the people seem to be having trouble with EHCI when they are using USB-storage and scsi...did you have trouble with it?
> 
> 

 

I got exactly the same problem. Is there a solution? I can't find any other support for USB 2.0 in the kernel config except EHCI HCD.

----------

## kojiro

 *Achille wrote:*   

>  *swingkyd wrote:*   
> 
> Is there such a thing as USB2.0 support in the kernel? Or is that just the EHCI? If so, most of the people seem to be having trouble with EHCI when they are using USB-storage and scsi...did you have trouble with it?
> 
>  
> ...

 

I have a powered USB 2 drive that does something similar: when I try to rsync a few GB to my local disk from the USB disk it eventually "stalls" permanently, and the light on the drive stops blinking from green (ready) to red (reading) to yellow (???).

What happens on the computer side is that all access to that command prompt is gone once the light turns yellow. ctrl-c and ctrl-/ and ctrl-\ (not sure which one it is, anymore) don't seem to have any effect on either the process or freeing up the prompt. I can't kill the process either as the user who started it, or as root.

If I pull the USB plug on the USB drive, or otherwise disable the USB drive (power), the command prompt comes back.

Have any of you run across any faster way to get the command prompt back? or have none of you had this problem?

TIA,

Mike

----------

## bravo911

please see my other posts regarding this problem. I have not used the key recently but on initial testing it seemed to work just fine after a kernel upgrade... I do not know if anything had been 'deselected' from my old config.

https://forums.gentoo.org/viewtopic-t-267680-highlight-.html

----------

## ptitman

Hi,

  Some of you might be interested by this post https://forums.gentoo.org/viewtopic-t-242292-start-25.html.

   I had the trouble with my usb stick coz ehci_hdc modules was loading up.

  I've got usb2.0

```
0000:00:10.0 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)
```

 VIA & Intel usb host use uhci module. using ehci makes you able to list content of the usb stick, but then it goes crazy when you are really accessing the data.

   Hope it helps  :Very Happy: 

----------

## swingkyd

not to be too tonge-and-cheek but isnt the point to use the ehci module? don't we want to use the USB 2.0 support? or is the fact of the matter that USB2.0 for memory devices is not supported? disabling ehci will mean that usb2.0 does not work (regardless of uhci or ohci support since you can use only one or the other of these two)?

just a thought.

----------

## Dave_Lindquist

Just to add to the woes....

I just finished setting up an AMD 3000 (s939), and wanted to try my USB key (SanDisk Cruzer, too).  I have hald and hotplug running.

The second I plug the USBKey into the machine, *boom*, the entire machine stops responding -- literally everything.  Any existing SSH sessions are dead, VNC is dead, XWindows is dead, terminals on the box are dead, keyboard is dead, ping doesn't respond -- 100% killed.

I haven't had a chance to investigate it yet...

----------

## stefan-tiger

Hello,

did someone solve this Problem? I have an SanDisk Cruzer Micro too, an the behavior is exactly the same as in the first post of this thread: Mounting and reading works, writing and unmounting causes trouble.

I use Kernel 2.6.11-r6 (tried 2.6.9 before).

The USB-stick works fine under Windows XP.

I stay in hope.

----------

## Pseud

I have a usb 2.0 related system-freeze problem too! Anyone managed to solve this yet?

I posted this in another related thread:

 *Quote:*   

> 
> 
> I get system freezes too! Everything locks up, the keyboard, mouse ... nothing works, and I'm forced to use the reset button.
> 
> I have tried hard to figure out what causes it, but not very lucky yet. But I've noticed one pattern ... it always seems to happen a few minutes after I use a USB device like a usb digital camera or my ipod. I think our problems might be similar.
> ...

 

----------

