How do I use rsync to reliably transfer permissions & ACLs when copying from NTFS internal C: to NTFS External disk?

7,210

I've been looking at this over the last several days, and after reading lots of references and actually trying out various combinations of flags, I don't think that rsync will carry Windows ACLs.

rsync -aX src/ dst/
rsync: extended attributes are not supported on this client

I found this recommendation to remount the Cygwin view of the local NTFS drives with noacl, but I couldn't get that to work usefully for me. Another suggestion to use --chmod=ugo=rwX didn't help at all.

It seems that for this particular use case you'll need to use something like ROBOCOPY /SEC instead of rsync.

Share:
7,210

Related videos on Youtube

Alex S
Author by

Alex S

Updated on September 18, 2022

Comments

  • Alex S
    Alex S over 1 year

    What options of Rsync can I reliably use/ how/ combine to either:

    • RELIABLY TRANSFER "working" even if "limited set" of Permissions/ ACLs reliably & without conflict between the Gray area of Cygwin Windows/ NTFS & *Nix / Perms etc
      OR

    • Flush clean / have RSync totally avoid Permissions / ACL issues if I cant do the above?

    I've read close to 50 tabs and windows on what to do around this from the last decade or so.

    At how to deal with it seems to change based on where & who you are asking and what version of Rsync (time & variation/ alternative code base) is being talked about.

    • Rsync variations under Windows
      • (Several *Nix & Windows: Cygwin variations, CwRsync, Delta Copy/ Syncrify/ Synaman, GRsync, RsyncBackup, Rsync.exe pkg, Rclone, AcroSync, YInterSync)

    Options to choose:

    The answer on how to execute RSync for this specific scenario I've got from this QnA;

    But after gathering all the "knowledge" on RSync around Cygwin, NTFS, Permissions & ACLs etc, I am not sure what variation does what to make a decision on how to proceed.

    It turns out that to keep your Windows permissions in check, a simple chmod flag is required.
    —chmod=ugo=rwX

    Rsync Options (some..)

     -p, --perms                 preserve permissions
     -E, --executability         preserve the file's executability
         --chmod=CHMOD           affect file and/or directory permissions
    
     -A, --acls                  preserve ACLs (implies --perms)
     -o, --owner                 preserve owner (super-user only)
     -g, --group                 preserve group
         --devices               preserve device files (super-user only)
         --specials              preserve special files
     -D                          same as --devices --specials
    
    
    

    /etc/fstab (addition of noacl)

    
    # /etc/fstab
    #
    #    This file is read once by the first process in a Cygwin process tree.
    #    To pick up changes, restart all Cygwin processes.  For a description
    #    see https://cygwin.com/cygwin-ug-net/using.html#mount-table
    
    # This is default anyway:
    # none /cygdrive cygdrive binary,posix=0,user 0 0
    none /cygdrive cygdrive binary,posix=0,user,noacl 0 0
    
    
    • Alex S
      Alex S over 4 years
      @roaima - Not asking for documentation but clarity between various options / permissions/ ACLs one can choose here. Let me rephrase and add
    • Alex S
      Alex S over 4 years
      @roaima - Updated: Basically best case variation of TRANSFER or NONE? How?
    • Alex S
      Alex S over 4 years
      Not planning to transfer to Unix, But that "translation" between Win & *Unix is an issue, as Rsync reads from Win & Rewrites to Win in the above operation. So during "translation" how much can it CARRY across in a Kosher fashion?
    • schily
      schily over 4 years
      OK, then I did missunderstand you. Cygwin is bug by bug linux compatible and there is little hope that the ACL situation will change anytime soon.
    • Alex S
      Alex S over 4 years
      @schily - Yet, I am curious - Do modern non Linux UNixs use translateable ACLs? As you mentioned? Which ones are these?