You are not logged in.

#1 2009-07-22 22:36:02

k_ibou
Member
From: Costa Rica
Registered: 2009-06-09
Posts: 101

USB file copy very slow

Hi everyone, I hope that someone can help me with thisproblem:

I was copying some files of 370 MB to a 4GB Kingston USB key and It took around 45 or 50 minutes to copy it and when I try to eject the key it give me an error. I tried again and it was the same; So I remove it without unmounting...... The result, only two of all files were in the usb key.

I'm using LXDE, 2.6.30-arch on a AMD 5200 x2 64bits, 4 GB of ram.

Why it took me too long to copy those files and the error when i was rejecting the USB key???


Thanks to all, please forgive my english....

Offline

#2 2009-07-23 01:15:36

celtic426
Member
From: Boston
Registered: 2009-07-16
Posts: 29
Website

Re: USB file copy very slow

Not sure, but just an idea: Was the usb port a 2.0?  The older version is much slower.  If it's a new pc then it's probably 2.0 tho.


gods are fragile things.  They may be dismissed with a dose of common sense or a whiff of science.

Offline

#3 2009-07-23 01:54:26

k_ibou
Member
From: Costa Rica
Registered: 2009-06-09
Posts: 101

Re: USB file copy very slow

as you said, it have usb port 2.0. the mb is asrock alivenf6g-vsta

Offline

#4 2009-07-23 11:09:28

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: USB file copy very slow

USB flash drives are slow, even more if you are not copying big files.
Copying (writing actually) many small files will take forever, it's just how things work.
You got an error because files were still being written to the drive (just a guess, you don't say what kind of error you got) .... you know, usb flash drives have an activity led for a reason, not just to make them pretty.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#5 2009-07-25 18:18:16

djszapi
Member
From: Cambridge, United Kingdom
Registered: 2009-06-14
Posts: 1,439
Website

Re: USB file copy very slow

I don't have activity led hehe, but in last case you can unmount it with -l (force) option, but it's not a security solution too smile

And the 'KINGSTON' is not the best vendor too.

Offline

#6 2009-07-25 22:24:24

jelly
Administrator
From: /dev/null
Registered: 2008-06-10
Posts: 714

Re: USB file copy very slow

my usb stick also copies fairly slow i can remember copying it slower.

@djszapi : kingston isnt that bad

Offline

#7 2009-07-26 18:38:28

EVRAMP
Member
From: Czech Republic
Registered: 2008-10-03
Posts: 173
Website

Re: USB file copy very slow

Hi k_ibou, don't get fooled - copying 370MB for 45 minutes with USB 2 is not normal, try to downgrade kernel to previous version or even to 2.6.27. If you don't know where to get these old packages look at http://www.schlunix.org/archlinux/core/os/

Offline

#8 2009-07-26 19:23:30

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: USB file copy very slow

R00KIE wrote:

usb flash drives have an activity led for a reason

It would not be reliable, without the flush option, to prevent excessive caching.

Offline

#9 2009-07-26 22:46:53

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: USB file copy very slow

brebs wrote:
R00KIE wrote:

usb flash drives have an activity led for a reason

It would not be reliable, without the flush option, to prevent excessive caching.

Yes you are right, but if lots of data is cached and you ask to unmount the drive from a DE (my experience is with xfce) then I believe there is a timeout before it spits an error about not being able to unmount while it is still trying to flush out all the data (maybe the error the OP received?), thats when the activity led is useful, to check if it is just being stubborn or actually still doing something.

I have noticed that even after xfce says it is safe to remove the device there is still activity for a couple of seconds so I guess one risks to have data loss if removing the drive while there is still activity.

The OP just said 370 MB of data and didn't mention how many files there were, from my experience you get around 5MB/s of writing speed with most usb flash drives (USB2 drives, the most common and cheaper) but this is when writing big files, try to write 300MB of small files and you will quit before it reaches 20% (if you don't count caching).

I have also noticed that even if the kernel does cache the writes it will keep writing in the background, but when unmounting there is always some writing to do so I guess either way it will not be safe to just remove the drive without unmounting first, that flush mount option may be worth looking at ...

Without more details we are all just giving our best guesses, maybe it can even be broken hardware that is causing the problem for all we know.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#10 2009-07-31 07:00:21

k_ibou
Member
From: Costa Rica
Registered: 2009-06-09
Posts: 101

Re: USB file copy very slow

