# VERY slow USB flash drive write speed.. on 2 Gentoo systems

## MarcusXP

I've got one laptop and one desktop computer with Gentoo.

On my laptop I have Windows XP SP3 as well installed.

My USB flash drives - formatted FAT32 (I've got a bunch of them ranging from 4GB to 32GB) are INSANELY slow on Gentoo.. the speed is ranging from 50KB/sec up to 1MB/sec..

What is going on ???

I've read about FAT32 and sync problem.. I've tried mounting the USB with these commands:

mount /dev/sdd1 /mnt/local/USBFlash/ -o noauto,user,noatime,exec

mount /dev/sdd1 /mnt/local/USBFlash/ -o async

and there's no difference.

When I copy files with MC or Krusader, it behaves the same. It starts doing some kind of caching with 50-80MB/sec, and if the file is small it shows that transfer is complete. However if I unmount the drive, it will take a long time to unmount it..

If the file is larger (about 500MB and up), it will finish caching after few hundred megs, then the speed drops very fast, until a few hundred KB/sec... going up and down a bit.

I think the issue is this caching.. but I don't know who is doing it? How do I disable it?

I've had this problem since forever changed may kernels and other things in my systems.. but I was too lazy to open a topic here.. but now here I am.. I've had enough and I need to fix it  :Smile: 

BTW, the USBs are working fine in Windows .. several MB/sec write speed, up to 15MB/sec.. depending on which USB flash drive I'm using.

Anyone willing to help, please?

How the hell do I need to mount a USB flash drive to get decent speeds ???

I don't seem to have this problem with my WD Passport 500GB USB hard drive.. it is formatted NTFS, though.. and I use ntfs-3g to mount that.Last edited by MarcusXP on Sun Sep 27, 2009 3:54 am; edited 1 time in total

----------

## dmpogo

 *MarcusXP wrote:*   

> I've got one laptop and one desktop computer with Gentoo.
> 
> On my laptop I have Windows XP SP3 as well installed.
> 
> My USB flash drives - formatted FAT32 (I've got a bunch of them ranging from 4GB to 32GB) are INSANELY slow on Gentoo.. the speed is ranging from 50KB/sec up to 1MB/sec..
> ...

 

stick one of drives in and run 'usbview'  .   What device speed does it show ?

----------

## MarcusXP

It pops-up a window with my usb devices/controllers.

I located the USB flash drive and here's the info about it:

```
Flash Disk

Manufacturer: USB 2.0

Serial Number: ff14cd65082129

Speed: 480Mb/s (high)

USB Version:  2.00

Device Class: 00(>ifc )

Device Subclass: 00

Device Protocol: 00

Maximum Default Endpoint Size: 64

Number of Configurations: 1

Vendor Id: 1307

Product Id: 0163

Revision Number:  1.00

Config Number: 1

   Number of Interfaces: 1

   Attributes: 80

   MaxPower Needed:  80mA

   Interface Number: 0

      Name: usb-storage

      Alternate Number: 0

      Class: 08(stor.) 

      Sub Class: 06

      Protocol: 50

      Number of Endpoints: 3

         Endpoint Address: 01

         Direction: out

         Attribute: 2

         Type: Bulk

         Max Packet Size: 512

         Interval: 125us

         Endpoint Address: 82

         Direction: in

         Attribute: 2

         Type: Bulk

         Max Packet Size: 512

         Interval: 0ms

         Endpoint Address: 83

         Direction: in

         Attribute: 3

         Type: Int.

         Max Packet Size: 64

         Interval: 16ms
```

----------

## MarcusXP

I just need to know the correct mount command for USB flash drives formatted with FAT32... if there is a correct command.

This is driving me crazy...

----------

## strummer

I have the same problem.. I'm copying music (~2GB) to a flash  drive.. Earlier it took 3-5 minutes, now 25-30.

----------

## MarcusXP

Anyone else having this problem?

I don't think we're the only ones.. we are nubs and we don't know how to configure it probably..

I'll try formatting the USB flash drives to NTFS.. maybe it will make a difference..

----------

## coptang

I'm having EXACTLY this problem. Word for word as you describe it in your first post. Burst of activity at the start then down to kb/s for the rest of the transfer. CPU usage spikes to 100% while this is occurring but seems to be single threaded as it jumps around the cores. Makes no difference whether I use nautilus, konqueror or cp. 

I've upgraded my box to a core i7 (not just to try to fix this ;-p), upgraded kernels, been through the gentoo usb guide to ensure that all I need is compiled in. 

usbview shows:

```
U3 Cruzer Micro

Manufacturer: SanDisk

Serial Number: 1740031B8442FC92

Speed: 480Mb/s (high)

USB Version:  2.00

Device Class: 00(>ifc )

Device Subclass: 00

Device Protocol: 00

Maximum Default Endpoint Size: 64

Number of Configurations: 1

Vendor Id: 0781

Product Id: 5406

Revision Number:  2.00

Config Number: 1

   Number of Interfaces: 1

   Attributes: 80

   MaxPower Needed: 200mA

   Interface Number: 0

      Name: usb-storage

      Alternate Number: 0

      Class: 08(stor.) 

      Sub Class: 06

      Protocol: 50

      Number of Endpoints: 2

         Endpoint Address: 81

         Direction: in

         Attribute: 2

         Type: Bulk

         Max Packet Size: 512

         Interval: 0ms

         Endpoint Address: 02

         Direction: out

         Attribute: 2

         Type: Bulk

         Max Packet Size: 512

         Interval: 0ms
```

lsusb:

```
Bus 002 Device 001: ID 1d6b:0002

Bus 008 Device 001: ID 1d6b:0001

Bus 007 Device 001: ID 1d6b:0001

Bus 006 Device 002: ID 045e:0040 Microsoft Corp. Wheel Mouse Optical

Bus 006 Device 001: ID 1d6b:0001

Bus 005 Device 001: ID 1d6b:0001

Bus 001 Device 003: ID 0781:5406 SanDisk Corp. Cruzer Micro 4GB Flash Drive

Bus 001 Device 001: ID 1d6b:0002

Bus 004 Device 001: ID 1d6b:0001

Bus 003 Device 001: ID 1d6b:0001
```

Happy to provide any info at all that may help to pin this down because it's been affecting me for a while as well.

----------

## Raptor85

Are any errors showing up in dmesg? I have a few of the 8 gig versions of that card (cruiser micro) and they don't seem to have this issue.  All of mine are ext3 though to keep file permissions, maybe try re-formatting one to ext3 just to see if it helps (even if you don't intend to keep it that way)

----------

## MarcusXP

I will try your suggestion (formatting to ext3).

For now, I've formatted a Kingston DataTraveler 150 32GB to NTFS.

I copied using Krusader and it's doing almost same thing.. with some differences:

1. caching with 50-70MB/sec for about 500-600MB and then the speed drops to about 15-17MB/sec (btw, looks the write speed of this flash drive is really good, I get similar speeds in Windows, about 12-15MB/sec, too)

2. after 10-20 seconds after it stabilized around 16MB/sec, the write process stops unexpectedly. the drive gets moved to a different letter! for example from /dev/sde1 it will become /dev/sdf1 !

If I mount again /dev/sdf1 and I do the same thing all over again, I get same results. but this time, the flash drive will be seen as /dev/sde1 again.

Looks like the USB speed is too fast for it or something ?!

The drive is mounted using ntfs-3g:

```
 ntfs-3g /dev/sde1 /mnt/local/USBflash
```

ntfs-3g version installed is latest available at this time:

```
Marcus ~ # emerge -av ntfs3g

WARNING: One or more repositories have missing repo_name entries:

        /usr/local/portage/profiles/repo_name

NOTE: Each repo_name entry should be a plain text file containing a

unique name for the repository on the first line.

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild   R   ] sys-fs/ntfs3g-2009.4.4
```

I tried mounting with this command:

```
 ntfs-3g /dev/sde1 /mnt/local/USBflash -o async
```

but now I get worst results.. caching is being done as usual, and then the speeds drops further to about 1MB-4MB/sec, going up and down.. sometimes even less than 1MB/sec.. looks like it's killing the partition table?! so I stopped it pretty fast..

I also tried mounting with ntfs write support from kernel.. but I can't write there, as I don't have permissions of some kind, even if I'm root..

here, I show that /dev/sde1 is mounted with (rw) permissions, but  then I cannot create a folder there.. why?

 *Quote:*   

> 
> 
> Marcus CD1 # mount /dev/sde1 /mnt/local/USBFlash/
> 
> Marcus CD1 # mount | grep USB
> ...

 

Any ideas, guys? How can we make a USB flash drive to work decently on Gentoo?

I can't tell you how annoying this is.. I am trying really hard to stop using Windows, but it seems that some things are easier in Windows, and just work..

----------

## MarcusXP

some of the last lines from result of dmesg:

```
 sdd: sdd1                                                                                                                                              

sd 7:0:0:0: [sdd] Assuming drive cache: write through                                                                                                   

sd 7:0:0:0: [sdd] Attached SCSI disk                                                                                                                    

usb 1-7: new high speed USB device using ehci_hcd and address 8                                                                                         

usb 1-7: New USB device found, idVendor=0951, idProduct=1621                                                                                            

usb 1-7: New USB device strings: Mfr=1, Product=2, SerialNumber=3                                                                                       

usb 1-7: Product: DataTraveler 150                                                                                                                      

usb 1-7: Manufacturer: Kingston                                                                                                                         

usb 1-7: SerialNumber: 0018F3D97D185B8C121400D0                                                                                                         

usb 1-7: configuration #1 chosen from 1 choice                                                                                                          

scsi8 : SCSI emulation for USB Mass Storage devices                                                                                                     

usb-storage: device found at 8                                                                                                                          

usb-storage: waiting for device to settle before scanning                                                                                               

scsi 8:0:0:0: Direct-Access     Kingston DataTraveler 150 PMAP PQ: 0 ANSI: 0 CCS                                                                        

sd 8:0:0:0: Attached scsi generic sg20 type 0                                                                                                           

sd 8:0:0:0: [sde] 63037440 512-byte logical blocks: (32.2 GB/30.0 GiB)                                                                                  

sd 8:0:0:0: [sde] Write Protect is off                                                                                                                  

sd 8:0:0:0: [sde] Mode Sense: 23 00 00 00                                                                                                               

sd 8:0:0:0: [sde] Assuming drive cache: write through                                                                                                   

usb-storage: device scan complete                                                                                                                       

sd 8:0:0:0: [sde] Assuming drive cache: write through                                                                                                   

 sde: sde1                                                                                                                                              

sd 8:0:0:0: [sde] Assuming drive cache: write through                                                                                                   

sd 8:0:0:0: [sde] Attached SCSI removable disk                                                                                                          

usb 1-7: USB disconnect, address 8                                                                                                                      

sd 8:0:0:0: [sde] Unhandled error code                                                                                                                  

sd 8:0:0:0: [sde] Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK                                                                                       

end_request: I/O error, dev sde, sector 15784000                                                                                                        

__ratelimit: 22 callbacks suppressed                                                                                                                    

Buffer I/O error on device sde1, logical block 1971992                                                                                                  

lost page write due to I/O error on sde1                                                                                                                

Buffer I/O error on device sde1, logical block 1971993                                                                                                  

lost page write due to I/O error on sde1                                                                                                                

Buffer I/O error on device sde1, logical block 1971994                                                                                                  

lost page write due to I/O error on sde1                                                                                                                

Buffer I/O error on device sde1, logical block 1971995                                                                                                  

lost page write due to I/O error on sde1                                                                                                                

Buffer I/O error on device sde1, logical block 1971996                                                                                                  

lost page write due to I/O error on sde1                                                                                                                

Buffer I/O error on device sde1, logical block 1971997                                                                                                  

lost page write due to I/O error on sde1                                                                                                                

Buffer I/O error on device sde1, logical block 1971998                                                                                                  

lost page write due to I/O error on sde1                                                                                                                

Buffer I/O error on device sde1, logical block 1971999                                                                                                  

lost page write due to I/O error on sde1                                                                                                                

Buffer I/O error on device sde1, logical block 1972000                                                                                                  

lost page write due to I/O error on sde1                                                                                                                

Buffer I/O error on device sde1, logical block 1972001                                                                                                  

lost page write due to I/O error on sde1                                                                                                                

sd 8:0:0:0: [sde] Unhandled error code                                                                                                                  

sd 8:0:0:0: [sde] Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK                                                                                  

end_request: I/O error, dev sde, sector 15784240                                                                                                        

usb 1-7: new high speed USB device using ehci_hcd and address 9                                                                                         

usb 1-7: New USB device found, idVendor=0951, idProduct=1621                                                                                            

usb 1-7: New USB device strings: Mfr=1, Product=2, SerialNumber=3                                                                                       

usb 1-7: Product: DataTraveler 150                                                                                                                      

usb 1-7: Manufacturer: Kingston                                                                                                                         

usb 1-7: SerialNumber: 0018F3D97D185B8C121400D0                                                                                                         

usb 1-7: configuration #1 chosen from 1 choice

scsi9 : SCSI emulation for USB Mass Storage devices

usb-storage: device found at 9

usb-storage: waiting for device to settle before scanning

scsi 9:0:0:0: Direct-Access     Kingston DataTraveler 150 PMAP PQ: 0 ANSI: 0 CCS

sd 9:0:0:0: Attached scsi generic sg20 type 0

usb-storage: device scan complete

sd 9:0:0:0: [sdf] 63037440 512-byte logical blocks: (32.2 GB/30.0 GiB)

sd 9:0:0:0: [sdf] Write Protect is off

sd 9:0:0:0: [sdf] Mode Sense: 23 00 00 00

sd 9:0:0:0: [sdf] Assuming drive cache: write through

sd 9:0:0:0: [sdf] Assuming drive cache: write through

 sdf: sdf1

sd 9:0:0:0: [sdf] Assuming drive cache: write through

sd 9:0:0:0: [sdf] Attached SCSI removable disk

usb 1-7: USB disconnect, address 9

sd 9:0:0:0: [sdf] Unhandled error code

sd 9:0:0:0: [sdf] Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK

end_request: I/O error, dev sdf, sector 15493760

__ratelimit: 50 callbacks suppressed

Buffer I/O error on device sdf1, logical block 1935712

lost page write due to I/O error on sdf1

Buffer I/O error on device sdf1, logical block 1935713

lost page write due to I/O error on sdf1

Buffer I/O error on device sdf1, logical block 1935714

lost page write due to I/O error on sdf1

Buffer I/O error on device sdf1, logical block 1935715

lost page write due to I/O error on sdf1

Buffer I/O error on device sdf1, logical block 1935716

lost page write due to I/O error on sdf1

Buffer I/O error on device sdf1, logical block 1935717

lost page write due to I/O error on sdf1

Buffer I/O error on device sdf1, logical block 1935718

lost page write due to I/O error on sdf1

Buffer I/O error on device sdf1, logical block 1935719

lost page write due to I/O error on sdf1

Buffer I/O error on device sdf1, logical block 1935720

lost page write due to I/O error on sdf1

Buffer I/O error on device sdf1, logical block 1935721

lost page write due to I/O error on sdf1

sd 9:0:0:0: [sdf] Unhandled error code

sd 9:0:0:0: [sdf] Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK

end_request: I/O error, dev sdf, sector 15494000

usb 1-7: new high speed USB device using ehci_hcd and address 10

usb 1-7: New USB device found, idVendor=0951, idProduct=1621

usb 1-7: New USB device strings: Mfr=1, Product=2, SerialNumber=3

usb 1-7: Product: DataTraveler 150

usb 1-7: Manufacturer: Kingston

usb 1-7: SerialNumber: 0018F3D97D185B8C121400D0

usb 1-7: configuration #1 chosen from 1 choice

scsi10 : SCSI emulation for USB Mass Storage devices

usb-storage: device found at 10

usb-storage: waiting for device to settle before scanning

scsi 10:0:0:0: Direct-Access     Kingston DataTraveler 150 PMAP PQ: 0 ANSI: 0 CCS

sd 10:0:0:0: Attached scsi generic sg20 type 0

sd 10:0:0:0: [sde] 63037440 512-byte logical blocks: (32.2 GB/30.0 GiB)

sd 10:0:0:0: [sde] Write Protect is off

sd 10:0:0:0: [sde] Mode Sense: 23 00 00 00

sd 10:0:0:0: [sde] Assuming drive cache: write through

usb-storage: device scan complete

sd 10:0:0:0: [sde] Assuming drive cache: write through

 sde: sde1

sd 10:0:0:0: [sde] Assuming drive cache: write through

sd 10:0:0:0: [sde] Attached SCSI removable disk

NTFS volume version 3.1.

NTFS volume version 3.1.
```

----------

## MarcusXP

 *Raptor85 wrote:*   

> Are any errors showing up in dmesg? I have a few of the 8 gig versions of that card (cruiser micro) and they don't seem to have this issue.  All of mine are ext3 though to keep file permissions, maybe try re-formatting one to ext3 just to see if it helps (even if you don't intend to keep it that way)

 

