LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-26-2004, 02:02 PM   #1
tleadley
LQ Newbie
 
Registered: Nov 2004
Posts: 5

Rep: Reputation: 0
Unhappy Slow Pendrive USB 2.0 uploads


I am using a Transcend USB 2.0 memstick.

The problem is that it takes minutes to transfer data to the stick and only seconds to transfer data from the stick. I know it takes longer to write data than it does to read, however, I don 't understand why it takes 3 seconds to copy the data off the stick and 3.5 minutes to copy it back to the stick.

I have Kernel 2.4.22-1.2194.nptl, runing on Redhat 9
I am using KDE 3.1.

I have a few other issues, however one at a time ;-)
 
Old 11-26-2004, 02:29 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Hi, and welcome to LQ!

The first thing to look at would be that the
device is a) actually plugged into a USB 2.0
port on the comp, and b) which drivers RH has
loaded for the chipset.

Can you post the output of lsmod?

It seems a bit odd, though, that the process is
so different for reading and writing. Have a look
at /var/log/messages and /var/log/debug as well.


Cheers,
Tink
 
Old 11-29-2004, 10:53 AM   #3
tleadley
LQ Newbie
 
Registered: Nov 2004
Posts: 5

Original Poster
Rep: Reputation: 0
Lightbulb

I have an NEC USB 2.0 card as well as the onboard usb which is 1.0
I have the stick plugged into the NEC card. I have disabled the onboard usb.

I have read lots of information on lots of sites and they have been sketchy at best, everyone seems to have their own opinion, and very little facts. They seem to explain the capabilities,however not the actual meat and potatoes. I am missing something here, it could be the way the driver is being loaded.

Jetflash was not even suppose to work according to some people, I jus never gave up. After two weeks I almost did, and then realized something after using a windows box. The damn stick had an identity crisis, USB HD or USB Zip disk. I have looked at the log messages, jus a couple of errors, nothging too serious.

Here she is
______________________________________________________________________
LSMOD

[root@localhost root]# lsmod
Module Size Used by Not tainted
usb-storage 70432 1
vfat 12524 0 (autoclean)
fat 38040 0 (autoclean) [vfat]
sd_mod 13420 2 (autoclean)
via82cxxx_audio 23992 0 (autoclean)
ac97_codec 16744 0 (autoclean) [via82cxxx_audio]
uart401 7972 0 (autoclean) [via82cxxx_audio]
sound 72276 0 (autoclean) [via82cxxx_audio uart401]
soundcore 6468 4 (autoclean) [via82cxxx_audio sound]
parport_pc 18756 1 (autoclean)
lp 8580 0 (autoclean)
parport 37056 1 (autoclean) [parport_pc lp]
autofs 12084 0 (autoclean) (unused)
via-rhine 15120 0
mii 3992 0 [via-rhine]
ipt_REJECT 4248 6 (autoclean)
iptable_filter 2444 1 (autoclean)
ip_tables 15136 2 [ipt_REJECT iptable_filter]
sg 35436 0 (autoclean)
sr_mod 17400 0 (autoclean)
ide-scsi 12016 0
scsi_mod 110280 5 [usb-storage sd_mod sg sr_mod ide-scsi]
ide-cd 34432 0
cdrom 34592 0 [sr_mod ide-cd]
keybdev 2656 0 (unused)
mousedev 5268 1
hid 23908 0 (unused)
input 5888 0 [keybdev mousedev hid]
usb-uhci 26124 0 (unused)
ehci-hcd 20008 0 (unused)
usb-ohci 21544 0 (unused)
usbcore 78752 1 [usb-storage hid usb-uhci ehci-hcd usb-ohci]
ext3 71620 3
jbd 51276 3 [ext3]
[root@localhost root]#

________________________________________________________________________
DMESG


Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
scsi1 : SCSI emulation for USB Mass Storage devices
Vendor: JetFlash Model: TS128MJF2L Rev: 2.00
Type: Direct-Access ANSI SCSI revision: 02
Attached scsi disk sda at scsi1, channel 0, id 0, lun 0
sda: Unit Not Ready, sense:
Current 00:00: sense key Unit Attention
Additional sense indicates Not ready to ready change,medium may have changed
SCSI device sda: 256000 512-byte hdwr sectors (131 MB)
sda: sda1
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 4
USB Mass Storage support registered.
usb.c: USB disconnect on device 00:09.2-3 address 4
usb.c: deregistering driver usb-storage
scsi : 1 host left.
hub.c: new USB device 00:09.2-3, assigned address 5
usb.c: USB device 5 (vend/prod 0xea0/0x2168) is not claimed by any active driver.
Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
scsi1 : SCSI emulation for USB Mass Storage devices
Vendor: JetFlash Model: TS128MJF2L Rev: 2.00
Type: Direct-Access ANSI SCSI revision: 02
Attached scsi disk sda at scsi1, channel 0, id 0, lun 0
sda: Unit Not Ready, sense:
Current 00:00: sense key Unit Attention
Additional sense indicates Not ready to ready change,medium may have changed
SCSI device sda: 256000 512-byte hdwr sectors (131 MB)
sda: sda1
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 5
USB Mass Storage support registered.

