Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - General
User Name
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.


  Search this Thread
Old 09-06-2006, 12:01 PM   #1
LQ Newbie
Registered: Sep 2006
Location: New England
Distribution: RedHat
Posts: 2

Rep: Reputation: 0
cp command failing for large files - Input/Output error

I am having trouble copying large files between Linux boxes. At home I have two Linux boxes, boxA and boxB. Both are running RedHat 8, and have been no problem for years.

boxA has a directory on boxB automounted. For working with most files it's fine. But for large files, when I do a cp from a native directory on boxA to the mounted filesystem, I get input/output errors. To wit:

(where zzz is the very large file and xxx/yyy is the mounted directory)

cp zzz xxx/yyy
cp: writing 'xxx/yyy/zzz': Input/output error

There is not a hard threshold where copy commands fail. I have successfully copied a 43MB file, but have choked on a 35MB and a 138MB file. There is no other activity on either system. Given that, I have not been able to quantify the threshold or conditions that cause the cp command to barf.

I have played around with the automount timeout variable. Changing it has made little difference. It's currently set for two hours. There's nothing conclusive here that makes me believe it's an automount error.

Both the source and destination directories reside on disks with lots (40G+) of free space. The filesystems are nowhere near full.

One interesting thing is that both of these directories are also mounted on a Win2k box via Samba. I am able to do a drag and drop copy. It takes several minutes, but it succeeds.

I have done a search of the forums here and came up with several threads that might be related. None have a definite resolution attached. I'm wondering if they're all due to the same cause:



Does LQ have any suggestions on ways I might be able to do this cp? This problem originally showed up in a simple backup script I wrote, but reproduces rather easily from the command line. I'd rather not have to resort to using windows, as I'm attempting to backup some directories. Once I can successfully copy all files via `cp` I plan on incorporating the fix back into my script.


- Joe
Old 09-07-2006, 10:29 PM   #2
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912

And welcome to LQ!

Have a look at dmesg output on both boxes, and maybe /var/log/[messages|debug|syslog]
It may be a problem with the network card on one of them.

Old 09-08-2006, 11:09 PM   #3
LQ Newbie
Registered: Sep 2006
Location: New England
Distribution: RedHat
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks. No obvious problems in dmesg. I saw in the messages logfile that it was having trouble mounting a non-existant directory. It looked like some cruft from back when I was trying to get automount to work. I'll see if I can trace it down and clean it up, but it seems incidental and not related.

I'm leaning against it being a network problem simply because I can do things with the file, like view it using `less` or doing the copy via the W2K box from one to the other.

But in any case I'm still poking around to hopefully find the problem.

- Joe
Old 09-09-2006, 12:48 AM   #4
Registered: Feb 2006
Distribution: FC
Posts: 86

Rep: Reputation: 15
Maybe try rsync instead? Whenever I have to move files between systems I use either rsync or scp.

I don't know if rsync resides on RH8 but if it does you can try using it. If you have sshd (as most system do) running you can tunnel that way without worrying about an rsync daemon. Try something like:
rsync -avz -i "ssh -l box_b_username"  zzz box_b_username@box_b:/xxx/yyy/
Old 08-09-2012, 11:26 AM   #5
LQ Newbie
Registered: Aug 2012
Posts: 2

Rep: Reputation: Disabled
Check your available disk quota

I had this problem and it was resolved by freeing up some space on the destination disk!
Old 08-09-2012, 01:28 PM   #6
Registered: Mar 2012
Location: Italy
Distribution: Slackware+Debian
Posts: 321

Rep: Reputation: 81
Are you sharing the directory via nfs to your linux box ?
I would do some experiment to isolate the problem. But first I will try to schematize the scenario
BoxA                   BoxB
nfsd                   automount
Directory_served  ->
and you in BoxB try to copy something to Directory_served.
Try in boxB to dd if=/dev/zero of=/directory_on_A/file
and see if it stops well stop it after a couple of gig , if it stops before you may try to mount it manually and repeat the test.
If it doesn't fail again it's almost surely automount causing the issue.


cp, error, files, inputoutput

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
aplay: pcm_write:1029: write error: Input/output error mimithebrain Linux - Software 2 12-04-2007 12:51 PM
Gentoo X server freezes /var/lib/init.d/ files input output error bendeg Linux - Software 0 12-01-2005 06:01 AM
"Input/output error" on files at end of CD mfeat Linux - Software 2 11-23-2005 03:01 PM
how to use the output of a file for input of a command sneak Linux - General 2 05-12-2004 10:21 AM
Input/Output errors on files Poetics Slackware 4 08-25-2003 06:57 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:04 PM.

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