LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 07-26-2007, 05:50 AM   #1
tux_addict
Member
 
Registered: Dec 2004
Location: Nairobi, Kenya
Distribution: Ubuntu 20.04 LTS, Debian 10 (Buster)
Posts: 91

Rep: Reputation: 15
Speed up copying files to flashdisk


It takes too long to copy files to or from my usb pendrive (I find that this is the case in both Slackware and Debian). Sometimes it takes several minutes to copy just a few megabytes. Is there any way to speed up the process, say using hdparm? Any suggestions would be appreciated!
 
Old 07-26-2007, 09:23 AM   #2
{BBI}Nexus{BBI}
Senior Member
 
Registered: Jan 2005
Location: Nottingham, UK
Distribution: Mageia 6, KDE Neon
Posts: 4,313

Rep: Reputation: 212Reputation: 212Reputation: 212
Are you using usb 2.0? Maybe you should benchmark the performance of your pendrive.
 
Old 07-27-2007, 04:46 AM   #3
tux_addict
Member
 
Registered: Dec 2004
Location: Nairobi, Kenya
Distribution: Ubuntu 20.04 LTS, Debian 10 (Buster)
Posts: 91

Original Poster
Rep: Reputation: 15
Benchmark?

Yes, I am using usb 2.0. I am not sure what you mean by "benchmarking". Perhaps you could give me a clue?

You were right {BBI}Nexus{BBI}. My USB controller is version 1.1 not 2.0. My mistake.

Last edited by tux_addict; 10-25-2007 at 03:42 AM. Reason: Submitted incorrect information
 
Old 07-29-2007, 09:16 AM   #4
{BBI}Nexus{BBI}
Senior Member
 
Registered: Jan 2005
Location: Nottingham, UK
Distribution: Mageia 6, KDE Neon
Posts: 4,313

Rep: Reputation: 212Reputation: 212Reputation: 212
Quote:
Originally Posted by tux_addict
Yes, I am using usb 2.0. I am not sure what you mean by "benchmarking". Perhaps you could give me a clue?
Benchmarking = Running perfomance tests on your pendrive and noting the results. That way you can make a comparison of the pendrives performance against another model.

Last edited by {BBI}Nexus{BBI}; 07-29-2007 at 09:18 AM.
 
Old 07-30-2007, 04:25 AM   #5
tux_addict
Member
 
Registered: Dec 2004
Location: Nairobi, Kenya
Distribution: Ubuntu 20.04 LTS, Debian 10 (Buster)
Posts: 91

Original Poster
Rep: Reputation: 15
Gotcha! All the same, I am still keen to learn about ways of optimizing USB performance. Thanks.
 
Old 07-30-2007, 05:45 AM   #6
monkiidansu
Member
 
Registered: Sep 2005
Posts: 66

Rep: Reputation: 15
You might try compiling your own kernel and including the relevant modules.
 
Old 08-13-2007, 04:25 AM   #7
tux_addict
Member
 
Registered: Dec 2004
Location: Nairobi, Kenya
Distribution: Ubuntu 20.04 LTS, Debian 10 (Buster)
Posts: 91

Original Poster
Rep: Reputation: 15
USB performance still sucks!

In the kernel:

CONFIG_USB (check!)

CONFIG_USB_DEVICEFS (check!)

CONFIG_USB_STORAGE (check!)

Performance still sucks! It took one whole hour to copy a 108 MB folder from a laptop to my USB stick, yet, interestingly enough, just a little over 2 minutes to move the same folder to my desktop PCís hard drive. The filesystem on the laptop is reiserfs while the filesystem on the desktop system is ext3, in case it means anything. However, considering that it still takes a pretty long time to move data from the desktop system to the USB stick, I donít think it does (but what do I know?).
 
Old 08-13-2007, 11:15 AM   #8
jeenam
Member
 
Registered: Dec 2006
Distribution: Slackware 11
Posts: 144

Rep: Reputation: 15
After you plug the USB flash disk into the pc, what does the output of dmesg show? Try tail /var/log/messages as well. It should show USB high speed device, something along those lines. Sounds like the proper OHCI/UHCI USB 2.0 controller support was not compiled into the kernel. USB support will get you USB 1.1 speeds. OHCI/UHCI is for USB 2.0 support.
 
Old 08-16-2007, 04:33 AM   #9
tux_addict
Member
 
Registered: Dec 2004
Location: Nairobi, Kenya
Distribution: Ubuntu 20.04 LTS, Debian 10 (Buster)
Posts: 91

Original Poster
Rep: Reputation: 15
Thanks for the tip jeenam. I added the EHCI kernel module to the /etc/modules file and rebooted. Lsmod now tells me that the EHCI and UHCI modules are both loaded:

