Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:

./a.out
**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?

share|improve this question
    
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
up vote 4 down vote accepted

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

share|improve this answer

You must log in to answer this question.

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