Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
    
    
@Gilles. Thanks Gilles. I found your post searching with umask –  gongzhitaao Aug 5 '12 at 0:13

1 Answer 1

up vote 4 down vote accepted

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 umask=111 gives me rw-rw-rw- on my Windows partition. This might probably work for you.

(It also sets folders' permissions to drw-rw-rw-, and I am not one-hundred-percently sure whether this is completely trouble-free, so please keep this in mind if you run into problems somewhere else.)

share|improve this answer
    
Thanks for the umask options. But I think fmask=111 should be used instead, cause umask=111 would make the directories non-executable so that I could not cd into it. For me, fmask=111 does the job. –  gongzhitaao Aug 4 '12 at 10:55

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.