I have 2 external drives I keep in sync, using rsync
. I perform this task regularly on either of two machines, and frequently switch from one to the other for the sake of convenience. I have 4 machines running Debian 9, and use these drives on each of them.
This morning I used the following:
rsync -ahv --delete drive-x drive-y
and was surprised to have a few hundred reported failures.
mostly: rsync: readlink_stat... failed: Input/output error (5)
also: rsync: rsync: recv_generator: mkdir ... failed: Read-only file system (30)
In the process to find out what happened, I remounted the drives twice, rebooted, ran rsync
without --delete
and basically my normal tries to fix something that has reliably worked for a long time. Even thought about installing rsync
again. Before I would do that I decided to rsync
the 2 drives on the other machine, which I run offline. rsync
worked just the way it should.
Having read the material posted here, I installed clamav
, updated the signatures, and scanned my home directory. I use this regularly on a different machine. I found 1 and only 1 PUA, and I deleted it. I always delete PUA's. I then remounted the two drives with this machine, and added different test files and folders to each drive.
I ran rsync -ahv --delete drive_x drive_y
and everything worked fine.
TGT is just target, right? Might be better to just say target, then. – Jasper – 2019-09-17T07:23:20.723
1
It seems that your answer gave birth to a whole article https://bobcares.com/blog/rsync-input-output-error_5/ (without references, of course).
– Yaroslav Nikitenko – 2019-12-30T13:00:28.580@YaroslavNikitenko Thanks for pointing this out, it is fun to know. – MariusMatutiae – 2019-12-30T16:47:58.413
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 – 2013-11-16T14:40:17.397
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 – 2013-11-16T15:53:43.160
You misunderstood my comment above. Nevermind, I will ask a new question. – uncovery – 2013-11-17T05:28:36.060