So for convenience, I store all my data on my Windows partition so that I can access my data easily from both Linux and Windows. However, I tried compiling a C++ program with g++, and found out that I cannot run the program with ./program_filename, as it tells me

bash: program_filename: Permission denied


cp program_filename ~/program_filename

and running it from my home directory works just fine, however.

So I tried chmod +rwx program_filename, but ls -l shows that the permissions are still set as -rw-------. for all files in the directory. Nothing changes when I do this as root, either.

Is there a simple fix for this?

(In case it's useful, I am running Fedora 16 x64)

3 Answers 3


Make sure that your mount options allow the execute permission bit.

There are mount options one can use to limit the permissions of files within the mounted filesystem: general noexec prevents all files from being executable, FAT-specific option showexec grants the permission only to files with extensions .exe, .com and .bat. Note also that noexec is implied by user and users.

If you use user or users you can still get the execute permission bit working by mounting with explicitly specified exec mount option after the user or users option.

See mount manpage for details.


When you mount a FAT or NTFS partition, the permissions are determined at mount time, by the umask, fmask and dmask options. The first is general, the other two are specific for files and directories.

Also you may be interested in uid and gid option to establish the owner and group of all files and directory on the partition.

An example:

mount -t ntfs-3g -o uid=500,gid=500,umask=0022 /dev/sda1 /mnt/win

In Puppy Linux, by default you can execute scripts on NTFS or FAT partitions: http://murga-linux.com/puppy/viewtopic.php?t=95174

  • Welcome to Unix & Linux! Since links often go stale, it is always preferred to include the essential parts of the answer here, and provide the link for reference.
    – drs
    Aug 7, 2014 at 15:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .