# NTFS access settings - All files executable?![solved]

## 118947

I've been having problems accessing ntfs partitions for quite a long time now, until I found a way that works.

I can read/write and execute files on my ntfs partion, through the ntfs3g driver.

However, as a sideeffect, all files on the partion are marked as executable, which is not what I want.

This is my fstab line:

```
/dev/hdb1    /mnt/drive_d    ntfs-3g users,exec,locale=en_GB.utf8,umask=022,uid=1000,gid=1000
```

Obviously this is down to the umask=022.

So I ask, which umask is correct, when I want read/write support + executable files?

I've googled long and hard, and all I ever find are confusing posts and references to man umask, which I do not find helpful.

Anyone??Last edited by 118947 on Thu Nov 27, 2008 12:25 am; edited 3 times in total

----------

## Sadako

You need directories to be executable, so you can split the permissions applied to directories from those applied to files.

Replace "umask=022" with "fmask=133,dmask=022", that should give you what you're looking for.

----------

## 118947

Ok, thanks. That works just great!!   :Very Happy: 

----------

## 118947

Oh dear oh dear.   :Crying or Very sad: 

As it is, I just noticed that the above does not do what I want.

Its true that with a fmask=133, no files on the mounted ntfs volume are marked as executable.

However, I cannot set any of them to be so...(chmod, via filemanager) which has now turned out to be a problem...

So, how can I get this working.

I want all files be marked as not-executable, but if I wish to make them exec, I want to be able to do so.

I am using the exec flag.

Any hope / ideas?

----------

## MageSlayer

See http://forum.ntfs-3g.org/viewtopic.php?t=915&highlight= for details.

Unfortunately, a problem is not so simple  :Smile: 

----------

## 118947

Hi, thanks for the reply.

I actually stumbled across that page myself (http://pagesperso-orange.fr/b.andre/advanced-ntfs-3g.html), and briefly skimmed through the 'ownership and permissions' part, and couldn't make heads nor tails out of it...  :Sad: 

Did you manage to find an answer to your problem, or did you just give up?

I'll have to have a more thorough read through when I find the time before I have any chance of getting this working...

On a side note, I think this is a serious usability issue. The ntfs3g driver has made huge steps towards becoming the defacto standard ntfs implementation in the free operation system world, and an issue such as this, should not have a 'non-simple' answer.

I mean the ntfs filesystem is becoming more and more common-place everywhere. Its no longer something people who dualboot between windows and say linux need. 

usbsticks, external hdds, things that 'normal' people use today arrive preformatted with ntfs.

On the other side more and more 'normals' are starting to use linux as their os, and with at least no distribution I know of, having a sane standard setup in regards to ntfs access, I fear that this may end up hitting a roadblock, at some point...

----------

## eduardhc

 *hungrigerhaifisch wrote:*   

> Hi, thanks for the reply.
> 
> I actually stumbled across that page myself (http://pagesperso-orange.fr/b.andre/advanced-ntfs-3g.html), and briefly skimmed through the 'ownership and permissions' part, and couldn't make heads nor tails out of it... 
> 
> Did you manage to find an answer to your problem, or did you just give up?
> ...

 

NTFS does not have an equivalent for the "executable" permission flag, thus a "chmod +x" order on an NTFS3G probably does nothing, as it has no direct way to translate it to the underlying file system.

Thus you have the option to mount ALL files as executables or not, but not only some of them. If choose the former, then NTFS shows you all files as executable. If not, none of them are. But you must understand that this is simply  an abstraction that NTFS3G does, it has no real reflect in NTFS. 

The only real alternative would to i.e. display as 'executable' only those files ending with .COM, .EXE and .BAT, as this is what really marks a file as executable under Windows (or else look for a PE header in the file, but I think this would be rather excessive and dangerous for a FS driver).

Regards, 

  Eduard

----------

## MageSlayer

 *Quote:*   

> Did you manage to find an answer to your problem, or did you just give up? 
> 
> 

 

Well, I had only data files on ntfs partition, so basically I gave up using umask=0111,dmask=000 as mount options in fstab. 

 *Quote:*   

> I'll have to have a more thorough read through when I find the time before I have any chance of getting this working...

 

Perhaps you, maybe you better ask ntfs3g devs. They are very nice people actually  :Smile: 

 *Quote:*   

> I want all files be marked as not-executable, but if I wish to make them exec, I want to be able to do so. 
> 
> I am using the exec flag.

 

Not quite clear - are you trying to keep unix/linux programs on NTFS?   :Shocked: 

Or you mean Wine emulation? AFAIU, for correct wine emulation file is not required to have exec flag.

----------

## 118947

Actually for wine emulation to work, you do need the exec flag. If its not set, I think wine has problems loading dlls.

It does not require a file, like game.exe to be set executable.

Actually I've kind of figured out that I wasn't thinking correctly earlier.

 *Quote:*   

> Are you trying to keep unix/linux programs on NTFS?

 

Well no not really, but I have some games that are released as both windows and linux binaries.

I keep them in the same folder, on a ntfs partition.

This is where I ran into the problem, because obviously no 'linux-binary' will execute without being executable.

 *Quote:*   

> NTFS does not have an equivalent for the "executable" permission flag, thus a "chmod +x" order on an NTFS3G probably does nothing, as it has no direct way to translate it to the underlying file system. 

 

After reading your post, and a little at the ntfs3g driver page I kind of remembered that   :Embarassed: 

I'll just move the games executables to a ext3 or whatever partition and symlink the games data folders   :Rolling Eyes: 

Regarding my 'rant', I wasn't refering to this 'executable-issue(or non issue...)' but more to the general problem that ntfs-volumes tend to get mounted readonly, even with ntfs3g, just because of wrong permission settings somewhere in the given linux-distro's setup...

----------

