How do I use rsync to reliably transfer permissions & ACLs when copying from NTFS internal C: to NTFS External disk?
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
.
Related videos on Youtube
Alex S
Updated on September 18, 2022Comments
-
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
ORFlush 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:
- https://georgik.rocks/how-to-fix-incorrect-cygwin-permission-inwindows-7/
- https://duncanbowring.wordpress.com/2019/01/30/cygwin-rsync-windows-permissions/
- https://blag.nullteilerfrei.de/2014/04/07/keep-cygwin-applications-from-setting-ntfs-security-descriptors/
- more..
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 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 over 4 years@roaima - Updated: Basically best case variation of TRANSFER or NONE? How?
-
Alex S over 4 yearsNot 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 over 4 yearsOK, 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 over 4 years@schily - Yet, I am curious - Do modern non Linux UNixs use translateable ACLs? As you mentioned? Which ones are these?