1

I just rsync'd a bunch of files, from a Windows box running cygwin sshd, to a CentOS 6.4 box. I ran rsync -e sshd... on CentOS to do this.

Then I plugged in a USB drive on the CentOS box, formatted as ext4 using mkfs.ext4, and mounted it at /mnt/backup (with no extra options). Then I did chown on /mnt/backup, and ran rsync -vrlptg to copy the files from the CentOS box to /mnt/backup. A handful of random files (a few dozen of a few hundred thousand, mainly from 4 different directories, but not all of the files in those directories) failed with permissions errors. But when I ls -l on the CentOS box, it shows that I own all of them.

If I sudo rsync instead, it copies everything without complaining.

Why does it seem that rsync thinks I don't have permission to copy my own files to my own drive?

Update: although earlier it said myuser owned them, I've since run a sudo rsync -e sshd and now most (but not all) files, despite being in a folder in my home drive on the CentOS box (/home/myuser) are now no longer owned by myuser myuser but instead are owned by 513 or dialout, which I never set up as users.

4
  • 2
    There is not enough detail to provide a full answer, but it seems that the problem is when rsync tries to set the permissions to someone other than you. If you could add an ls -l output of the source files, in the CentOS box, it could shed some more light.
    – Didi Kohen
    Commented Jul 20, 2013 at 15:44
  • 1
    Can you provide the mount command + options you used to mount the USB drive?
    – slm
    Commented Jul 20, 2013 at 15:55
  • @DavidKohen, I tried to provide a bit more detail, but I'm generally afraid of exposing sensitive information. Could you tell me what you're looking for specifically? Also hopefully my update provided a bigger clue anyway than the original ls -l I was looking at might have. For the Windows->CentOS transfer I thought rsync wasn't able to transfer permissions info (coming from NTFS). Then from CentOS to the backup I don't understand why it would be trying that nor who these two other users are.
    – Kev
    Commented Jul 20, 2013 at 16:34
  • @slm please see question update too.
    – Kev
    Commented Jul 20, 2013 at 16:35

1 Answer 1

1

I wonder if your issue is related to this excerpt I found on a blog detailing how to use Cygwin, rsync, and ssh? Th title of the article is: SSH and Rsync within Cygwin.

When using an NTFS file system, Cygwin will, by default, apply posix-style file permissions using NTFS file permissions. In some cases this may not be desirable as this can make it difficult to work with the files on the Windows server outside of Cygwin. This behavior can be altered by modifying the /etc/fstab file. Simply add/edit the line in this file to read as follows:

none /cygdrive cygdrive user,noacl,posix=0 0 0

This would explain why the permissions were showing up as UID 513 or user dialout.

3
  • Just to be clear, this is /etc/fstab on the CentOS box, not within the cygwin terminal on the Windows box?
    – Kev
    Commented Jul 20, 2013 at 18:25
  • @Kev - no I believe that's a fstab file on the cygwin install. I don't have cygwin around so I couldn't confirm this though.
    – slm
    Commented Jul 20, 2013 at 18:33
  • 1
    @Kev - the file is definitely on the cygwin side, it's discussed here in the docs: cygwin.com/cygwin-ug-net/using.html#mount-table
    – slm
    Commented Jul 20, 2013 at 20:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .