# USB Hard disk very slow

## RichardMatley

I have a Freecom external USB hard disk. Under Mandriva, it gives good performance (hdparm -tT buffered disk read speed ~22MB/s), while under Gentoo (my main and preferred OS) I only get:

/dev/sda:

 Timing cached reads:   1688 MB in  2.00 seconds = 842.02 MB/sec

 Timing buffered disk reads:    4 MB in  4.35 seconds = 942.62 kB/sec

This is using exactly the same system (laptop and connected devices). 

From /proc/bus/usb/devices:

 *Quote:*   

> T:  Bus=02 Lev=02 Prnt=03 Port=00 Cnt=01 Dev#=  4 Spd=12  MxCh= 0
> 
> D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
> 
> P:  Vendor=07ab ProdID=fc05 Rev= 2.40
> ...

 

There are some worrying looking lines in the dmesg output, such as:

 *Quote:*   

> usb 2-3.1: new full speed USB device using ohci_hcd and address 4
> 
> usb 2-3.1: not running at top speed; connect to a high speed hub
> 
> 

 

(There are a few entries like this, not sure which, if any, applies to this device)

So it looks like Gentoo is not running it at maximum speed - even though Mandriva does (exactly the same hardware configuration, literally just rebooted).

Any ideas, please?

Richard

----------

## evilben

Do you have the ehci driver in your kernel?

----------

## RichardMatley

Sorry - I should have mentioned drivers in my initial post, according to lsmod, the following are currently loaded (among others):

 *Quote:*   

> ehci_hcd               31816  0
> 
> ohci_hcd               21284  0
> 
> uhci_hcd               32144  0
> ...

 

Thanks

Richard

----------

## BigBaaadBob

Similar problem:

```
Dec 13 16:45:47 wideload usb 3-1: new full speed USB device using uhci_hcd and address 3

Dec 13 16:45:48 wideload ub(3.3): GetMaxLUN returned 0, using 1 LUNs

Dec 13 16:45:49 wideload uba: uba1

Dec 13 16:45:56 wideload fstab-sync[11016]: added mount point /media/usbdisk for /dev/uba1

```

and

```

/dev/uba1:

 Timing buffered disk reads:    2 MB in 81.78 seconds =  25.04 kB/sec

HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate ioctl for device

```

The same device in another Gentoo computer gets orders of magnitude faster performance...

----------

## RichardMatley

Has anyone got any ideas? I've just bought an iPod and exactly the same thing happens - it seems to be running only at USB 1.1 speed.

I'd really appreciate any help anyone can give

Richard

----------

## drjones69

Just a thought,

What mount options are the devices being mounted with?

Seem to recall to problems on USB devices (esp. with newer kernel) if the 'sync' option is set for the mount, can't remember if it needs an 'async' option passing, or just not passing 'sync' - something to do with sync-ing writes - I've only experienced it on smaller USB flash sticks, but it certainly has sorted out the problem for me.

Also what are the other drive settings (hdparm -iI <disknode>   - if memory serves), don't really have much experience with USB drives though.

Regards,

Ryan

----------

## RichardMatley

Thanks for the suggestion, but I've just tried async, and it doesn't help.

----------

## Headrush

I thought 

```
ohci_hcd 21284 0 

uhci_hcd 32144 0 

```

were two different usb 1.1 drivers and you probably only need one.

Don't know why both are loaded, could be causing a conflict or using wrong one?

----------

## BigBaaadBob

I collected info from the "good" system.

```
spooky ~ # lsmod | grep hci

ohci_hcd               21764  0

ehci_hcd               35272  0

uhci_hcd               34000  0

ohci1394               36148  0

ieee1394              103544  2 eth1394,ohci1394

usbcore               125696  9 snd_usb_audio,snd_usb_lib,ohci_hcd,ehci_hcd,usb_storage,usbmouse,usbhid,uhci_hcd
```

Since both uhci and ohci are loaded I don't think it causes a conflict.

I get:

```
/dev/sde1:

 Timing cached reads:   1376 MB in  2.00 seconds = 686.58 MB/sec

 Timing buffered disk reads:    2 MB in  4.12 seconds = 496.57 kB/sec
```

And it mounts this way: *Quote:*   

> Dec 15 12:37:46 spooky usb 3-2: new full speed USB device using uhci_hcd and address 3
> 
> Dec 15 12:37:46 spooky scsi3 : SCSI emulation for USB Mass Storage devices
> 
> Dec 15 12:37:46 spooky usb-storage: device found at 3
> ...

 

I'll edit this with the same data from the "bad" system (my laptop).  The above (my desktop) is quite different than the laptop, for reasons I haven't yet been able to research.

----------

## IBColeman

Looking at your Spd value below ("Spd=12" should be "Spd=480"), and the ("MxPS=64" should be "MxPS=512") values, it really does look like your drive's not taking advantage of the ehci_hcd module:

 *Quote:*   

