Set usermap.
sudo ntfsusermap /dev/sdb2
#assign user as www-data
#assign group as www-data
Mount ntfs partition /dev/sdb2
with /mnt/winntfs
.
sudo ntfs-3g -o permissions /dev/sdb2 /mnt/winntfs
Now i can use chmod
for directory in /mnt/winntfs
.
sudo chmod -R 755 /mnt/winntfs/mydoc
ls -al /mnt/winntfs/mydoc
total 38
drwxr-xr-x 1 www-data www-data 4096 Aug 17 20:03 .
drwxrwxrwx 1 root root 4096 Aug 17 20:03 ..
drwxr-xr-x 1 www-data www-data 4096 Aug 17 20:03 analyse
I want to make the mount configure in /etc/fstab
.
sudo blkid | grep sdb2
/dev/sdb2: LABEL="winntfs" UUID="284A29774A2942C4" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="292c184b-766f-4036-8fa0-5bcd936b85c2
sudo vim /etc/fstab
UUID=284A29774A2942C4 /mnt/winntfs ntfs-3g rw ,auto , umask=0022 ,permissions 0 0
Reboot and enter into my os,
ls -al /mnt/winntfs/mydoc
total 38
drwxrwxrwx 1 root root 4096 Aug 17 20:03 .
drwxrwxrwx 1 root root 4096 Aug 17 20:03 ..
drwxrwxrwx 1 root root 4096 Aug 17 20:03 analyse
sudo chmod -R 755 /mnt/winntfs/mydoc
ls -al /mnt/winntfs/mydoc
total 38
drwxrwxrwx 1 root root 4096 Aug 17 20:03 .
drwxrwxrwx 1 root root 4096 Aug 17 20:03 ..
drwxrwxrwx 1 root root 4096 Aug 17 20:03 analyse
The fact is that to set permissions
and umask=0022
in /etc/fstab
can't use chmod
,how to write proper /etc/fstab
to make chmod
to be used after reboot?