Cannot chown, chmod on mounted ntfs partition












2














I need to mount a ntfs partition and be able to use it with unix file system permissions. The problem is that, when I mount the partition using the following fstab entry, I cannot run chown and chmod successfully. It executes without error, but the file access rights are not changed.



PARTUUID=c3e3b171-d451-44e6-9f17-ffbe9e220dc7   /mnt/mounted_drive  ntfs-3g  defaults,umask=0022,uid=1000,gid=1000,errors=remount-ro,permissions 0 2


When I mount the partition without setting umask, uid, and gid I can use previously mentioned commands successfully.



PARTUUID=c3e3b171-d451-44e6-9f17-ffbe9e220dc7   /mnt/mounted_drive  ntfs-3g  defaults,errors=remount-ro,permissions 0 2


What shall I do to mount the partition properly?










share|improve this question




















  • 1




    On Unix-like operating systems such as Linux, MacOS, BSD, etc, you can run chown and chmod on ntfs filesystems but they aren't going to have any effect on the actual permissions. Does the filesystem absolutely need to be ntfs?
    – Nasir Riley
    Dec 27 '18 at 20:05










  • I've read that the permissions option in fstab entry allows you to use permissions but without compatibility with windows, which I don't need. It seemed to work with the second mount. In the future I am planning to reformat the partition to ext4, but currently don't have free space to backup the data.
    – icepopo
    Dec 28 '18 at 8:04












  • The permissions option just allows permissions and rights to be set with individual files and options inside which is default. The command will work on an ntfs filesystem but it will have no effect.
    – Nasir Riley
    Dec 28 '18 at 20:28
















2














I need to mount a ntfs partition and be able to use it with unix file system permissions. The problem is that, when I mount the partition using the following fstab entry, I cannot run chown and chmod successfully. It executes without error, but the file access rights are not changed.



PARTUUID=c3e3b171-d451-44e6-9f17-ffbe9e220dc7   /mnt/mounted_drive  ntfs-3g  defaults,umask=0022,uid=1000,gid=1000,errors=remount-ro,permissions 0 2


When I mount the partition without setting umask, uid, and gid I can use previously mentioned commands successfully.



PARTUUID=c3e3b171-d451-44e6-9f17-ffbe9e220dc7   /mnt/mounted_drive  ntfs-3g  defaults,errors=remount-ro,permissions 0 2


What shall I do to mount the partition properly?










share|improve this question




















  • 1




    On Unix-like operating systems such as Linux, MacOS, BSD, etc, you can run chown and chmod on ntfs filesystems but they aren't going to have any effect on the actual permissions. Does the filesystem absolutely need to be ntfs?
    – Nasir Riley
    Dec 27 '18 at 20:05










  • I've read that the permissions option in fstab entry allows you to use permissions but without compatibility with windows, which I don't need. It seemed to work with the second mount. In the future I am planning to reformat the partition to ext4, but currently don't have free space to backup the data.
    – icepopo
    Dec 28 '18 at 8:04












  • The permissions option just allows permissions and rights to be set with individual files and options inside which is default. The command will work on an ntfs filesystem but it will have no effect.
    – Nasir Riley
    Dec 28 '18 at 20:28














2












2








2


1





I need to mount a ntfs partition and be able to use it with unix file system permissions. The problem is that, when I mount the partition using the following fstab entry, I cannot run chown and chmod successfully. It executes without error, but the file access rights are not changed.



PARTUUID=c3e3b171-d451-44e6-9f17-ffbe9e220dc7   /mnt/mounted_drive  ntfs-3g  defaults,umask=0022,uid=1000,gid=1000,errors=remount-ro,permissions 0 2


When I mount the partition without setting umask, uid, and gid I can use previously mentioned commands successfully.



PARTUUID=c3e3b171-d451-44e6-9f17-ffbe9e220dc7   /mnt/mounted_drive  ntfs-3g  defaults,errors=remount-ro,permissions 0 2


What shall I do to mount the partition properly?










share|improve this question















I need to mount a ntfs partition and be able to use it with unix file system permissions. The problem is that, when I mount the partition using the following fstab entry, I cannot run chown and chmod successfully. It executes without error, but the file access rights are not changed.



