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 am running a daily backup with rsync. Starting some days ago, one of the files has been throwing this error during the backup:

rsync: read errors mapping "/home/folder/file.ext": Input/output error (5)
WARNING: /home/folder/file.ext failed verification -- update discarded (will try again).

What's the best course of action? Is it just a broken file? Or is there something wrong with the hard drive in the location of the file? Should I just delete it and copy one of the backed up versions into the file's location? Or is there something else/more that I should do?

share|improve this question

1 Answer 1

up vote 5 down vote accepted

The rsync error

 read errors mapping ....: Input/output error (5)

indicates the impossibility of rsync to read or write a file. The most likely causes of this error are disk defects, either in the SRC or in the TGT directory. Other possibilities however include insufficient permissions, file lock by anti-virus programs, and maybe other causes.

The first step toward a diagnosis is to try to copy the files manually. This may work if, for instance, the source of the error was a disk defect in the TGT directory; by repeating the operation at a later time, you will write into a different section of the disk, and the problem may have evaporated.

Alternatively, you may discover that you cannot access the file in the SRC directory. In this case I suggest that you employ any of the disk checking utilities available to your distro.

Insufficient privileges, anti-virus, are easier to diagnose.

Lastly, if you have a bad sector on your SRC directory, you may exclude that from future runs of rsync by means of

rsync -av --exclude='/home/my_name/directory_with_corrupt_files/*'
share|improve this answer
    
Thanks! At the risk of this being another question, how do I find out if it's the SRC or the TGT directory if I can rule out privileges or anti-virus? –  uncovery Nov 16 '13 at 14:40
    
An anti-virus locks files for some time. If that is the problem, re-trying the same command some time later should not present the same error. The matter of privileges is easy: use root account on both SRC and TGT machines. If you cannot do that, check that the files on which rsync fails are accessible to you, i.e. they belong to the account trying to access them, and if they don't that you have read access to them. If this solves your matter, pls remember to accept my answer, it is useful to other readers. –  MariusMatutiae Nov 16 '13 at 15:53
    
You misunderstood my comment above. Nevermind, I will ask a new question. –  uncovery Nov 17 '13 at 5:28

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.