______________________________________________________________________

Thanks,
NopLoop
 
Old 11-29-2004, 12:48 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Unplug the pen, unload usb-uhci, usb-ohci and ehci-hcd
Re-load ehci-hcd.
Plug the pen back in and try again :)

Often USB chipsets will "respond proper" to
either ehci-hcd or or usb-ohci, and if the ohci
get's the jack-pot the transfer speed is bound to
be low ...



Cheers,
Tink
 
Old 11-30-2004, 03:03 PM   #5
tleadley
LQ Newbie
 
Registered: Nov 2004
Posts: 5

Original Poster
Rep: Reputation: 0
It isn 't having a problem picking the right driver, it is just having a low throughput. the rate of transfer to the stick is about 250k/s and at other times it will work at higher. I have noticed this with smaller files, it is the larger files that it is having an issue with. Getting the information from the stick is not a problem, it is lightening fast. It is when I transfer data to the stick. I have upto thirty sticks to load; they take 3.5 min to load each.

The file system I am using on the pendrive is ext2, it has to be this in order to be compatible with the equipment I am using

My USB 2.0 card is an NEC 3100LP, I don 't think the system is loading the right drivers for it, because Linux is not even displaying the right vendor and product id's



Bus 003 Device 001: ID 0000:0000
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 9 Hub
bDeviceSubClass 0
bDeviceProtocol 1
bMaxPacketSize0 8
idVendor 0x0000
idProduct 0x0000
bcdDevice 2.04
iManufacturer 3 Linux 2.4.25-1.ll.rh73.ccrma ehci_hcd
iProduct 2 NEC Corporation USB 2.0
iSerial 1 00:09.2
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 25
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x40
Self Powered
MaxPower 0mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 9 Hub
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type none
wMaxPacketSize 2
bInterval 12
Language IDs: (length=4)
0000 (null)((null))
 
Old 12-01-2004, 09:00 PM   #6
KohlyKohl
Member
 
Registered: Aug 2004
Location: Wausau, WI
Distribution: SuSE Linux Enterprise Desktop 10
Posts: 193

Rep: Reputation: 30
when you copy files from the usb stick is the light coming on? When Linux loads usb storage devices it likes to read everything on them and put them into cache, which would explain the really fast read times and the slow write times. I too get fast read times and really slow read times. Just something to think about.
 
Old 11-23-2006, 08:48 AM   #7
nemontemi
LQ Newbie
 
Registered: Dec 2005
Location: Brazil
Distribution: Debian
Posts: 4

Rep: Reputation: 0
Same to me

tleadley, I just bought a Transcend JetFlash 2GB and I'm having the same problem.
Have you found any solution this?

Write speeds are incredibly slow and read speeds are normal for a USB 2.0 device.

Any help would be enjoyed. (Waiting 15+ minutes to copy 500mb from HD to Pendrive is a bit weird...)

Thanks,

k;
 
Old 11-23-2006, 10:05 PM   #8
tleadley
LQ Newbie
 
Registered: Nov 2004
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by nemontemi
tleadley, I just bought a Transcend JetFlash 2GB and I'm having the same problem.
Have you found any solution this?

Write speeds are incredibly slow and read speeds are normal for a USB 2.0 device.

Any help would be enjoyed. (Waiting 15+ minutes to copy 500mb from HD to Pendrive is a bit weird...)

Thanks,

k;

At the time I did this post I was doing everything throught the gui, which tends to slow this down a tremendous amount. Number two a flash device when it writes information it will take upto three times a long to write depending on factures of your PC's hd speed and bus throughput. Do not use sync with your usb device, otherwise that will slow you down even more.

this is what I do.

I copy everything using the command line interface
I never use the sync switch when I mount a device when I am finished copying I unmount the device.
50 M should take about 15 to 20 seconds using USB 2, upto 90 seconds using USB 1.1
 
Old 11-24-2006, 10:02 AM   #9
nemontemi
LQ Newbie
 
Registered: Dec 2005
Location: Brazil
Distribution: Debian
Posts: 4

Rep: Reputation: 0
Quote:
Originally Posted by tleadley
At the time I did this post I was doing everything throught the gui, which tends to slow this down a tremendous amount. Number two a flash device when it writes information it will take upto three times a long to write depending on factures of your PC's hd speed and bus throughput. Do not use sync with your usb device, otherwise that will slow you down even more.

this is what I do.

I copy everything using the command line interface
I never use the sync switch when I mount a device when I am finished copying I unmount the device.
50 M should take about 15 to 20 seconds using USB 2, upto 90 seconds using USB 1.1
I already do every file management through command line, and rarely use a file manager, like Konqueror, but the write speed still is _TOO_ slow.
I did not tried the "async" option at mount, I'm gonna try. But on the PCs I have not administrator privileges (like at university) I can't to much about this...