PARTUUID=c3e3b171-d451-44e6-9f17-ffbe9e220dc7   /mnt/mounted_drive  ntfs-3g  defaults,umask=0022,uid=1000,gid=1000,errors=remount-ro,permissions 0 2


When I mount the partition without setting umask, uid, and gid I can use previously mentioned commands successfully.



PARTUUID=c3e3b171-d451-44e6-9f17-ffbe9e220dc7   /mnt/mounted_drive  ntfs-3g  defaults,errors=remount-ro,permissions 0 2


What shall I do to mount the partition properly?







mount fstab ntfs






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 27 '18 at 19:59

























asked Dec 27 '18 at 10:41









icepopo

1112




1112








  • 1




    On Unix-like operating systems such as Linux, MacOS, BSD, etc, you can run chown and chmod on ntfs filesystems but they aren't going to have any effect on the actual permissions. Does the filesystem absolutely need to be ntfs?
    – Nasir Riley
    Dec 27 '18 at 20:05










  • I've read that the permissions option in fstab entry allows you to use permissions but without compatibility with windows, which I don't need. It seemed to work with the second mount. In the future I am planning to reformat the partition to ext4, but currently don't have free space to backup the data.
    – icepopo
    Dec 28 '18 at 8:04












  • The permissions option just allows permissions and rights to be set with individual files and options inside which is default. The command will work on an ntfs filesystem but it will have no effect.
    – Nasir Riley
    Dec 28 '18 at 20:28














  • 1




    On Unix-like operating systems such as Linux, MacOS, BSD, etc, you can run chown and chmod on ntfs filesystems but they aren't going to have any effect on the actual permissions. Does the filesystem absolutely need to be ntfs?
    – Nasir Riley
    Dec 27 '18 at 20:05










  • I've read that the permissions option in fstab entry allows you to use permissions but without compatibility with windows, which I don't need. It seemed to work with the second mount. In the future I am planning to reformat the partition to ext4, but currently don't have free space to backup the data.
    – icepopo
    Dec 28 '18 at 8:04












  • The permissions option just allows permissions and rights to be set with individual files and options inside which is default. The command will work on an ntfs filesystem but it will have no effect.
    – Nasir Riley
    Dec 28 '18 at 20:28








1




1




On Unix-like operating systems such as Linux, MacOS, BSD, etc, you can run chown and chmod on ntfs filesystems but they aren't going to have any effect on the actual permissions. Does the filesystem absolutely need to be ntfs?
– Nasir Riley
Dec 27 '18 at 20:05




On Unix-like operating systems such as Linux, MacOS, BSD, etc, you can run chown and chmod on ntfs filesystems but they aren't going to have any effect on the actual permissions. Does the filesystem absolutely need to be ntfs?
– Nasir Riley
Dec 27 '18 at 20:05












I've read that the permissions option in fstab entry allows you to use permissions but without compatibility with windows, which I don't need. It seemed to work with the second mount. In the future I am planning to reformat the partition to ext4, but currently don't have free space to backup the data.
– icepopo
Dec 28 '18 at 8:04






I've read that the permissions option in fstab entry allows you to use permissions but without compatibility with windows, which I don't need. It seemed to work with the second mount. In the future I am planning to reformat the partition to ext4, but currently don't have free space to backup the data.
– icepopo
Dec 28 '18 at 8:04














The permissions option just allows permissions and rights to be set with individual files and options inside which is default. The command will work on an ntfs filesystem but it will have no effect.
– Nasir Riley
Dec 28 '18 at 20:28




The permissions option just allows permissions and rights to be set with individual files and options inside which is default. The command will work on an ntfs filesystem but it will have no effect.
– Nasir Riley
Dec 28 '18 at 20:28










1 Answer
1






active

oldest

votes


















1














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.






share|improve this answer










New contributor




