Mounting a Windows partition without giving execute permission

mountntfspermissions

How can I mount a Windows partition so that the files within it don't have execution permission? I mount a Windows partition using:

sudo mount /dev/sda3 win

win is a folder in my home dir.

This of course works. But files in the mounted partition are given execute permission, or to be specific, 777.

How to mount the partition so that files are given 666 or other permission?

Best Answer

man mount has a section "Mount options for ntfs" (assuming your file system is NTFS and not FAT) where it says,

uid=value, gid=value and umask=value

Set the file permission on the filesystem. The umask value is given in octal. By default, the files are owned by root and not readable by some‐body else.

sudo mount /dev/sda3 win/ -o fmask=111 will mount the ntfs file system with all files having rw-rw-rw- permissions.

Directories will still be executable, but this is needed to allow you to cd into them.

Related Question