I'm trying to backup my whole server using a simple rsync on a NFS mounted volume on '/nas'
Here's my rsync command
rsync -sav -S --stats -H --numeric-ids --delete -D
--exclude-from="/usr/local/bin/rsync_nas1_exclude" / /nas1/
Getting the following error :
rsync: chown "/nas1/home/8003/.local/share/icons/application-x-wine-extension-its.png"
failed: Invalid argument (22)
or
rsync: chown "/nas1/home/8003/.local/share/applications/wine/Programs/FxPro - Trader" failed: Invalid argument (22)
Any idea why ? I use the '-s' param to protect file names
The error is on
chown
. My guess : your target NFS mount is a FAT32 or NTFS volume that doesn't supportchown
. You have two options : format it with a Linux filesystem like ext3, or drop rights and owners entirely (--no-owner --no-group
rsync options).I've been having the same problem for a long time with no solution in sight. The issue seems to be that NFS won't let you change a file's UID/GID to ones that don't exist on the server:
It seems this is a bit of a design flaw in NFS; you can't use it to back up files owned by someone who doesn't exist on the server. But maybe there's a way to disable this check?
In my case the issue turned out to be the NFS version. With NFSv4, uid/gid that did not exist at the server side were not allowed, whereas NFSv3 (as long as it was exported with
no_root_squash
) did not mind. So after I addedvers=3
to the mount options in/etc/fstab
rsync was able to chown just fine.