by any chance you can format one of your cruiser micro to NTFS or FAT32 and see if you get similar behavior like us?

I would think you should have same behavior, I have tried 3-4 USB flash drives already and similar results here.

One of them is Sandisk Cruzer micro 16GB, btw..

----------

## MarcusXP

Wow... I formatted that Kingston 32GB to ext3, and then I mounted, and the performance is HORRIBLE!

it started caching until about 580MB (with about 40-50MB/sec), and then the speed dropped dramatically, until less than 1MB/sec (few hundred KB/sec), and sometimes stalling (not even copying).

Is there a special option to mount a USB flash drive, even with ext3, so it will have a decent behavior?

----------

## NeddySeagoon

MarcusXP,

Please post your /proc/bus/usb/devices

Avoid Journelled filesystems on FLASH drives. Writes take much longer as metadata if written to the journal before its written for real. Thats two writes to update metadata.  It doesn't do the FLASH life any good either.

FAT ... or ext2 are OK.  NTFS, extX >2, rieserfs are bad.

----------

## MarcusXP

first I am showing the disk configuration:

```
Marcus CD1 # fdisk -l

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.

WARNING: The size of this disk is 7.5 TB (7489349222400 bytes).

DOS partition table format can not be used on drives for volumes

larger than (2199023255040 bytes) for 512-byte sectors. Use parted(1) and GUID

partition table format (GPT).

Disk /dev/sdb: 7489.3 GB, 7489349222400 bytes

255 heads, 63 sectors/track, 910528 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1               1      267350  2147483647+  ee  GPT

WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'! The util fdisk doesn't support GPT. Use GNU Parted.

WARNING: The size of this disk is 6.0 TB (5997921828864 bytes).

DOS partition table format can not be used on drives for volumes

larger than (2199023255040 bytes) for 512-byte sectors. Use parted(1) and GUID

partition table format (GPT).

Disk /dev/sdc: 5997.9 GB, 5997921828864 bytes

255 heads, 63 sectors/track, 729205 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System

/dev/sdc1               1      267350  2147483647+  ee  GPT

Disk /dev/sda: 146.7 GB, 146695782400 bytes

255 heads, 63 sectors/track, 17834 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk identifier: 0xd20a0314

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          13      104391   83  Linux

/dev/sda2              14         274     2096482+  82  Linux swap / Solaris

/dev/sda3             275       17834   141050700   83  Linux

Disk /dev/sdd: 500.1 GB, 500107862016 bytes

255 heads, 63 sectors/track, 60801 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk identifier: 0xcfd784f6

   Device Boot      Start         End      Blocks   Id  System

/dev/sdd1               1       60801   488384001    7  HPFS/NTFS

Disk /dev/sde: 32.3 GB, 32275169280 bytes

255 heads, 63 sectors/track, 3923 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk identifier: 0x000acb7c

   Device Boot      Start         End      Blocks   Id  System

/dev/sde1               1        3923    31511466   83  Linux

```

