Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am having problems copying large files (>400MB) from an
ext3 linux (Red Hat) filesystem onto a USB device (Maxtor external
hard drive) formatted with a vfat filesystem.
I am using the cp command to do the
copy. Smaller files copy as expected. The USB device is
mounted read/write with uid and gid set to a specific user.
I have been using an 888MB file as a test file; when I try to
cp this file onto the USB device, the command locks up and
does not return (I've waited > 2 hours); in fact, the entire
machine locks up, and I am not able to establish another login
session, not even as root from the console. Other existing
sessions also freeze.
The var/log/messages files doesn't provide any helpful messages.
I have tried copying the same 888MB file within the same linux ext3
filesystem, and it works as expected (I think this tells me
that cp is OK, and that the ulimits are OK).
I tried cp-ing the file as root, but it said the USB mounted
filesystem was read-only, presumably because it was mounted with
the gid and uid options of a specific user. After this error message,
I tried another small file as the non-root user, and this also
failed with a "filesystem read-only" message. I unmounted, and
remounted to make the vfat filesystems read-write once again.
The vfat filesystem I am trying to write to is 30 GB in size, with
approx 22 GB free space. I then tried using sftp; I sftp'ed to the same
machine from a working directory on the USB device, and issued a "get"
command to get the 888MB file. It worked, but was excruciatingly slow;
sftp reports transfer stats while copying; the intitial rate was between
10 - 20 MB/sec, but it began to slow down around the 400MB mark, and
became progressively slower; by completion, it was down to 700kb/sec.
It took about 30 mins for the 888MB file to complete.
Can anyone suggest what to try next? The USB device needs to be vfat because it is being used to transfer files to windows. Apologies for the long post, and thanks to any responders.
The kernel version is 2.4.21-4; this is Red Hat Enterprise Linux 3.0 ES.
The USB interface is supposed to be 2.
Thanks for your help. After thinking about this a while, this seems typical of a filled buffer of some sort; that is, the buffer fills up after a certain size, and thereafter, the copy becomes excruciatingly slow. Just a thought.
But I am seeing copy speeds around 20MB/sec with smaller files. Even with the large file (888M), I see a rate up to 20MB/sec for the first 300M or so; then the rate drops progressively. If the wrong module/driver is in use, wouldn't the rate be slow in all situations?
Maybe that's just while it's using RAM to
temporarily buffer? How much RAM does
the box have you said? :) And which tool
are you using to measure the speed, anyway?
The only reliable method would be
time cp foo bar
Anything else is guesstimations, and can heavily
vary with system load, memory utilisation and how
the program "thinks" it should measure ;}
This machine has 2.5G ram and 4G swap. I've been monitoring the transfer rate using rsync with the stats/progress flags; this reports the rate every few seconds. Unlike cp, rsync does eventually finish the copy, but the rate steadily decreases. I also monitored output from "top" in another session while the rsync is running; top reports no swap is used, and free memory only decreases a bit. It does show that %iowait increases to 99% about the same time the transfer rate begins to decline. Do you know if the USB device has some sort of write buffer? If so, how can it be changed?
We think the problem is solved. We installed a D-Link DU-520 card in the machine, rebooted, and it copied a 888MB test file in around 3 mins. We noticed it added a couple of lines to modules.conf, the relevant one being: alias usb-controller2 ehci-hcd.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.