Hi everyone and thanks for the help. As I said i'm using LXDE and this is the error that PCManFM gave me:

"Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken."

ROOKIE, I was writing 9 video files around 370 mb each one; yesterday I was writing to another USB key (Kingstone too...) and it took me the exactly the same for 16 video files of 245 mb....

EVRAMP, thanks for the tip but I wanna left that option as the last resource. I believe that the last kernel or at least the kernel i'm using (2.6.30-ARCH) do not have a bug like this. Thanks smile and if there is no other choise or fix to this, I'm gonna do what you told me.

I'm new using archlinux, so please tell me what kind of information would be useful for trying to resolve this problem.

oh, I don't know if this is useful information, but in the friend's netbook (windows) the files were writed so fast. The files that I gave to him and the others one that he passed to me with the same usb key.

I really apreciate your help, THANKS to all wink smile

Last edited by k_ibou (2009-07-31 07:04:54)

Offline

#11 2009-08-04 04:28:45

k_ibou
Member
From: Costa Rica
Registered: 2009-06-09
Posts: 101

Re: USB file copy very slow

Hi everyone, I was reading about this situation and I found these links with information about it... I'm starting to think that maybe could be a HAL problem and the option of synchronous writing.

https://bugs.launchpad.net/ubuntu/+sour … bug/243841
http://en.opensuse.org/SDB:Automounting … ync_Option  → I think that this could be our best bet to this problem

I don't know if I'm right  with my suspects, and if I'm right how do I change the synchronous in hal for archlinux???

Also I saw the /etc/mtab and it show me these information about the usb key:

/dev/sdf1 /media/KINGSTON vfat rw,nosuid,nodev,uhelper=hal,shortname=mixed,uid=1000,utf8,umask=077 0 0

the sync option is not present there... but I don't understand all the information that is there.

Thanks again, I hope that this could be useful smile

PD: I forgot to mention it but when I'm writing the video files to the USB key there is a High cpu usage and the writing start going slow when it's upper the 50%

Offline

#12 2009-08-04 10:11:44

Pyntux
Member
From: Serbia
Registered: 2008-12-21
Posts: 391

Re: USB file copy very slow

The best way to copy more than one file is to copy files in some dir and rar that dir, than copy rar file...


I do not speak English, but I understand...

Offline

#13 2009-08-04 13:54:36

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: USB file copy very slow

It might be that the ohci driver is being used instead of the ehci driver, so the copy process is quite fast while the writes are being cached but then slow down a lot when the cache is full and you get the speed at which the copy is being done.