/dev/sde is the 32GB Kingston USB flash

/dev/sdd is WD Passport 500GB USB

/dev/sda is HP 146GB 15k SAS drive

/dev/sdb and /dev/sdc just raid arrays for storage (on  Adaptec ICP5165BR contrller)

----------

## MarcusXP

and this is what you asked for:

```
Marcus CD1 # cat /proc/bus/usb/devices                        

T:  Bus=05 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2

B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0                   

D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1     

P:  Vendor=1d6b ProdID=0001 Rev= 2.06                            

S:  Manufacturer=Linux 2.6.31-gentoo uhci_hcd                    

S:  Product=UHCI Host Controller                                 

S:  SerialNumber=0000:00:1d.3                                    

C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA                           

I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

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

T:  Bus=05 Lev=01 Prnt=01 Port=00 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=0951 ProdID=1621 Rev= 1.10                            

S:  Manufacturer=Kingston                                        

S:  Product=DataTraveler 150                                     

S:  SerialNumber=0018F3D97D185B8C121400D0                        

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

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

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

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

T:  Bus=04 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2

B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0                   

D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1     

P:  Vendor=1d6b ProdID=0001 Rev= 2.06                            

S:  Manufacturer=Linux 2.6.31-gentoo uhci_hcd                    

S:  Product=UHCI Host Controller                                 

S:  SerialNumber=0000:00:1d.2                                    

C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA                           

I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

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

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

B:  Alloc= 92/900 us (10%), #Int=  7, #Iso=  0                   

D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1     

P:  Vendor=1d6b ProdID=0001 Rev= 2.06                            

S:  Manufacturer=Linux 2.6.31-gentoo uhci_hcd                    

S:  Product=UHCI Host Controller                                 

S:  SerialNumber=0000:00:1d.1                                    

C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA                           

I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

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

T:  Bus=03 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  8 Spd=12  MxCh= 4

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

P:  Vendor=058f ProdID=9254 Rev= 3.12                            

S:  Manufacturer=ALCOR                                           

S:  Product=Generic USB Hub                                      

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

I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=255ms                    

T:  Bus=03 Lev=02 Prnt=08 Port=00 Cnt=01 Dev#=  9 Spd=12  MxCh= 4

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

P:  Vendor=046d ProdID=c223 Rev= 1.03                            

S:  Manufacturer=Logitech                                        

S:  Product=Logitech G15 Keyboard                                

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

I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=255ms                    

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

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

P:  Vendor=046d ProdID=c221 Rev= 1.70                            

S:  Manufacturer=Logitech                                        

S:  Product=Logitech Gaming Keyboard                             

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

I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=01 Driver=usbhid

E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=10ms                        

I:* If#= 1 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid

E:  Ad=82(I) Atr=03(Int.) MxPS=   8 Ivl=10ms                        

T:  Bus=03 Lev=03 Prnt=09 Port=03 Cnt=02 Dev#= 13 Spd=12  MxCh= 0

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

P:  Vendor=046d ProdID=c222 Rev= 1.03

S:  Manufacturer=G15 Keyboard

S:  Product=G15 Keyboard

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

I:* If#= 0 Alt= 0 #EPs= 2 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid

E:  Ad=81(I) Atr=03(Int.) MxPS=  32 Ivl=1ms

E:  Ad=02(O) Atr=03(Int.) MxPS=  32 Ivl=1ms

T:  Bus=03 Lev=02 Prnt=08 Port=01 Cnt=02 Dev#= 10 Spd=12  MxCh= 0

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

P:  Vendor=046d ProdID=c041 Rev=46.00

S:  Manufacturer=Logitech

S:  Product=USB Gaming Mouse

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

I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=usbhid

E:  Ad=81(I) Atr=03(Int.) MxPS=  10 Ivl=1ms

I:* If#= 1 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid

E:  Ad=82(I) Atr=03(Int.) MxPS=  20 Ivl=10ms

T:  Bus=03 Lev=02 Prnt=08 Port=02 Cnt=03 Dev#= 11 Spd=1.5 MxCh= 0

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

P:  Vendor=10d5 ProdID=000d Rev= 1.00

S:  Manufacturer=No brand

S:  Product=SP02-A1

S:  SerialNumber=0Â

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

I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid

E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=16ms

I:* If#= 1 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=(none)

E:  Ad=02(O) Atr=03(Int.) MxPS=   8 Ivl=16ms

T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2

B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0

D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1

P:  Vendor=1d6b ProdID=0001 Rev= 2.06

S:  Manufacturer=Linux 2.6.31-gentoo uhci_hcd

S:  Product=UHCI Host Controller

S:  SerialNumber=0000:00:1d.0

C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA

I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

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

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480 MxCh= 8

B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0

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

P:  Vendor=1d6b ProdID=0002 Rev= 2.06

S:  Manufacturer=Linux 2.6.31-gentoo ehci_hcd

S:  Product=EHCI Host Controller

S:  SerialNumber=0000:00:1d.7

C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA

I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

T:  Bus=01 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#=  7 Spd=480 MxCh= 0

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

P:  Vendor=1058 ProdID=0705 Rev= 1.75

S:  Manufacturer=Western Digital

S:  Product=External HDD

S:  SerialNumber=57442D57584E583038535543333639

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

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

E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

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

I:* If#= 1 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid

E:  Ad=83(I) Atr=03(Int.) MxPS=  64 Ivl=4ms
```

