Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I wish to know what could be the possible cases for this error:

cp: reading `filename': Input/output error

I am getting this message when I am trying to copy a big file of around 50MB.

share|improve this question

migrated from stackoverflow.com Feb 18 '10 at 20:00

This question came from our site for professional and enthusiast programmers.

    
This recent bug report started out with a similar error. It has been fixed in the meantime and removed the problem for me. Good luck to you. –  JJD Sep 5 '12 at 22:52

3 Answers 3

The most likely problem is a faulty disk, unless the disk is mounted over a network, in that case, I believe network issues could also cause that.

It is likely that the size impact is statistical, especially in the network case (i.e. the chance of failure increases with size because more operations are involved and each has a chance to fail).

share|improve this answer
    
I have had this for days! It definitely is a faulty disk. This error usually goes hand-in-hand with the Bad Sector error. You don't have to replace your disk. Just do a full backup, reinstall your OS (this will ostracize bad sectors), restore from backup. You're golden. –  Yasky Apr 13 '13 at 17:15

The only time I have ever seen cp giving this error was when an iso image was mounted twice, eg: /dev/sr0 mounted on /mnt AND /dev/loop0 mounted on /mnt too. In this scenario, I think cp gets some recursion it can't handle. For me, unmounting both loop0 and sr0, then running mount -o loop /dev/sr0 /mnt again fixed it (done by root or sudo user).

share|improve this answer

Try dmesg or the syslog to see if the kernel complains about something that could be related to this. The cp command only gets an integer error number of the underlying system calls, and therefore the error messages are sometimes not very detailed.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.