You can't at all, unless you know in advance what SID your user will have on the new Windows install (which is not predictable like UID's are on UNIX systems).
Assuming you have some way of knowing what SID you will have, you can functionally replicate ownership and basic ACE's by using regular UNIX commands and the NTFS-3G username mapping functionality. See the 'User Mapping' section of the NTFS-3G manpage for info on how to set that up. Once that is set up, you can use regular UNIX commands to manipulate ownership and basic permissions of files (IIRC, POSIX read permission translates to 'Read' and 'Read & Execute' Windows permissions, and POSIX write translates to 'Modify', but I don't remember any beyond that).
As far as I know, there is no way from Linux to copy all Windows ACE's.
One slight side note, you probably want to copy NTFS Alternate Data Streams too. You can do this easily with UNIX tools that support Linux xattrs (provided you don't supply a streams-interface
option to NTFS-3G, it will default to exposing them as xattrs).
cp ~/foo ~/bar/baz
or a move commandmv ~/foo ~/bar/baz
. In either case~/foo
is the source file, and~/bar/baz
the target file, and if we accept~
as a given, those are full pathnames as well. In your Q the full pathnames of both source and target may well be relevant; the question is incomplete without them. Granted you wish to do this for a directory and its contents, but the pathnames remain relevant. – agc Apr 25 '18 at 01:07