rsync“不允许操作”

Tim*_*ter 9 rsync

我正在尝试将简单的 rsync 同步到 USB 硬盘,命令是

rsync -az --modify-window=2 /home /mnt/exthd/tmp/

我以 root 身份运行它。

但我收到很多错误,似乎都与权限不足有关:

rsync: chown "/mnt/exthd/tmp/home/someuser" failed: Operation not permitted (1)
rsync: chown "/mnt/exthd/tmp/home/someuser/.bash_logout" failed: Operation not permitted (1)
rsync: chown "/mnt/exthd/tmp/home/someuser/.bash_profile" failed: Operation not permitted (1)
rsync: chown "/mnt/exthd/tmp/home/someuser/.bashrc" failed: Operation not permitted (1)
rsync: chown "/mnt/exthd/tmp/home/guest" failed: Operation not permitted (1)
rsync: chown "/mnt/exthd/tmp/home/guest/.bash_logout" failed: Operation not permitted (1)
rsync: chown "/mnt/exthd/tmp/home/guest/.bash_profile" failed: Operation not permitted (1)
rsync: chown "/mnt/exthd/tmp/home/guest/.bashrc" failed: Operation not permitted (1)
rsync: symlink "/mnt/exthd/tmp/home/guest/fred2" -> "fred" failed: Operation not permitted (1)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1042) [sender=3.0.7]
Run Code Online (Sandbox Code Playgroud)

这是 3.0.7 版。我曾尝试使用 --super 选项无效。有任何想法吗?

Cal*_*leb 14

FAT 文件系统(Linux 的挂载称为 vfat)无法在 Linux 端存储有关文件的某些权限和所有权数据。

您的选择似乎是:

  • 使用 ext3/4 或其他支持这些属性的文件系统格式化磁盘。我认为如果您与 Windows 共享,即使是 NTFS 也能完成这项工作。
  • 使用--fake-super选项存储这些额外的属性,以便 rsync 在文件中写入 xattrs 而不是使用文件系统属性
  • 忽略错误,这些属性将丢失。
  • 将您的数据集包装在一个 tar 文件中,并将该 tar 文件放在 FAT 系统上。所有属性都得到维护,如果您提取它就会出现。