rsync无法备份一些文件,给出错误22

我试图使用'/ nas'上的NFS挂载卷上的简单rsync备份整个服务器,

这是我的rsync命令

rsync -sav -S --stats -H --numeric-ids --delete -D --exclude-from="/usr/local/bin/rsync_nas1_exclude" / /nas1/ 

获取以下错误:

 rsync: chown "/nas1/home/8003/.local/share/icons/application-x-wine-extension-its.png" failed: Invalid argument (22) 

要么

 rsync: chown "/nas1/home/8003/.local/share/applications/wine/Programs/FxPro - Trader" failed: Invalid argument (22) 

任何想法为什么? 我使用“-s”参数来保护文件名

错误是在chown 。 我的猜测是:你的目标NFS挂载是不支持chown的FAT32或NTFS卷。 你有两个select:使用ext3等Linux文件系统格式化,或完全删除权限和所有者( --no-owner --no-group rsync options)。

我一直有同样的问题很长一段时间没有解决scheme。 问题似乎是,NFS不会让你把文件的UID / GID改成服务器上不存在的文件:

 # for a local file, it works fine: rena@akira:~ $ sudo chown -v 999:999 testfile changed ownership of `testfile' to 999:999 # but if the file is on an NFS share, it fails: rena@akira:/mnt/yuki $ sudo chown -v 999:999 testfile chown: changing ownership of `testfile': Invalid argument failed to change ownership of `testfile' to 999:999 

看来这在NFS中有点devise上的缺陷; 您不能用它来备份服务器上不存在的人拥有的文件。 但也许有一种方法来禁用此检查?

在我的情况下,问题原来是NFS版本。 在NFSv4中,服务器端不存在的uid / gid是不允许的,而NFSv3(只要是用no_root_squash导出的)不介意。 所以在我添加了vers=3/etc/fstab的mount选项之后,rsync才能够正常工作。