ehci_hcd 27784 0

usbcore 111844 6 usb_storage,ehci_hcd,usblp,usbhid,uhci_hcd

Meanwhile, when I mount my flash drive on my desktop, /var/log/messages tells me:

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

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

SCSI subsystem initialized

Initializing USB Mass Storage driver...

scsi0 : SCSI emulation for USB Mass Storage devices

usbcore: registered new driver usb-storage

USB Mass Storage support registered.

Vendor: Ut161 Model: USB2FlashStorage Rev: 0.00

Type: Direct-Access ANSI SCSI revision: 02

SCSI device sda: 256000 512-byte hdwr sectors (131 MB)

sda: Write Protect is off

SCSI device sda: 256000 512-byte hdwr sectors (131 MB)

sda: Write Protect is off

sda:

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

Does this sound right? I havenít had a chance to check out the performance yet (with large files).
 
Old 08-17-2007, 10:36 AM   #10
jeenam
Member
 
Registered: Dec 2006
Distribution: Slackware 11
Posts: 144

Rep: Reputation: 15
There was a typo in my first post. UHCI = USB 1.1. EHCI/OHCI = USB 2.0.

Looks as though your device is connecting at USB 1.1 speeds (~12mb/s).
 
Old 08-20-2007, 03:47 AM   #11
tux_addict
Member
 
Registered: Dec 2004
Location: Nairobi, Kenya
Distribution: Ubuntu 20.04 LTS, Debian 10 (Buster)
Posts: 91

Original Poster
Rep: Reputation: 15
Ehci, Uhci, Ohci

A little research indicates that the EHCI host controller driver provides USB 2.0 support while the UHCI and OHCI drivers provide USB 1.1 support. Iíve enabled the EHCI module but it still took me nearly 40 minutes to copy a 61 MB folder from my hard drive to a flash disk. But it then took just over 2 minutes to move the folder from the flash disk onto another hard disk. By the way, I'm running Debian 4.0.
 
Old 08-24-2007, 08:17 AM   #12
tux_addict
Member
 
Registered: Dec 2004
Location: Nairobi, Kenya
Distribution: Ubuntu 20.04 LTS, Debian 10 (Buster)
Posts: 91

Original Poster
Rep: Reputation: 15
Getting long in the tooth

I might have to face the possibility that my hardware's getting too old (2001) for all this high tech stuff
 
Old 08-25-2007, 06:54 PM   #13
Electro
LQ Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
I have typed a reply to http://www.linuxquestions.org/questi....php?p=2865629. Read it carefully.

In conclusion, FLASH memory has very, very slow throughput. On the other hand, it has very, very fast accessing times. Use Flash memory for small files (less than a megabyte). For larger files use a 1.8 inch to 3.5 inch hard drive.

XFS and JFS have the highest throughput than other Linux filesystems. ReiserFS has poor reliability.
 
Old 09-11-2007, 01:02 AM   #14
tux_addict
Member
 
Registered: Dec 2004
Location: Nairobi, Kenya
Distribution: Ubuntu 20.04 LTS, Debian 10 (Buster)
Posts: 91

Original Poster
Rep: Reputation: 15
Must be a new record

Must be a new record:

Quote:
$ du -h linux-image-2.6.18_custom_i386.deb

16M linux-image-2.6.18_custom_i386.deb

$ time cp linux-image-2.6.18_custom_i386.deb /media/sda/



real 57m47.892s

user 0m0.428s

sys 0m30.642s
Almost an hour to copy a 16 MB file from hard disk to thumb drive! Yet, it took less than 10 seconds to copy the same file back onto another hard disk (at a rate of 800 KB per second). I'm still trying to understand this asymmetric behaviour.
 
Old 09-11-2007, 01:55 AM   #15
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,785

Rep: Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574
Quote:
Originally Posted by tux_addict View Post
I'm still trying to understand this asymmetric behaviour.
It's called (disk) cache - yes, that bit in the "free" command.
Reboot and try the "fast" copy again.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
drastic speed differences on copying on hard disks lsu420luv Linux - Hardware 2 04-17-2006 10:50 AM
vector copying speed comparison gecoool Programming 1 11-15-2005 10:34 AM
How To Read Files From a USB FlashDisk (Solaris 8) njugs79 Solaris / OpenSolaris 2 04-11-2005 02:56 PM
Accessing Files From a USB Flashdisk in Solaris 8 njugs79 Solaris / OpenSolaris 1 04-11-2005 08:04 AM
copying files neozero62 Linux - Newbie 1 11-23-2003 05:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 07:55 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