----------

## NeddySeagoon

MarcusXP,

Your DataTraveller USB FLASH is on a UHCI Port which can do 12 Mbit/sec tops. Its a USB1 device too.  If you get a data transfer speed of 1MB/sec, you will be doing well.

Your external HDD is USB2 on your only USB2 root hub.

Do you mount these devices with or without the sync option?

sync is much slower but safer.

----------

## dmpogo

 *NeddySeagoon wrote:*   

> MarcusXP,
> 
> Your DataTraveller USB FLASH is on a UHCI Port which can do 12 Mbit/sec tops. Its a USB1 device too.  If you get a data transfer speed of 1MB/sec, you will be doing well.
> 
> Your external HDD is USB2 on your only USB2 root hub.
> ...

 

I wonder if this is a story of ehci driver that must be loaded before uhci  one (which gentoo boot scripts warn about, but do it wrongly). In the other case uhci driver supposedly may grab

the shared port first and not release it even when USB 2.0 device is plugged in.

For experiment, I would compile ehci and uhci as modules, and remove uhci, leaving just ehci to see what happens.

----------

## dmpogo

 *NeddySeagoon wrote:*   

> MarcusXP,
> 
> Your DataTraveller USB FLASH is on a UHCI Port which can do 12 Mbit/sec tops. Its a USB1 device too.  If you get a data transfer speed of 1MB/sec, you will be doing well.
> 
> Your external HDD is USB2 on your only USB2 root hub.
> ...

 

I am confused how cat /proc/bus/usb/devices output is related to

usb 1-7: new high speed USB device using ehci_hcd and address 8                                                                                         

usb 1-7: New USB device found, idVendor=0951, idProduct=1621                                                                                           

usb 1-7: New USB device strings: Mfr=1, Product=2, SerialNumber=3                                                                                       

usb 1-7: Product: DataTraveler 150                                                                                                                     

