Tuesday, February 24, 2015

Permissions on files created by Linux in NTFS

I'm trying to mount NTFS filesystem in Linux with the following settings:




  1. In Linux all files and directories in NTFS should be owned by root
    and have a group win. Permissions should be set to 775.

  2. All files and directories created by Linux in NTFS filesystem should

    have in Windows the same ownership and permissions as a directory
    containing newly created file or directory.



To this end, I've added the following record to fstab:



/dev/sda7 /mnt/win/users_data ntfs-3g noauto,inherit,usermapping=/etc/ntfs-3g.usermapping,uid=0,gid=1002,umask=0002 0 0


Here is a content of the /etc/ntfs-3g.usermapping file:




:win:S-1-5-21-3452292639-2475245894-2622236828-1002
:win:S-1-5-21-3452292639-2475245894-2622236828-1003
:win:S-1-5-21-3452292639-2475245894-2622236828-1005
:win:S-1-5-21-3452292639-2475245894-2622236828-1004
:win:S-1-5-21-3452292639-2475245894-2622236828-1009
...


When the filesystem is mounted, the following message appears in console:




$ sudo mount /mnt/win/users_data
There were no valid user or no valid group


Files and directories in mounted filesystem have the right ownership and permissions in Linux (root:win 775). But in Windows all users is permitted to do all operations over files created by Linux in the filesystem.



What am I doing wrong? And how to mount NTFS filesystem in the way described above?

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...