Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
add comment

migrated from stackoverflow.com Dec 24 '10 at 5:32

This question came from our site for professional and enthusiast programmers.

2 Answers

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).

share|improve this answer
    
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.) –  grawity Oct 24 '11 at 23:32
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.