> 
> 
> T: Bus=02 Lev=02 Prnt=03 Port=00 Cnt=01 Dev#= 4 Spd=12 MxCh= 0
> 
> D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
> ...

 

I'd try to play around with rmmod'ing uhci_hcd (I think you said it was there?).  I just fixed the same problem by building and loading ehci_hcd.

Good Luck,

Ian

----------

## BigBaaadBob

I finaly got the stuff from the bad system:

```
T:  Bus=03 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=12  MxCh= 0

D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1

P:  Vendor=07b4 ProdID=0102 Rev=10.14

S:  Manufacturer=OLYMPUS

S:  Product=u10D,S300D,u300D

S:  SerialNumber=124737289

C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=100mA

I:  If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=ub

E:  Ad=01(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms

E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms

```

```
Mar 11 18:54:27 wideload usb 3-1: new full speed USB device using uhci_hcd and address 2

Mar 11 18:54:27 wideload ub(3.2): GetMaxLUN returned 0, using 1 LUNs

Mar 11 18:54:37 wideload hald[8265]: Timed out waiting for hotplug event 1093. Rebasing to 1095

Mar 11 18:54:39 wideload uba: uba1

Mar 11 18:54:45 wideload fstab-sync[25231]: added mount point /media/usbdisk for /dev/uba1

```

I tried rmmoding uhci_hcd, but on my system it doesn't recognize anything then because the bridge uses that driver.  Rmmoding ehci_hcd had no effect.

It seems like there is a bug in uhci_hcd for this chipset, maybe?  I say that because same kernel and everything and same camera in another computer works fine...

Btw, why does this computer get uba1 and the other one get sde1?

----------

## BigBaaadBob

 *BigBaaadBob wrote:*   

> Btw, why does this computer get uba1 and the other one get sde1?

 

Anyone?

----------

## BigBaaadBob

Now I can't even get the disk to mount, after a major update.  Using kernel:2.6.16-gentoo-r6.

```
May  9 02:56:47 wideload usb 5-5: new high speed USB device using ehci_hcd and address 2

May  9 02:56:47 wideload usb 5-5: configuration #1 chosen from 1 choice

May  9 02:56:48 wideload ub(5.2): GetMaxLUN returned 0, using 1 LUNs

May  9 02:56:48 wideload uba: uba1

May  9 02:56:48 wideload usbcore: registered new driver ub

May  9 02:56:48 wideload SCSI subsystem initialized

May  9 02:56:48 wideload Initializing USB Mass Storage driver...

May  9 02:56:48 wideload usbcore: registered new driver usb-storage

May  9 02:56:48 wideload USB Mass Storage support registered.
```

But gnome-volume-manager can't mount it because it says uba1 isn't in fstab/mtab.  Huh?  Do I have the kernel misconfigured?

----------

## troymc

You probably have the Low Performance USB driver in your new kernel. 

```

Device Drivers ---> 

    Block Devices ---> 

        < > Low Performance USB Block driver 

```

That's also why the devices are now showing up as /dev/ubx instead of /dev/sdax. 

troymc

----------

## SDark

 *BigBaaadBob wrote:*   

> Now I can't even get the disk to mount, after a major update.  Using kernel:2.6.16-gentoo-r6.
> 
> ```
> May  9 02:56:47 wideload usb 5-5: new high speed USB device using ehci_hcd and address 2
> 
> ...

 

Probably your fstab points to /dev/ubX which doesn't exist anymore. Check your /dev/ for sdX and see if that solves your problem.

PS: The info troymc gave is very helpful I had similar problems with a usb pen, showing up as /dev/uba1 and getting slower speeds.

----------

## BigBaaadBob

Yes, it turns out that disabling the CONFIG_BLK_DEV_UB option fixed the UBA thing.  (The help for that option should have clued me in!).  But I still can't get it to automount.  Now I get:

```
May  9 05:34:55 wideload usb 5-1: new high speed USB device using ehci_hcd and address 5

May  9 05:34:55 wideload usb 5-1: configuration #1 chosen from 1 choice

May  9 05:34:55 wideload scsi3 : SCSI emulation for USB Mass Storage devices

May  9 05:34:55 wideload usb-storage: device found at 5

May  9 05:34:55 wideload usb-storage: waiting for device to settle before scanning

May  9 05:35:00 wideload Vendor: Generic   Model: STORAGE DEVICE    Rev: 1033

May  9 05:35:00 wideload Type:   Direct-Access                      ANSI SCSI revision: 00

May  9 05:35:01 wideload SCSI device sda: 512000 512-byte hdwr sectors (262 MB)

May  9 05:35:01 wideload sda: Write Protect is off

May  9 05:35:01 wideload sda: Mode Sense: 02 00 00 00

May  9 05:35:01 wideload sda: assuming drive cache: write through

May  9 05:35:01 wideload SCSI device sda: 512000 512-byte hdwr sectors (262 MB)

May  9 05:35:01 wideload sda: Write Protect is off