usb 1-7: Manufacturer: Kingston                                                                                                                         

usb 1-7: SerialNumber: 0018F3D97D185B8C121400D0                                                                                                         

usb 1-7: configuration #1 chosen from 1 choice       

in dmesg

----------

## NeddySeagoon

dmpogo,

Put the /proc/bus/usb/devices code block into a file and point usbview at the file.

It shows the usb tree.

The first two entries, in the raw, are the data traveller and the root hub its attached to.

Bus=05 Lev=00 and Bus=05 Lev=01

```
T:  Bus=05 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2

B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0                   

D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1     

P:  Vendor=1d6b ProdID=0001 Rev= 2.06                           

S:  Manufacturer=Linux 2.6.31-gentoo uhci_hcd                   

S:  Product=UHCI Host Controller                                 

S:  SerialNumber=0000:00:1d.3                                   

C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA                           

I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

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

T:  Bus=05 Lev=01 Prnt=01 Port=00 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=0951 ProdID=1621 Rev= 1.10                           

S:  Manufacturer=Kingston                                       

S:  Product=DataTraveler 150                                     

S:  SerialNumber=0018F3D97D185B8C121400D0                       

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

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

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

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

Show that the data traveller is a USB 2 device on a USB 1 hub, so it only gets USB1 speeds.

USB view does not show that conflict.

----------

## dmpogo

NeddySeagon

Yes, but dmesg was showing that Data Traveller is on usb1-7 that uses ehci_hcd ?  And produces lots of errors ?

----------

## MarcusXP

In the same USB port I put my WD Passport 500GB, and I mounted with:

```
ntfs-3g /dev/sdf1 /mnt/local/Passport
```

I started copying 4.4GB (using Krusader), and it did some kind of caching (with 50-60MB/sec) until like 600-700MB, and then the speed dropped pretty fast until 4-6MB/sec...going up and down between 4MB/sec and 6MB/sec..

Obviously, it is not USB1.1... it cannot go faster than 1.2MB/sec or so, on USB1.1, so it is USB2.0...

So why it gos that slow at writing?! I thought my USB hard drive doesn't have the same problem like my USB flash drives, but actually it looks like it does..

Can anyone test on his computer a similar scenario:

writing 5-10GB of data (consisting in larger files, 700MB+) using Krusader, and see how the writing speed evolves over time?

I would really appreciate your input.. at least I would know if my systems are configured wrongly or it's something else (like a bug in the kernel or something)

----------

## MarcusXP

I can test on my other(s) gentoo systems as well, but I doubt I will get different results, as they are configured pretty much the same as this one..

----------

## krinn

 *dmpogo wrote:*   

> 
> 
> For experiment, I would compile ehci and uhci as modules, and remove uhci, leaving just ehci to see what happens.

 

And you will not be able to boot  :Smile: 

Cannot boot from an usb device if the device have its driver load by module as ->boot->kernel->drivers->disk->udev->modules

so the usb disk woun't be found because disk test appears before udev is loaded and your usb modules will be load by udev...

----------

## MarcusXP

guys, I am not trying to boot from the USB devices, I just want to use them on my full working system (Gentoo is installed on a 146GB 15k SAS hard drive)

why on Earth I got these weird results/performance? it's gotta be some kind of configuration issue..

----------

## MarcusXP

Formatted my Kinsgton 32GB to ext2 and I got very similar results.. even of my laptop which is also running Gentoo.

However, on my laptop, the Passport 500GB USB hard drive is performing very good.. after the caching stage when speed is like 50-60MB/sec, the speed gets to about 20-22MB/sec, and really stable, I was able to copy over 50GB of data with that speed, which is good.. 

So why would my Passport perform so badly on my desktop (which is a quad core Xeon) - up to 5MB/sec, and perform better on my laptop, which is a Core2 Duo (it is a Thinkpad T61P)

And why the Kingston 32GB is performing so bad on both, with any filesystem formatted?  I also have Windows XP SP3 installed on my laptop and Kinston 32GB has like 10-15MB/sec write speed for such large files..in exactly the same USB port.

It has to be a reasonable explanation.. I have kernel 2.6.30-gentoo-r6 kernel on my laptop, and 2.6.31-gentoo kernel on my desktop.. would this make any difference?

----------

## MarcusXP

I can only draw one conclusion after all these tests.. USB support is SHITTY under linux.. maybe the kernel is the fault? (or the user has no clue about how to configure the system, lol)

----------

## MarcusXP

So guys.. whoever is reading this thread, PLEASE make some similar tests if you have a USB flash drive at home, and report your results.. I need to know if the problem is related to my configuration, or this problem is common to most of Linux (or only Gentoo) users?

----------

## doctork

Using gkrellm, I find on my AMD Phenom with a 2.6.30-gentoo-r5 kernel, I find that with this flash drive

```
Bus 003 Device 027: ID 0781:554f SanDisk Corp.

```

I get ~6 MByte/sec writes and ~25 MByte/sec reads.

With this flashdrive

```
Bus 003 Device 026: ID 0204:6025 Chipsbank Microelectronics Co., Ltd CBM2080 Flash drive controller              
```

I get ~3 MByte/sec writes and ~15 MByte/sec reads.

--

doc

----------

## dmpogo

So what happened if you unload uhci_hcd ?

----------

## doctork

 *dmpogo wrote:*   

> So what happened if you unload uhci_hcd ?

 

If you're asking me, 1) I'm running an amd base board using ohci_hcd and ehci_hcd not uhci_hcd, 2) the flash drives are connected through ehci_hcd, and 3) I'm not about to turn off ohci_hcd because my UPS is connected to that.  IMNHO, the original poster either has bad hardware or has screwed up his kernel configuration.  I doubt that there's anything inherenly wrong with Linux USB support.

--

doc

----------

## dmpogo

 *doctork wrote:*   

>  *dmpogo wrote:*   So what happened if you unload uhci_hcd ? 
> 
> If you're asking me, 1) I'm running an amd base board using ohci_hcd and ehci_hcd not uhci_hcd, 2) the flash drives are connected through ehci_hcd, and 3) I'm not about to turn off ohci_hcd because my UPS is connected to that.  IMNHO, the original poster either has bad hardware or has screwed up his kernel configuration.  I doubt that there's anything inherenly wrong with Linux USB support.
> 
> --
> ...

 

No, I was asking the person who asked the original question and we discussed ehci/uhci issue on the previous page of comments

----------

## mikkoc

I think this is the same as: https://bugs.launchpad.net/gvfs/+bug/197762?comments=all

----------

## NeddySeagoon

MarcusXP,

FLASH write speeds are limited by the FLASH chips used in the device.

You have clearly been moving things around between USB ports as your dmesg shows one arrangement of devices and your /proc/bus/usb/devices shows another. There is another speed limitation on USB storage - DMA cannot be used as USB does not support DMA.

Get usbview and use it to ensure your USB2 devices are all on EHCI ports and your USB1 devices are all on OHCI/UHCI ports.

Further, each root hub can only supply 500mA total for all connected devices. usbview will show you the power required by each device. Add them up and keep the total under 500mA.

Breaching any of these rules results in suboptimal USB performace.

----------

## krinn

 *MarcusXP wrote:*   

> So guys.. whoever is reading this thread, PLEASE make some similar tests if you have a USB flash drive at home, and report your results.. I need to know if the problem is related to my configuration, or this problem is common to most of Linux (or only Gentoo) users?

 

If all gentoo users are affected by it, you could expect to find in the forum the problem report many times. So it seems not (i didn't search, but i suppose you've done it before opening a new thread, don't you ?)

did you try to reproduce with gentoo livecd/dvd or with another distro (just to try with a kernel you didn't made)

----------

## doctork

 *NeddySeagoon wrote:*   

> MarcusXP,
> 
> [...]
> 
> Get usbview and use it to ensure your USB2 devices are all on EHCI ports and your USB1 devices are all on OHCI/UHCI ports.
> ...

 

On the system I'm currently messing with, the physical USB port I'm connected to does not determine whether EHCI or OHCI controls the device.  For example, with a USB 2.0 flash drive connected, the relevant sections of /proc/bus/usb/devices reads:

```
T:  Bus=03 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480 MxCh=10

