chmod 777 no effects on Linux Mint

1

2

I'm trying to assign run privileges to a file named foobar using:

sudo chmod 777 foobar

However nothing happens. The file is located on a NTFS mounted partition. The mount command says:

/dev/sda4 on /media/DATA type fuseblk (rw,nosuid,nodev,allow_other,default_permissions,blksize=4096)

The command

ls -l foobar

run after chmod says:

-rw------- 1 myusername myusername 2261603 Aug 29 17:54 foobar

Can somebody help me, please?

HAL9000

Posted 2013-08-29T16:54:07.940

Reputation: 141

Also, you could try running "sudo chmod a+x foobar" just to see if you get a different result, though I doubt you would. – Jack – 2013-08-29T16:57:16.113

Linux permissions don't work right on NTFS volumes mounted via fuse. you have to set the access modifiers in the fstab or the mount command. see the fuse options here: http://www.mjmwired.net/kernel/Documentation/filesystems/fuse.txt

– Frank Thomas – 2013-08-29T17:08:35.757

Answers

5

NTFS does not handle file permissions in the same was as Linux, as explained in the ntfs-3g FAQ:

Why have chmod and chown no effect? [sic]

By default files on NTFS are owned by root with full access to everyone. To get standard per-file protection you should mount with the “permissions” option. Moreover, if you want the permissions to be interoperable with a specific Windows configuration, you have to map the users.

So, either modify your /etc/fstab with the appropriate options: (I changed default_permissions to permissions):

/dev/sda4 /media/DATA ntfs rw,nosuid,nodev,allow_other,permissions,blksize=4096

or, just unmount and remount manually:

sudo umount /media/DATA
sudo mount -t ntfs -o rw,nosuid,nodev,relatime,permissions /dev/sda4 /media/DATA

You should now be able to change permissions normally with sudo chmod.

terdon

Posted 2013-08-29T16:54:07.940

Reputation: 45 216

Thank you for the answer. Can I mount it automatically using your command as the system boots? – HAL9000 – 2013-08-29T17:44:57.820

@HAL9000 yes, modify /etc/fstab as I have shown in my answer and next time you reboot, it will be mounted with the right options. – terdon – 2013-08-29T17:46:33.210

should I only append that line in /etc/fstab? Or should I do something other? I was trying to read some tutorials but I don't know what UUID is – HAL9000 – 2013-08-29T17:49:43.407

a UUID is a name for your device, just like '\dev\sda1'. you can find your uuid from a terminal with 'ls -a /dev/disk/by-uuid' – Frank Thomas – 2013-08-29T18:09:38.807

I simply appended that line in /etc/fstab and it works. However now all the files on the drive are flagged as executable – HAL9000 – 2013-08-29T18:10:43.077

@HAL9000 OK, but make sure you don't have two entries mounting the same disk in fstab. And yes, I think that the only way to do this is having all files marked as executable but that should not be a problem since NTFS partitions should never be used as a main working partition in Linux. – terdon – 2013-08-29T18:12:15.687