May  9 05:35:01 wideload sda: Mode Sense: 02 00 00 00

May  9 05:35:01 wideload sda: assuming drive cache: write through

May  9 05:35:01 wideload sda: sda1

May  9 05:35:01 wideload sd 3:0:0:0: Attached scsi removable disk sda

May  9 05:35:01 wideload usb-storage: device scan complete

May  9 05:35:01 wideload scsi.agent[11479]: disk at /devices/pci0000:00/0000:00:1d.7/usb5/5-1/5-1:1.0/host3/target3:0:0/3:0:0\:0
```

But GVM doesn't automount, complaining about SDA1 not being in fstab/mtab.  What other debugging can I do?

```
manager.c/1877: Device added: /org/freedesktop/Hal/devices/usb_device_781_7104_202040612

manager.c/1877: Device added: /org/freedesktop/Hal/devices/usb_device_781_7104_202040612_if0

manager.c/1877: Device added: /org/freedesktop/Hal/devices/usb_device_781_7104_202040612_if0_scsi_host

manager.c/1877: Device added: /org/freedesktop/Hal/devices/usb_device_781_7104_202040612_if0_scsi_host_scsi_device_lun0

manager.c/1877: Device added: /org/freedesktop/Hal/devices/storage_model_STORAGE_DEVICE

manager.c/1696: not a mountable volume: /org/freedesktop/Hal/devices/storage_model_STORAGE_DEVICE

manager.c/1877: Device added: /org/freedesktop/Hal/devices/volume_part1_size_262127616

manager.c/1727: Changed: /dev/sda1

manager.c/1330: mounting /org/freedesktop/Hal/devices/volume_part1_size_262127616...

manager.c/753: executing command: mount /dev/sda1

mount: can't find /dev/sda1 in /etc/fstab or /etc/mtab

```

----------

## troymc

Show us your /etc/fstab file.

Do you not have an entry for sda1?

troymc

----------

## BigBaaadBob

 *troymc wrote:*   

> Do you not have an entry for sda1?

 

No, because GVM (gnome-volume-manager) is supposed to add it for me.

EDIT: DOH!!!  Never mind.  I just discovered that I need to be in the plugdev group for this to work..... It works now.

----------

## Axela

Somebody solved the problem?

I've an external 400gb hd connected with USB2.0

I get about 1MB/s with hdparm on that HD.

When I tranfer big files (about 600MB) I see a strange thing: after the first 50-100mb it stop for about 30-40 seconds (The kernel is in IOWait state) and then resume the trasfer of other 50-100mb and so on.

I don't see any error/warning in the kernel log during the transfer.

```
lspci -v|grep HCI

00:11.2 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 18) (prog-if 00 [UHCI])

00:11.3 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 18) (prog-if 00 [UHCI])

00:11.4 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 18) (prog-if 00 [UHCI])
```

```
T:  Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  2 Spd=12  MxCh= 0

D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1

P:  Vendor=04b4 ProdID=6830 Rev= 2.40

S:  Product=Cypress AT2LP      RC7

S:  SerialNumber=DEF10B56CE2E

C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=  2mA

I:  If#= 0 Alt= 0 #EPs= 3 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage

E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms

E:  Ad=86(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms

E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=12ms

```

```
usb 1-2: new full speed USB device using uhci_hcd and address 2

scsi0 : SCSI emulation for USB Mass Storage devices

usb-storage: device found at 2

usb-storage: waiting for device to settle before scanning

  Vendor: ST340083  Model: 2A                Rev: 0000

  Type:   Direct-Access                      ANSI SCSI revision: 00

SCSI device sda: 781422768 512-byte hdwr sectors (400088 MB)

sda: assuming drive cache: write through

SCSI device sda: 781422768 512-byte hdwr sectors (400088 MB)

sda: assuming drive cache: write through

 sda: sda1

sd 0:0:0:0: Attached scsi disk sda

usb-storage: device scan complete

```

----------

## linuxtuxhellsinki

 *Axela wrote:*   

> Somebody solved the problem?
> 
> I've an external 400gb hd connected with USB2.0
> 
> I get about 1MB/s with hdparm on that HD.

 

No, it seems like your drive is connected to USB1.1 bus, which has maxium speed about that 1MB/s   :Confused: 

----------

## firehawk

I had the same problem with only getting usb1 speeds on my usb2 drives and flash disk.

Fixed it by removing the sync option in my /etc/fstab file. It has something to do with the new kernel, not exactly sure from which kernel onwards. but pretty recent I would say. drjones69 did mention removing the sync option too. Try removing sync options al together instead on async?

Hope this helps

----------

## Axela

 *linuxtuxhellsinki wrote:*   

>  *Axela wrote:*   Somebody solved the problem?
> 
> I've an external 400gb hd connected with USB2.0
> 
> I get about 1MB/s with hdparm on that HD. 
> ...

 

Yes, I discovered it some minutes after posting the message.

I'll try to buy an UBS 2.0 hub  :Smile: 

----------