If I remember correctly I've seen this here on the forums before but I can't remember how to fix it, I would try first putting ehci ohci in the modules lines in rc.conf to see if the modules load by the correct order (I think that's how it should be).


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#14 2009-08-05 03:23:03

thisllub
Member
From: Northern NSW Australia
Registered: 2007-12-28
Posts: 231

Re: USB file copy very slow

I am only getting 424kb transfer rate to a USB2 hard disk - not flash.
e.g. dd if=file1 of=/mnt/usb/file1
kill -USR1 psid = 424kb/s

Something is wrong somewhere.

Offline

#15 2009-08-05 20:17:24

k_ibou
Member
From: Costa Rica
Registered: 2009-06-09
Posts: 101

Re: USB file copy very slow

Hi, ROOKIE I tried what you said about the ehci and ohci in the modules lines in rc.conf. I have the same behavior and I can confirm that the modules were started in the correct order before the change in the rc.conf by dmesg.

Also I did a test, it looks like that the writing is fast for singles files until it reaches the 320 mb of empty space in the usb key, when the key reaches that limit the file (the big ones) are writing slow and when I reject the usb key it took so long (almost 20 min sometimes more) until the indicator led stop flashing.

Offline

#16 2009-08-05 23:22:28

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: USB file copy very slow

Thats something odd ... but at least you know of one condition that triggers the problem.

Try creating a smaller partition (maybe 500MB smaller than the one you have now) and try to see if the problem still happens.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#17 2009-08-07 03:01:41

k_ibou
Member
From: Costa Rica
Registered: 2009-06-09
Posts: 101

Re: USB file copy very slow

eh... sorry but I don't understand you sad

you mean make a partition in the usb key?

Offline

#18 2009-08-07 10:28:09

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: USB file copy very slow

Yes, the partition on the usb drive, if now you have a partition of 8GB try creating one with 7.5GB or 7GB and check if the problem still happens.

You can also use dd to fill the whole drive with zeros and check if the problem is with the drive or somehow related to the filesystem.
As root or with sudo do it with (it will erase all partitions and files on the drive)

dd if=/dev/zero of=/dev/sdX bs=10M

where X is the letter of your usb drive.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#19 2009-08-16 08:01:27

soylent_green_is_hamster
Member
Registered: 2006-11-15
Posts: 109

Re: USB file copy very slow

I'm also getting recent problems with usb memory sticks. The data transfers rapidly at first, but then becomes very slow. Unmounting the stick afterwards takes AGES!

This has only started very recently, but only with memory sticks, my external USB HD still performs well.

There is nothing unusual in the kernel log

anything changed recently that would break this?

ROOKIE: was this the ehci discusiion you were refering to:
http://bugs.archlinux.org/task/12009
I can't find anything else...

Last edited by soylent_green_is_hamster (2009-08-16 08:35:40)

Offline

#20 2009-08-16 11:43:04

flamelab
Member
From: Athens, Hellas (Greece)
Registered: 2007-12-26
Posts: 2,160

Re: USB file copy very slow

This USB issue is a kernel bug. You may encounter this error differently: you try to copy some files to a USB device storage and it seems that they are copied instantly, but this doesn't happen (they are still copied in the background, even though you see in the terminal or in the GUI window that the task has been finished).

Offline

#21 2009-08-16 12:05:52

Dheart
Member
From: Sofia, Bulgaria
Registered: 2006-10-26
Posts: 956

Re: USB file copy very slow

This is not kernel problem, nor usb problem. Just USB flash drives are SLOW. And by SLOW I mean SLOW. My 8 GB Maxwell got practically useless after filling it up with anime series twice. It now takes about an hour to copy 700 mb file, and About a day to copy 10000+ files, worth total 15 mb...


My victim you are meant to be
No, you cannot hide nor flee
You know what I'm looking for
Pleasure your torture, I will endure...

Offline

#22 2009-08-16 14:37:45

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: USB file copy very slow

@soylent_green_is_hamster
Most probably yes, I remember seeing something about needing to load ehci first, I'm also not sure if it solved the problem but I guess it would be worth a try smile

@Dheart
I haven't noticed if copying big files to a usb flash drive (100MB+) will take too long with the latest kernels, with older kernel it would not be a problem for me and my drives have been filled a few times, but in your case it seems more like some strange hardware problem. In the case of trying to copy 10000+ small files, usb flash drives were _always_ extremely slow and I guess they will still be if using fat or fat32 (and maybe even ext* and other filesystems) but that is not what we are trying to figure out here wink

Maybe some kernel regression, maybe the problem only manifests itself with some motherboard chipsets/usb flash drive controllers ... sometimes just some software problem that automagically goes away ...


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#23 2009-08-16 15:38:10

soylent_green_is_hamster
Member
Registered: 2006-11-15
Posts: 109

Re: USB file copy very slow

Dheart wrote:

This is not kernel problem, nor usb problem. Just USB flash drives are SLOW. And by SLOW I mean SLOW. My 8 GB Maxwell got practically useless after filling it up with anime series twice. It now takes about an hour to copy 700 mb file, and About a day to copy 10000+ files, worth total 15 mb...

yes, usb flash drives are slow, but they are not THIS slow. Have you actually read the speeds people are quoting on this thread?

as I said in my post, this is a RECENT problem. I had no such speed problems a month or two ago. And it definitely wasn't taking 2 mins to umount the drive!

If it is taking you an hour to copy a 700Mb file to your flash drive, then something is wrong with your setup also. Up until recently, it would take me about a minute or two to copy a file of that size to my phone or my flash drive, something I had done many times...

Offline

#24 2009-08-16 19:29:24

flamelab
Member
From: Athens, Hellas (Greece)
Registered: 2007-12-26
Posts: 2,160

Re: USB file copy very slow

It is a kernel problem, and a recent one. Before that:

1)Copying/moving messages through GUI and CLI were reliable --> now they aren't.
2)Copying/moving of files is actually slower than before.

I think I saw a link explaining that in bugs.kde.org (where someone thought that this was a KDE problem), but I can't find it right now.

Offline

#25 2009-08-16 20:21:37

soylent_green_is_hamster
Member
Registered: 2006-11-15
Posts: 109

Re: USB file copy very slow

ok - cheers flamelab

guess I'll just keep an eye on this thread, and wait it out...

Offline

Board footer

Powered by FluxBB