I try to rsync between 2 local disks, thus there is no compression. the sparse file has apparent size of 50GB, actual size of 16GB. I tried rsync -a -P --sparse
, it did generate sparse file on destination at the end. However, it is not as sparse as the source file. The generated file is 27GB instead of 16GB. I can use fallocate -d <filename>
to shrink it more. It became around 18GB. However, this operation takes quite long time. In other hand, cp -a --sparse
can create identical file.
Also the speed is as slow as the rsync command without --sparse
. This is because:
As currently designed, the --sparse option only affects writing of the destination file, not the transfer of the data
However, I am more interested in the remote size. I wonder why rsync did not replicate the exact same size of the source file as cp --sparse=always
?
This even happens when the destination is empty. So i guess this has nothing to do with --inplace
option.
rsync version 3.1.3 protocol version 31
according to @anx, I did some test with --block-size=4096
which yield same file size on remote.