5

I try to sync two directories using rsync.

the source is on Linux, and the other is on windows.

So, I mount the directory on windows using the command mount -t cifs ..... in Linux system.

Then I execute rsync ....

Everything is OK, but rsync prints out

rsync: chown "/mnt/windows/A/." failed: Permission denied (13)
rsync: chown "/mnt/windows/A/readme.txt" failed: Permission denied (13)

I want to sync the directories without changing ownership.

How can I do? please let me know.

Thanks in advance.

2 Answers 2

2

What rsync options are you using? You probably want to add --no-owner, --no-group, and maybe --no-perms.

2

The options mentioned by ysth should suppress those warnings, but, really, you can just ignore them as the visual noise they are.

The actual problem here is that, after copying the files, changing their ownership fails because Windows filesystems don't support ownership (or at least not in the way *nix does it). When a Windows filesystem is mounted, Linux assigns one user and group to be treated as the owner of all files on that fs and this cannot be changed on a file-by-file basis. As a result, it is not possible to preserve file ownership when copying to a Windows filesystem (and, even if you could, your custom ownership would be lost the next time that filesystem got mounted).

1
  • Not necessarily true for NTFS or CIFS filesystems. For CIFS, though, Windows just does not allow giving away ownership without sufficient privileges. (This does not apply to this particular question, though; the Linux CIFS client indeed doesn't support file ownership on Windows shares.) Oct 24, 2011 at 23:32

You must log in to answer this question.