Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
    
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 Aug 29 '13 at 16:57
    
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: mjmwired.net/kernel/Documentation/filesystems/fuse.txt –  Frank Thomas Aug 29 '13 at 17:08

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer
    
Thank you for the answer. Can I mount it automatically using your command as the system boots? –  HAL9000 Aug 29 '13 at 17:44
    
@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 Aug 29 '13 at 17:46
    
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 Aug 29 '13 at 17:49
    
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 Aug 29 '13 at 18:09
    
I simply appended that line in /etc/fstab and it works. However now all the files on the drive are flagged as executable –  HAL9000 Aug 29 '13 at 18:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.