B:  Alloc=  0/800 us ( 0%), #Int=  4, #Iso=  0

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

P:  Vendor=1d6b ProdID=0002 Rev= 2.06

S:  Manufacturer=Linux 2.6.30-gentoo-r6 ehci_hcd

S:  Product=EHCI Host Controller

S:  SerialNumber=0000:00:13.5

C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA

I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

T:  Bus=03 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 31 Spd=480 MxCh= 0

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

P:  Vendor=0781 ProdID=554f Rev= 2.00

S:  Manufacturer=Best Buy

S:  Product=Geek Squad

S:  SerialNumber=1101300EB9409EB1

C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=200mA

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

E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

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

Now, if I remove the flash drive in insert a mouse receiver in the SAME PHYSICAL PORT, I see:

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

B:  Alloc= 41/900 us ( 5%), #Int=  2, #Iso=  0

D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1

P:  Vendor=1d6b ProdID=0001 Rev= 2.06

S:  Manufacturer=Linux 2.6.30-gentoo-r6 ohci_hcd

S:  Product=OHCI Host Controller

S:  SerialNumber=0000:00:13.0

C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA

I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

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

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

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

P:  Vendor=046d ProdID=c526 Rev= 5.00

S:  Manufacturer=Logitech

S:  Product=USB Receiver

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

I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=usbhid

E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=1ms

I:* If#= 1 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid

E:  Ad=82(I) Atr=03(Int.) MxPS=  20 Ivl=1ms
```

Magic beyond my meager knowledge of electronics and USB drivers, but that's how it works on this system.

--

doc

----------

## MarcusXP

 *krinn wrote:*   

>  *MarcusXP wrote:*   So guys.. whoever is reading this thread, PLEASE make some similar tests if you have a USB flash drive at home, and report your results.. I need to know if the problem is related to my configuration, or this problem is common to most of Linux (or only Gentoo) users? 
> 
> If all gentoo users are affected by it, you could expect to find in the forum the problem report many times. So it seems not (i didn't search, but i suppose you've done it before opening a new thread, don't you ?)
> 
> did you try to reproduce with gentoo livecd/dvd or with another distro (just to try with a kernel you didn't made)

 

I did find some similar posts but none seem to describe my exact problem.

This one that mikkoc found seems to describe the same issue, but the majority of users there are using Ubuntu:

https://bugs.launchpad.net/gvfs/+bug/197762?comments=all

However, I have found this bug, which matches my problem pretty close:

https://bugs.gentoo.org/99039

They do not give an exact solution to the issue, they say "just change your fstab or the command you use to mount

the drive, and it will work just as fast as before." (the last post there is mine, btw..)

So my simple question is this: "What is the correct command to mount the USB flash drive, in order to mount it without sync option?"

If I will try that and it still doesn't fix the problem, then I should investigate it further, it's got to be some kind of configuration issue, right?

----------

## krinn

they infact told you the problem, some regression bug in the kernel. And you have the link to lkvm.

So the solution is simple, if it's fix, upgrade your kernel, if not yet fix, wait for an update kernel or use a kernel lower the version they report the bug appears.

----------

## MarcusXP

 *NeddySeagoon wrote:*   

> MarcusXP,
> 
> FLASH write speeds are limited by the FLASH chips used in the device.
> 
> You have clearly been moving things around between USB ports as your dmesg shows one arrangement of devices and your /proc/bus/usb/devices shows another. There is another speed limitation on USB storage - DMA cannot be used as USB does not support DMA.
> ...

 

I know that write speed is limited, but I clearly have an issue here, since the very same flash drive writes WAY faster on Windows - compare up to1MB/sec on Gentoo with 12-15MB/sec on Windows XP.

And when I performed the tests, I only had one device connected (not counting the USB mouse and keyboard, but that shouldn't count I think).

And it's not the USB port that is broken or limited to 1.1 speed, because I can read from the flash drive (or usb hard drive) with very good speeds, 20-30MB/sec (when they are inserted in the very same USB port).

So it seems most likely like the mount issue with "sync".. but I don't know which is the correct command to mount them, but looks like no one knows the answer  :Smile: 

So before starting debugging the issue, (with loading/unloading modules, etc), let's just mount these flash drives with the correct option (that would be without "sync") and let me perform some other tests to see what happens.

I attached a screenshot showing my USBView window here:

http://marcusxp.dyndns.org/USB_view.png

You can see that my Kinston DataTraveler 150 is showing under "EHCI" (as it should). 

The WD Passport hard drive was not connected at that time.

I took another screenshot after I connected the WD Passport hard drive (in another USB port), it is showing also under "EHCI".

http://marcusxp.dyndns.org/USB_view1.png

----------

## MarcusXP

 *krinn wrote:*   

> they infact told you the problem, some regression bug in the kernel. And you have the link to lkvm.
> 
> So the solution is simple, if it's fix, upgrade your kernel, if not yet fix, wait for an update kernel or use a kernel lower the version they report the bug appears.

 

The bug was reporting the problem in kernel 2.6.12-gentoo-r4

I am using 2.6.31-gentoo, do you think they didn't fix the issue until now?

```
Marcus ~ # uname -a

