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.

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

Doing

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)

share|improve this question

3 Answers 3

up vote 13 down vote accepted

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.

share|improve this answer

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
share|improve this answer

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

share|improve this answer
    
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 at 15:58

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.