Basically, I have three major partitions on my machine as I'm dual booting:

  • Partition1: Windows-7
  • Partition2: Linux-Mint
  • Partition3: SHARED_NTFS_DRIVE

Well, I've reserved only a minimal chunk of my disk for OS partitions, as the bulk of my data that consist of movies, songs, source-code, etc. reside on the shared NTFS portion so that I can use it from both Linux and Windows.

Now, problem occurs when I want to compile and run my cpp source files (which are on NTFS shared drive) from Linux. I'm able to successfully compile my source file by invoking:

g++ temperature.cpp

But, when I want to run the output by running the a.out file, I get the below error:

**bash: ./a.out: Permission denied**

ls -l shows a.out’s attributes (permissions/mode) as rw-. I tried doing chmod a+x a.out, but it doesn’t work; after doing another ls -l, the file attributes again show only rw.

However, when I copy the a.out to my ext4 Linux partition, it runs happily! What can I do to run it on my NTFS partition?

  • Have you tried chmod 755? – Scott Mar 2 '13 at 21:55
  • I tried doing "chmod a+x a.out" but it doesn't work. After doing "ls -l", the file attributes again show only rw. – Prahlad Yeri Mar 3 '13 at 3:49

The exec option must be used to mount the NTFS partition, see https://stackoverflow.com/questions/4306768/how-to-run-c-binaries-on-ntfs-in-ubuntu-10-10 for details.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.