Linux Marcus 2.6.31-gentoo #1 SMP Thu Sep 10 22:20:05 EDT 2009 x86_64 Intel(R) Xeon(R) CPU L5420 @ 2.50GHz GenuineIntel GNU/Linux
```

And if the bug still exists, why other users (that use 2.6.31) are not complaining?

----------

## krinn

 *https://bugs.gentoo.org/99039 wrote:*   

> I am have USB Flash drive (size is 1Gb, filesystem VFAT). Kernel detects it as:
> 
>   Vendor: Kingston  Model: DataTraveler II+  Rev: 1.13
> 
> 

 

 *MarcusXP wrote:*   

> For now, I've formatted a Kingston DataTraveler 150 32GB to NTFS. 

 

-> might not be related, but as my flash drive works nice and that bug "seems" to affect few users, i suppose it's not good publicity for kingston datatraveler series...

----------

## MarcusXP

I have an interesting update..

my laptop is using 2.6.30-gentoo-r6:

```
T61p ~ # uname -a

Linux T61p 2.6.30-gentoo-r6 #2 SMP Thu Sep 17 23:06:58 EDT 2009 x86_64 Intel(R) Core(TM)2 Duo CPU T9300 @ 2.50GHz GenuineIntel GNU/Linux
```

I am currently copying some large files on my WD Passport with 20-22MB/sec (sustained), using Krusader.

I tested same hard drive on my other computer (also having 2.6.31, as the first one) to see what my results are..

I have found that it is copying with 28-30MB/sec (sustained!)

```
Server / # uname -a

Linux Server 2.6.31-gentoo #2 SMP Thu Sep 17 20:12:16 EDT 2009 x86_64 Genuine Intel(R) CPU @ 2.50GHz GenuineIntel GNU/Linux
```

So only my first computer (that I am actually using the most) has this issue.. but I haven't tested my USB flash drives yet, only the WD Passport hard drive.

I am testing the Kingston flash drive and report soon my results.

----------

## MarcusXP

 *krinn wrote:*   

>  *https://bugs.gentoo.org/99039 wrote:*   I am have USB Flash drive (size is 1Gb, filesystem VFAT). Kernel detects it as:
> 
>   Vendor: Kingston  Model: DataTraveler II+  Rev: 1.13
> 
>  
> ...

 

No it's not related, as I also have one Sandisk Cruzer micro 16GB and a Sony 16GB and they have the same behavior  :Smile: 

and btw, the Kingston flash drive is WAY faster (at write speed) than the other ones (like double the speed) - on Windows, of course  :Very Happy: 

so I guess this is good publicity, they should give me a gift for that  :Wink: 

----------

## dmpogo

doctork

You are exactly right, on modern computers all the ports can function as either usb2 or usb1, depending on the device you insert.

----------

## dmpogo

MarcusXP

This thread is very frustrating to a side observer like me, since from two pages of comments it is still impossible to get a clear description what does not work where and what is the diagnistics when things break.  Could you please be a bit more systematic in describing your set up.

As the first step, could you unplug all other USB storage devices (you need your keyboard and mouse of course), take one USB stick, say Kingston 32GB, and report after clean reboot

1) Laptop in Gentoo     - report (sustained after caching) transfer rates,  dmesg, cat /proc/bus/usb/devices

2) Laptop in Windows   - report transfer rates

3) Desktop in Gentoo   - report (sustained after caching) transfer rates,  dmesg, cat /proc/bus/usb/devices

----------

## MarcusXP

 *dmpogo wrote:*   

> MarcusXP
> 
> This thread is very frustrating to a side observer like me, since from two pages of comments it is still impossible to get a clear description what does not work where and what is the diagnistics when things break.  Could you please be a bit more systematic in describing your set up.
> 
> As the first step, could you unplug all other USB storage devices (you need your keyboard and mouse of course), take one USB stick, say Kingston 32GB, and report after clean reboot
> ...

 

that's what I am doing right now.. I will have a report ready in a few minutes

----------

## MarcusXP

Notes: when the testing was performed, only one USB device is connected, other than my keyboard and mouse. Except laptop, where I use the builtin keyboard and touchpad, so no external mouse/keyboard.

Reading from these devices is usually very good on all computers. About 15-20MB/sec and more (for the Passport hard drive, I get 32-34MB/sec sustained, which is really good, I think better than reading speed on Windows)

Testing results for Kingston DataTraveler 150 32GB

Scenario 1 - formatted as ext2 (mounted with command: mount /dev/sdd1 /mnt/local/USBflash)

a. on my laptop the copy started as usual, doing some cache and then the speed dropped to few KB/sec (5KB-10KB/sec). this is VERY bad, unacceptable

b. on my server - similar result

c. on my desktop - similar result

Scenario 2 - formatted as NTFS (mounted with command: ntfs-3g /dev/sdd1 /mnt/local/USBflash)

a. on my laptop the copy started  as usual, doing some cache and then the speed dropped to 10-14MB/sec and remained stable within these limits. looks like the normal behavior

b. on my server the copy started  as usual, doing some cache and then the speed dropped to 10-14MB/sec and remained stable within these limits. looks like the normal behavior

c. on my desktop the copy started  as usual, doing some cache and then the speed dropped to 6MB/sec, and then to 5MB/sec and kept going down slowly. I stopped it, as it doesn't seem like the good behavior.

Scenario 3 - formatted as FAT32 (mounted with command: mount /dev/sdd1 /mnt/local/USBflash)

a. on my laptop the copy started  as usual, doing some cache and then the speed dropped to 1-4MB/sec and sometimes to few hundred KB/sec. BAD behavior

b. on my server the copy started  as usual, doing some cache and then the speed dropped to 1-4MB/sec and sometimes to few hundred KB/sec. BAD behavior

c. on my desktop the copy started  as usual, doing some cache and then the speed dropped to 1-4MB/sec and sometimes to few hundred KB/sec. BAD behavior

Testing results for my WD 500GB Passport hard drive.

Formatted as NTFS, I have no plans in messing with this one as I have lots of data on it (mounted with command: ntfs-3g /dev/sdd1 /mnt/local/USBflash)

a. on my laptop the copy started  as usual, doing some cache and then the speed stabilized around 20-22MB/sec. looks like the normal behavior

The relevant part of "cat /proc/bus/usb/devices"

```
T:  Bus=01 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#= 11 Spd=480 MxCh= 0

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

P:  Vendor=1058 ProdID=0705 Rev= 1.75

S:  Manufacturer=Western Digital

S:  Product=External HDD

S:  SerialNumber=57442D57584E583038535543333639

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

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

E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

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

I:* If#= 1 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid

E:  Ad=83(I) Atr=03(Int.) MxPS=  64 Ivl=4ms
```

b. on my server the copy started  as usual, doing some cache and then the speed stabilized around 25-28MB/sec. looks like the normal behavior

The relevant part of "cat /proc/bus/usb/devices"

```
T:  Bus=01 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#=  6 Spd=480 MxCh= 0

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

P:  Vendor=1058 ProdID=0705 Rev= 1.75

S:  Manufacturer=Western Digital

S:  Product=External HDD

S:  SerialNumber=57442D57584E583038535543333639

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

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

E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

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

I:* If#= 1 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid

