With NTFS-3G, setting the owning user and group seems only to be possible when a UserMapping file containing a mapping for the targeted user/group is present. This is not really clear from the documentation, but I'm testing it just now and that is what is happening.
If compatibility with an existing Windows installation is not needed, create an empty file .NTFS-3G/UserMapping
on the mounted partition and fill it via:
getRUI4() { od -An -N4 -tu4 /dev/random | tr -d ' '; }
USERMAPPING=/media/NTFS_PARTITION/.NTFS-3G/UserMapping
echo ":users:S-1-5-21-$(getRUI4)-$(getRUI4)-$(getRUI4)-513" | sudo tee -a $USERMAPPING >/dev/null
echo "$(id -un):$(id -gn):S-1-5-21-$(getRUI4)-$(getRUI4)-$(getRUI4)-1001" | sudo tee -a $USERMAPPING >/dev/null
If you want to use existing Windows SIDs, you can instead use the program ntfsusermap
on an unmounted (!) partition, which will interactively ask you to specify user- and group-names (do not need to be numeric, regardless of the message) for given paths where it first finds an as of yet unmapped ID. This is quick to do.
User and group root
is mapped by default, as is other
. The above lines will create a mapping for users
group, and the current user. Repeat as necessary.
Also, in my case, I mount the drive with the options
no_def_opts,allow_other,acl,nodev,nosuid,big_writes,hide_dot_files
However, in your case you should not need any of them, although I find that these options improve upon the default, as otherwise for instance chown/chmod
fail silently in case of errors.
chown
andchmod
onntfs
filesystems but they aren't going to have any effect on the actual permissions. Does the filesystem absolutely need to bentfs
?permissions
option just allows permissions and rights to be set with individual files and options inside which is default. The command will work on anntfs
filesystem but it will have no effect.