Thanks for answering!

k;
 
Old 11-24-2006, 10:57 AM   #10
exvor
Senior Member
 
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: Gentoo, LFS, Debian,Ubuntu
Posts: 1,537

Rep: Reputation: 87
This is normal for a flash drive. The reason why has to do with the way the technology works. The speed of the memory is only fast for reading but slow for writeing this is why its not used as ram in computers. There is unfortunatly no way to fix it as it is a technology limitation and not anything to do with drivers or whatnot.
 
Old 12-01-2006, 07:51 PM   #11
marret
LQ Newbie
 
Registered: Sep 2005
Distribution: (Suse); Zenwalk
Posts: 8

Rep: Reputation: 0
Hm, I've read this and other similar threads with great interest ... I am still quite puzzled.
It may be true that flash drives are just slow, but can anyone explain what's going on here?

I wanted to transfer ogg encoded music files on my mp3/ogg player. I did use the GUI, and yes, I also used Konqueror. The download "speed" started at an incredible 150kB/s and slowed down to 40-60kB/s over the next five minutes or so. With still about 50% to go I cancelled.

To see if there is anything wrong with my flash player I plugged it into my old Windows 2000 laptop, set up a Samba share and dragged the same music files in Konqueror from my linux hard drive window to the samba share/player window to transfer the files over my network. The whole thing transferred at 1.5-2MB/s and was done in seconds rather than minutes.

Now 2MB/s may still be slow but it's at least a ten-fold improvement and it shows that it is not the flash drive as such but there seems to be a problem with Linux and flash drives. I guess I need to figure out how to do the ehci-hcd/usb-ohci thing that Tinkster suggests above.
Any other suggestions are appreciated too.
 
Old 12-02-2006, 01:27 PM   #12
nemontemi
LQ Newbie
 
Registered: Dec 2005
Location: Brazil
Distribution: Debian
Posts: 4

Rep: Reputation: 0
I tried copying data in an Windows environment, directly to my JetFlash pendrive, but the write speed is as slow as in Linux. I think the problem is not the Operating System but the hardware itself.
 
Old 12-31-2006, 03:35 AM   #13
brudermarkus
LQ Newbie
 
Registered: Dec 2006
Posts: 1

Rep: Reputation: 0
Thumbs up yep, async mount does the trick

I had exactly the same problem with my trekstor vibez, write throughput was as slow as 56 kB/s. But I mounted the device with the 'sync' option. Mounting it without this option gives way better results. The corresponding line in my fstab looks like this (note that async is the default):

/dev/sda /media/vibez auto user,noauto 0 0

So now

% time cp ubuntu-6.06.1-alternate-i386.iso && time umount /media/vibez

takes together 144 seconds, which makes a transfer rate of ~ 5000 kB/s (!)
 
Old 02-06-2007, 06:11 AM   #14
csmarkus
LQ Newbie
 
Registered: Jun 2006
Location: Budapest, Hungary
Distribution: Debian
Posts: 4

Rep: Reputation: 0
Quote:
Originally Posted by brudermarkus
[...]But I mounted the device with the 'sync' option. Mounting it without this option gives way better results.[...]
Good for you! I have slow transfer rates of about 300-400 kB/s with my A-Data USB2.0 Flash Disk-RB1 and I'm not mounting it with the sync option. Interestingly, when I start typing on the USB keyboard or moving the USB mouse, CPU load jumps to 100%, about 50% of that being system load. Collisions on the USB bus?

The read speed is all right, about 10-15 MB/s.

The worst part of the story is that writing data to the pendrive is much faster on Windows XP, I get transfer rates of about 3-4 MB/s. However, when I try the same from a Windows XP running under VMWare, I get the same slow speeds (300-400 kB/s) as on Linux.

I know my kernel is rather old (2.6.7) but I have little control of it since this is a company laptop.
 
Old 02-18-2007, 08:20 AM   #15
KillerOfGiants
LQ Newbie
 
Registered: Feb 2004
Location: BG
Distribution: Slackware-current
Posts: 29

Rep: Reputation: 15
EDIT: deleted by author.
Found out i was wrong.

Last edited by KillerOfGiants; 02-18-2007 at 08:46 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
USB Pendrive DarkAsHell Linux - Hardware 3 04-07-2005 03:26 PM
USB pendrive help jojotx0 Fedora 12 09-14-2004 02:49 AM
USB Pendrive d4d4n9 Mandriva 7 02-03-2004 08:44 PM
Slow uploads over NAT network Aurix Linux - Networking 4 05-16-2002 04:06 PM
FTP - Fast Downloads - SLOW UPLOADS? fed007 Linux - Newbie 2 08-19-2001 11:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration