Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer 1

up vote 3 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
add comment

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.