Bobcares

Rsync input/output error(5)- Easy fix!

by | Oct 9, 2019

Is your backup failing with the rsync input/output error(5)?

Unfortunately, it is a common error while executing rsync commands. This error mainly occurs due to disk defects, insufficient permissions and so on.

At Bobcares, we often receive requests to fix the rsync input/output error(5) as part of Server Management Services.

So today, let’s get deep into this error and see how our Support Engineers fix it for our customers.

 

What is the rsync input/output error(5)?

As we all know, rsync is popular for its faster file copying capability. It is preferred mainly due to the large variety of options it provides while copying data.

Recently, one of our customers approached us with a rsync error. He was running a daily backup scrit with rsync.

But, a few days back, during backup, one of his files throwed the error.

rsync: read errors mapping "/home/folder/file.ext": Input/output error (5)

In general, this error indicated the impossibility of rsync to read or write a file.

This error occurs due to many reasons. Let’s discuss some top reasons that cause this error and see their respective fixes too.

 

Causes and fix Rsync input/output error

Finding the ultimate reason that causes the rsync input/output error(5) can be a bit tricky. From our expertise in managing servers, our Dedicated Engineers see that it occurs mainly due to disk defects, insufficient privileges, etc. Let’s take a detailed look on each of them.

 

1. Disk defects

In general, disk defects in the source or target directory can cause this rsync error.

To check whether these disk defects cause the error, we try to copy the files manually. If the files copies successfully, then we can make sure that the source of error is disk defects in the source directory.

We repeat this operation at a later time. This time we will write into a different section of the disk and this will resolve the error.

Also, if we have a bad sector in our SRC directory, we exclude it using the command.

rsync -av --exclude='/home/my_name/directory_with_corrupt_files/*'

Here, the rsync process skips the copying of the files specified in this directory.

 

2. Insufficient privileges

Similarly, the wrong privileges on the files or folders can also cause this error. In such cases, our Support Engineers always recommend using the root account on both SRC and TGT machines.

In case if we don’t have the root access, we check whether the rsync files are accessible for us. If not, then we modify the permissions and ownership of the files. This gives adequate peivileges to the user performing the rsync operation.

 

3. File lock by anti-virus programs

The input/output error in rsync can also occur due to file lock by anti-virus programs.

An anti-virus locks files for some time. Thus, Rsync may not be able to access the file. This can also cause the input/output error.

Retrying the same command after sometime resolves the error in most cases. Or, we may have to disable anti-virus program temporarily or even skip directories in use by antivirus.

 

[Need assistance to fix the input/output rsync error(5)?- We’ll help you.]

 

Conclusion

In short, the rsync input/output error(5) occurs mainly due to disk defects, insufficient privileges and so on. Today’s write-up discussed this error in detail and we also saw how our Support Engineers fix it for our customers.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

4 Comments

  1. German

    Hello. I’m did have this problem with file name. Excuse me for my english.

    Reply
    • Arya MA

      Hi there,

      Do you still get errors while using rsync? If you still find problems, we’ll be happy to talk to you on chat (click on the icon at right-bottom).

      Reply
  2. Craig Davidson

    Hello. I am using rsync on unraid and I get the error pasted below. Are you able to help? The drive im writing to has always worked before but suddenly stopped working. The size of the drive is 4tb and has 900gb of spare space. The drive is writable as I just copied a movie over manually. Thanks.

    Script location: /tmp/user.scripts/tmpScripts/Master Backup/script
    Note that closing this window will abort the execution of this script
    Please wait.. I am working here
    sending incremental file list
    rsync: [generator] recv_generator: mkdir “/mnt/disks/MASTER_BACKUP/ALLPHOTOSMASTER/allphotos” failed: Input/output error (5)
    *** Skipping any contents from this failed directory ***
    allphotos/

    sent 638,688 bytes received 1,071 bytes 85,301.20 bytes/sec
    total size is 217,352,067,145 speedup is 339,740.54
    rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1330) [sender=3.2.3]
    Please wait.. I am working here
    sending incremental file list
    rsync: [generator] recv_generator: mkdir “/mnt/disks/MASTER_BACKUP/ALLVIDEOSMASTER/allvideos” failed: Input/output error (5)
    *** Skipping any contents from this failed directory ***
    allvideos/

    sent 147,423 bytes received 588 bytes 59,204.40 bytes/sec
    total size is 990,185,692,518 speedup is 6,689,946.64
    rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1330) [sender=3.2.3]

    Reply
    • Hiba Razak

      Hi,
      Please contact our support team through live chat (click on the icon at right-bottom).

      Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.