LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 09-11-2007, 04:24 AM   #16
tux_addict
Member
 
Registered: Dec 2004
Location: Nairobi, Kenya
Distribution: Ubuntu 21.10, Debian 11 (Bullseye)
Posts: 91

Original Poster
Rep: Reputation: 15

Sorry, I should have pointed out that it was a hard disk on a different machine, so it can't be the cache...
 
Old 11-26-2007, 05:06 AM   #17
tux_addict
Member
 
Registered: Dec 2004
Location: Nairobi, Kenya
Distribution: Ubuntu 21.10, Debian 11 (Bullseye)
Posts: 91

Original Poster
Rep: Reputation: 15
The learning never stops!

For reasons we needn’t get into, I recently commented out this line in my /etc/fstab file:

Quote:
/dev/sda /media/sda vfat rw,user,noauto,sync 0 0
so it now reads:

Quote:
# /dev/sda /media/sda vfat rw,user,noauto,sync 0 0
Now when I copy anything to my flash disk it’s done in ... a flash! For instance, I just copied a 14 MB file, which previously would have taken several minutes to copy from my hard disk to flash disk, in less than 3 seconds. The KDE progress dialog almost didn’t have time to come up! I could hardly believe it.

So, that dismisses my theory that (a) copying files to flash disk in Windows is much faster than it is in Linux (if anything, Linux seems faster – I'll have to test it), and (b) copying from a Linux filesystem such as reiserfs to the vfat system is slowed down by the need for some kind of conversion from one filesystem to the other.

So what does this mean? I have my own theories regarding block devices and HAL, which may or may not be wide off the mark. But that is for you gurus out there to say. What exactly is going on here? (My usb version is 1.1; I guess 2.0 would knock my socks off).

P.S. I must admit that the slow copying (or moving) of files from hard disk to flash disk was becoming a real show-stopper for me. Creating a /dev/sda entry in /etc/fstab was a practice I carried over from my 2.4 kernel days. To think that I was reluctant to migrate to the 2.6 kernel because it was too “bleeding edge” (thanks a lot Patrick Volkerding )!
 
Old 11-26-2007, 05:16 AM   #18
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Type in "mount" by itself and see what mount options the system used. It was probably the "sync" option that caused the problem. However, the speed you are seeing are probably writing to the cashe. It can still take a long time for the flash memory to catch up.

Code:
/dev/sdb1 on /mnt/xmas type vfat (rw,noexec,nosuid,nodev,noatime,flush,uid=1000,gid=1000,fmask=117,dmask=007,utf8,shortname=lower)
For flash memory, you want the "noatime" option to reduce the number of accesses. It will speed things up and increase the life of the memory.

Last edited by jschiwal; 11-28-2007 at 02:17 AM.
 
Old 11-29-2007, 03:19 AM   #19
tux_addict
Member
 
Registered: Dec 2004
Location: Nairobi, Kenya
Distribution: Ubuntu 21.10, Debian 11 (Bullseye)
Posts: 91

Original Poster
Rep: Reputation: 15
Disk caching

Quote:
the speed you are seeing are probably writing to the cashe.
To test jschiwal's theory, I picked a random file and copied it to my flash disk. As you can see, it took just a minute and a half to copy the fairly large (48 MB) file. Previously, this would have taken an hour or more!
Quote:
me@tuxilla:~$ du -h AdobeReader_enu-8.1.1-1.i386.deb
48M AdobeReader_enu-8.1.1-1.i386.deb
me@tuxilla:~$ time cp AdobeReader_enu-8.1.1-1.i386.deb /media/disk/



real 1m34.282s
user 0m0.016s
sys 0m1.264s
I doubt that caching is the explanation for the increase in speed. And I did eject the flash disk immediately after copying was completed to establish that there wasn’t anything going on in the background.
P.S. I shall test using the old method, with the noatime option and without sync. I doubt that it will make an appreciable difference, but there’s only one way to find out!
 
  


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 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 10:23 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