I have an NTFS partition that I want to mount using /etc/fstab. I don't want any files to have executable permissions on this drive, so I wrote the following rule:

/dev/sda2 /media/sharedfolder ntfs auto,user,noatime,noexec,rw,async 0 0

However, I don't believe this will prevent files from being created with executable permissions. It will simply prevent them from being executed. Perhaps this is fine, but is it possible to remove all executable permissions from newly created files on this partition using an /etc/fstab rule?

Would using umask and fmask be enough, like this rule?

/dev/sda2 /media/sharedfolder ntfs auto,user,noatime,noexec,rw,async,umask=0111, 0 0

I'm unsure because Wikipedia lists umask as an option specific to the FAT filesystem.


Wikipedia isn't as good a reference as the man page. Both the the traditional ntfs driver and the now-preferred ntfs-3g support the umask option.

You shouldn't set umask to exclude executable permissions on directories, though, since you can't access files inside a non-executable directory. Instead, use separate values for fmask=0111 (non-directories) and dmask=0777 (directories) (you can omit this one since all bits allowed is the default value).

  • Is ntfs-3g preferred because it's a newer driver (and therefore I would assume has better support, more stability, etc.)? I added fmask=0111 to my options list, and once I remount the partition with mount -a, files created shouldn't be executable when created, correct? – Ricardo Altamirano Feb 27 '13 at 3:53
  • 1
    @RicardoAltamirano ntfs-3g has at least better write support, I don't know the details. mount -a doesn't have any effect if the filesystem is already mounted, you need to unmount it first or run mount -o remount,fmask=0111,… /mount/point. – Gilles 'SO- stop being evil' Feb 27 '13 at 10:58
  • The addition of fmask does just what I need, and thank you for the additional mount command as well. – Ricardo Altamirano Feb 27 '13 at 12:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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