rsync icon indicating copy to clipboard operation
rsync copied to clipboard

failure when using --inplace to copy some files with xattrs (rw-r-----+)

Open Steve-Newcomb opened this issue 10 months ago • 0 comments

I observe that rsync fails when --inplace is used to copy certain files with extended attributes (rw-r-----+). For me this occurs when copying system journal files from one ext4 filesystem to another ext4 filesystem, so it's not a filesystem incompatibility or file naming problem. Trial and error reveals that there's no problem when --inplace is not specified.

Here's an example of a failing command and the self-denying and misleading error message "sync: [receiver] lseek returned 22529032, not 22529032: Invalid argument (22)".

echo '.cache/.gvfs .cache/doc .cache/gvfs .gvfs /lib/lxcfs /lib/mlocate/* nobackup/* ' | rsync --inplace --stats --rsync-path="ionice -c 2 -n 7 nice -n 17 rsync" --protect-args -a -H -z --exclude-from - --delete-during --delete-excluded --force --backup "--backup-dir=/nobackup/umesh-backup/umesh-_,.,_var-previous" "--suffix=-20250309-084023q6X" "/var/" "qat:/nobackup/umesh-backup/umesh-_,.,_var"                                                                              
rsync: [receiver] lseek returned 22529032, not 22529032: Invalid argument (22)  
rsync: [receiver] write failed on "/nobackup/umesh-backup/umesh-_,.,_var/log/journal/9ff4e62c7c154c86bff59bc5f13f97ec/system.journal": Invalid argument (22)    
rsync error: error in file IO (code 11) at receiver.c(381) [receiver=3.2.7]    

The same command works fine if "--inplace" is not used in it.

Steve-Newcomb avatar Mar 09 '25 13:03 Steve-Newcomb