This is what it looks like.
Code: Select all
drwxr-xr-x. 2 pial pial 4096 Nov 12 14:58 1
drwxrwxrwx. 1 root root 12288 Nov 10 06:42 2 <-----drive one
drwxrwxrwx. 1 pial users 20480 Nov 10 06:48 3 <-----drive two
drwxr-xr-x. 2 pial pial 4096 Nov 12 15:00 cdrom
drwxr-xr-x. 2 pial pial 4096 Nov 12 14:47 usb
These commands does not work. Not as root either.
Code: Select all
chmod -R 755 /media/2
chmod -R 755 /media/3
chown -R pial:pial /media/2
...........
http://askubuntu.com/questions/342791/f ... ont-change
http://askubuntu.com/questions/11840/ho ... 1054#91054
I tried this solution but it did not work. This is my /etc/fstab
Code: Select all
#
# /etc/fstab
# Created by anaconda on Thu Nov 12 14:38:48 2015
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/centos-root / ext4 defaults 1 1
UUID=a83fa641-e851-4dd0-99f2-cc4bb7f811ff /boot ext4 defaults 1 2
/dev/mapper/centos-home /home ext4 defaults 1 2
/dev/mapper/centos-pandora_l /mnt/data ext4 defaults 1 2
/dev/mapper/centos-swap swap swap defaults 0 0
UUID=1AD4F0A3D4F081F5 /media/2 ntfs-3g defaults,users,locale=en_US.utf8,exec,permissions,uid=1000,gid=100 0 0
UUID=D83CFF6F3CFF46D2 /media/3 ntfs-3g defaults,users,locale=en_US.utf8,exec,permissions,uid=1000,gid=100 0 0
http://unix.stackexchange.com/questions ... filesystem
What is going wrong here? Any solution?
SOLUTION:
NTFS filesystem cannot use linux filesystem permissions like native linux partitions ,e.g. ext4, do. This is why chmod and chown do not work. So, a virtual permission is given to the files. It is done when mounting the partition. So, any and all kind of ownership and file access permission needs to be set when mounting. This is my final version of /etc/fstab that solved my problem.Here,
directory permission = drwxr-xr-x
file permission = -rw-rw-r--
Code: Select all
#/dev/sdb2 on /media/2 on startup
UUID=1AD4F0A3D4F081F5 /media/2 ntfs-3g defaults,exec,locale=en_US.utf8,permissions,inherit,dmask=022,fmask=113,uid=1000,gid=1000 0 0
#/dev/sdb3 on /media/3 on startup
UUID=D83CFF6F3CFF46D2 /media/3 ntfs-3g defaults,exec,locale=en_US.utf8,permissions,inherit,dmask=022,fmask=113,uid=1000,gid=1000 0 0
Code: Select all
sudo mount -t ntfs-3g -o uid=1000,gid=1000,dmask=022,fmask=113,utf8,nls=en_US.utf8 /dev/sdb2 /media/2/
my desired permission for files is 664 . The octal version is 777 - 664 = 113
To find out what should be your ownership and permission, you can check the followings:
For mount options:
man ntfs-3g
man mount
For permissions:
http://ubuntuforums.org/showthread.php?t=1453342 -- Don't forget to read it to the end in the next page. The last answer is also good.
http://linuxzoo.net/page/sec_umask.html
http://permissions-calculator.org/info/