E:  Ad=83(I) Atr=03(Int.) MxPS=  64 Ivl=4ms
```

c. on my desktop the copy started  as usual, doing some cache and then the speed seem to stabilize around 20-25MB/sec. However, after copying about 3GB (out of a file of 4.4GB size) the speed dropped to 1-5MB/sec, sometimes a bit more. looks like a BAD behavior.

Test1: hdd is plugged in one USB port from behind of the computer (straight on the motherboard)

The relevant part of "cat /proc/bus/usb/devices"

```
T:  Bus=01 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#=  6 Spd=480 MxCh= 0

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

P:  Vendor=1058 ProdID=0705 Rev= 1.75

S:  Manufacturer=Western Digital

S:  Product=External HDD

S:  SerialNumber=57442D57584E583038535543333639

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

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

E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

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

I:* If#= 1 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid

E:  Ad=83(I) Atr=03(Int.) MxPS=  64 Ivl=4ms
```

The relevant part of "dmesg". Before these messages are the other messages with Kingston flash drive and so on.

```
usb 1-3: new high speed USB device using ehci_hcd and address 6

usb 1-3: New USB device found, idVendor=1058, idProduct=0705

usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3

usb 1-3: Product: External HDD

usb 1-3: Manufacturer: Western Digital

usb 1-3: SerialNumber: 57442D57584E583038535543333639

usb 1-3: configuration #1 chosen from 1 choice

scsi6 : SCSI emulation for USB Mass Storage devices

usb-storage: device found at 6

usb-storage: waiting for device to settle before scanning

input: Western Digital  External HDD     as /class/input/input8

generic-usb 0003:1058:0705.0008: input: USB HID v1.10 Device [Western Digital  External HDD    ] on usb-0000:00:1d.7-3/input1

scsi 6:0:0:0: Direct-Access     WD       5000BEV External 1.75 PQ: 0 ANSI: 4

sd 6:0:0:0: Attached scsi generic sg19 type 0

sd 6:0:0:0: [sdd] 976773168 512-byte logical blocks: (500 GB/465 GiB)

sd 6:0:0:0: [sdd] Write Protect is off

sd 6:0:0:0: [sdd] Mode Sense: 23 00 00 00

sd 6:0:0:0: [sdd] Assuming drive cache: write through

usb-storage: device scan complete

sd 6:0:0:0: [sdd] Assuming drive cache: write through

 sdd: sdd1

sd 6:0:0:0: [sdd] Assuming drive cache: write through

sd 6:0:0:0: [sdd] Attached SCSI disk
```

I repeated the test on my desktop computer, by plugging the hard drive to a different USB port, and the slowdown occurred after copying about 4GB out of 4.4GB from that big file.

The speed dropped to 1-2MB/sec, rarely going over 4-5MB/sec.

```
usb 1-8: new high speed USB device using ehci_hcd and address 7

usb 1-8: New USB device found, idVendor=1058, idProduct=0705

usb 1-8: New USB device strings: Mfr=1, Product=2, SerialNumber=3

usb 1-8: Product: External HDD

usb 1-8: Manufacturer: Western Digital

usb 1-8: SerialNumber: 57442D57584E583038535543333639

usb 1-8: configuration #1 chosen from 1 choice

scsi7 : SCSI emulation for USB Mass Storage devices

usb-storage: device found at 7

usb-storage: waiting for device to settle before scanning

input: Western Digital  External HDD     as /class/input/input9

generic-usb 0003:1058:0705.0009: input: USB HID v1.10 Device [Western Digital  External HDD    ] on usb-0000:00:1d.7-8/input1

scsi 7:0:0:0: Direct-Access     WD       5000BEV External 1.75 PQ: 0 ANSI: 4

sd 7:0:0:0: Attached scsi generic sg19 type 0

sd 7:0:0:0: [sdd] 976773168 512-byte logical blocks: (500 GB/465 GiB)

sd 7:0:0:0: [sdd] Write Protect is off

sd 7:0:0:0: [sdd] Mode Sense: 23 00 00 00

sd 7:0:0:0: [sdd] Assuming drive cache: write through

usb-storage: device scan complete

sd 7:0:0:0: [sdd] Assuming drive cache: write through

 sdd: sdd1

sd 7:0:0:0: [sdd] Assuming drive cache: write through

sd 7:0:0:0: [sdd] Attached SCSI disk
```

To be noted that the exact same file of 4.4GB size was used in all tests. The file sits on the desktop computer and the location was mounted using NFS on my laptop and my server.

They are connected using gigabit network and the connectivity has no issues (I can copy with 80-100MB/sec between all these computers).

----------

## MarcusXP

I don't care so much about the "slowdown" issue on my Passport hard drive, because it occurs after more than 3GB are copied.

However, I cannot use the USB flash drives unless they are formatted as NTFS.. and on my desktop computer not even this works properly..

To summarize:

A. There is a problem with USB Flash drives when they are formatted as ext2 or FAT32 on all computers. When formatted as NTFS, they work fine on two computers, but not on my desktop computer (that I use mostly)

B. There is a problem (slowdown after 3-4GB copied) with WD Passport when it is connected on my desktop computer, but I can live with that. However, this confirms that my desktop computer has some kind of configuration issue, because not even the USB Flash drives (formatted as NTFS) are working properly here

In order to fix A, I think I need to mount the flash drives with some special options (when they are formatted as FAT32 or ext2), so they won't "sync" during transfer. However, I do not know how..

In order to fix B, more investigation is needed..

----------

## strummer

I still have this problem, .31 kernel didn't help. Actually I switched to Arch, but not because of this  :Wink:  I've tried mounting with async, but I guess it's default (you don't see that in /proc/mounts) because when I mount with sync, it's even slower.

----------

## MarcusXP

So which problem do you have, A or B from my summary?

I assume is A, right? (when using the USB flash drives with FAT32 filesystem)

That's what I want to fix too.. but I need to know if it's a kernel configuration issue, or wrong parameters for the "mount" command, or something else..

Not many people seem to have this issue, though.. or they didn't notice because they didn't copy large files to their USB flash drives maybe most ppl copy some documents, and in this case the problem is not obvious..

----------

## strummer

Yeah A is my problem, but I haven't tried ntfs, ext3 or any other file systems, just fat32. I need to have fat32 because I use the usb stick in my car player (which is actually an FM transmitter that reads usb sticks and SD memory cards). So what I'm copying is maybe 250 files, 2-30MB each. At first it copies maybe 20 songs very fast (a couple of seconds), but then it slows down and it takes maybe 30 minutes to copy them all (2GB).

----------

## BlackBelt

anyone have a fix for this?

I m running gentoo on:

```

Linux Nabucodonosor 2.6.32-gentoo-r7 #7 SMP Mon Apr 16 21:29:49 GMT 2012 x86_64 Intel(R) Core(TM)2 Duo CPU P9700 @ 2.80GHz GenuineIntel GNU/Linux
```

----------