gimpf is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.














  • 1




    Perhaps you could add a reference link such as: tuxera.com/community/ntfs-3g-advanced/ownership-and-permissions/… ?
    – A.B
    yesterday










  • That is a nice page, and I'll also recheck whether the comment "the last number in the SID must be greater than the equivalent number for any explicitly mapped user" makes my "all must be explicit" issue goes away. This would more or less make my whole answer obsolete ^_^
    – gimpf
    yesterday










  • Before reading your answer I didn't know it was possible heh. Then I looked at tuxera.
    – A.B
    yesterday











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f491098%2fcannot-chown-chmod-on-mounted-ntfs-partition%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














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.






share|improve this answer










New contributor




gimpf is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.














  • 1




    Perhaps you could add a reference link such as: tuxera.com/community/ntfs-3g-advanced/ownership-and-permissions/… ?
    – A.B
    yesterday










  • That is a nice page, and I'll also recheck whether the comment "the last number in the SID must be greater than the equivalent number for any explicitly mapped user" makes my "all must be explicit" issue goes away. This would more or less make my whole answer obsolete ^_^
    – gimpf
    yesterday










  • Before reading your answer I didn't know it was possible heh. Then I looked at tuxera.
    – A.B
    yesterday
















1














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.






share|improve this answer










New contributor




gimpf is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.














  • 1




    Perhaps you could add a reference link such as: tuxera.com/community/ntfs-3g-advanced/ownership-and-permissions/… ?
    – A.B
    yesterday










  • That is a nice page, and I'll also recheck whether the comment "the last number in the SID must be greater than the equivalent number for any explicitly mapped user" makes my "all must be explicit" issue goes away. This would more or less make my whole answer obsolete ^_^
    – gimpf
    yesterday










  • Before reading your answer I didn't know it was possible heh. Then I looked at tuxera.
    – A.B
    yesterday














1












1








1






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.






share|improve this answer










New contributor




gimpf is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









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.







share|improve this answer










New contributor




gimpf is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this answer



share|improve this answer








edited yesterday





















New contributor




gimpf is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









answered 2 days ago









gimpf

1113




1113




New contributor




gimpf is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





gimpf is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






gimpf is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








  • 1




    Perhaps you could add a reference link such as: tuxera.com/community/ntfs-3g-advanced/ownership-and-permissions/… ?
    – A.B
    yesterday










  • That is a nice page, and I'll also recheck whether the comment "the last number in the SID must be greater than the equivalent number for any explicitly mapped user" makes my "all must be explicit" issue goes away. This would more or less make my whole answer obsolete ^_^
    – gimpf
    yesterday










  • Before reading your answer I didn't know it was possible heh. Then I looked at tuxera.
    – A.B
    yesterday














  • 1




    Perhaps you could add a reference link such as: tuxera.com/community/ntfs-3g-advanced/ownership-and-permissions/… ?
    – A.B
    yesterday










  • That is a nice page, and I'll also recheck whether the comment "the last number in the SID must be greater than the equivalent number for any explicitly mapped user" makes my "all must be explicit" issue goes away. This would more or less make my whole answer obsolete ^_^
    – gimpf
    yesterday










  • Before reading your answer I didn't know it was possible heh. Then I looked at tuxera.
    – A.B
    yesterday








1




1




Perhaps you could add a reference link such as: tuxera.com/community/ntfs-3g-advanced/ownership-and-permissions/… ?
– A.B
yesterday




Perhaps you could add a reference link such as: tuxera.com/community/ntfs-3g-advanced/ownership-and-permissions/… ?
– A.B
yesterday












That is a nice page, and I'll also recheck whether the comment "the last number in the SID must be greater than the equivalent number for any explicitly mapped user" makes my "all must be explicit" issue goes away. This would more or less make my whole answer obsolete ^_^
– gimpf
yesterday




That is a nice page, and I'll also recheck whether the comment "the last number in the SID must be greater than the equivalent number for any explicitly mapped user" makes my "all must be explicit" issue goes away. This would more or less make my whole answer obsolete ^_^
– gimpf
yesterday












Before reading your answer I didn't know it was possible heh. Then I looked at tuxera.
– A.B
yesterday




Before reading your answer I didn't know it was possible heh. Then I looked at tuxera.
– A.B
yesterday


















draft saved

draft discarded




















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f491098%2fcannot-chown-chmod-on-mounted-ntfs-partition%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

is 'sed' thread safe

How to make a Squid Proxy server?