Does rsync verify file copies on local drives?
Solution 1:
Is this safe enough?
I would assume yes. If you want rsync
to do a check you need to run rsync -c
after copying so you can have some extra verification using rsync
. Or use a md5sum on the files.
Is ext4 capable of detecting and warning if a write went wrong?
Yes. We are talking about drivers and the filesystem so an error any of these will result in an exit code. Of course there is a worst case scenario here: if the driver/filesystem is faulty the exit code could be wrongly sent as correct. I would not assume this to be correct myself and use a tool like md5sum to check the results myself.
And will rsync report it?
As soon as the receiving end errors out so will rsync
.
Solution 2:
The part of the man page that you mention has to do with the -c option. As the man reads at the beggining
Rsync finds files that need to be transferred using a lqquick checkrq algorithm (by default) that looks for files that have changed in size or in last-modified time. Any changes in the other preserved attributes (as requested by options) are made on the destination file directly when the quick check indicates that the file's data does not need to be updated.
with the -c option it checks if two files are of equal size, and if so checks the checksums of the two.
rsync also verifies the transfer of the file through the network, not the disk. If you want to make sure that your data are not corrupted you could use utilities like md5sum.
as a side note: I don't think that this procedure qualifies as an "incremental backup" since incremental backups stores the differences to the system from an earlier backup. I think "incremental transfer" is more appropriate.