I want to compile a source code in a NTFS partiotion but can not as shown in the following picture:

can not be compiled in NTFS partitions

Although i can write files into that partition but Compile NOT!

How can i solve it?

  • 1
    Can you post the error message you got? – Eric Carvalho Jul 17 '12 at 21:35
  • @EricCarvalho i add a pic, see it! – Milad Sobhkhiz Jul 19 '12 at 12:16
  • I think you could run bash configure. – Eric Carvalho Jul 19 '12 at 19:14

You can not compile because your file does not has executable permission. And you can not set file permission which is in ntfs partition because you did not mount your partition with write permission(But you can copy, cut, paste file). Easy solution is use ntfs-config

sudo apt-get install ntfs-config
sudo ntfs-config

Enable write permission for Internal and External device

enter image description here

Or you can set your fstab manually(ntfs-config just set your fstab). Your fstab should look like this..

#Entry for /dev/sda5 :
UUID=7818C41F18C3DA70   /media/Local    ntfs-3g defaults,locale=en_US.UTF-8 0 0
#Entry for /dev/sda6 :
UUID=7ED0CAEED0CAABA9   /media/Office   ntfs-3g defaults,locale=en_US.UTF-8 0 0
  • He said he can write to the ntfs partition. – Eric Carvalho Jul 19 '12 at 19:11
  • @EricCarvalho you missed, i also said he can copy, cut and paste but can not change file permission – shantanu Jul 20 '12 at 8:08

It's not a good idea using a NTFS partition to compile source code because usually the compiling generates executable files, which need the execute file permission, not provided by NTFS.

  • 2
    I just compiled a c program on my NTFS partition and ran the executable without any problem. I don't think it is correct to say NTFS does not provide execute file permission. Maybe the problem is in the mounting option. – G. He Jul 18 '12 at 3:36
  • 1
    NTFS does not support execution of linux executable files. You can't even mark the files as executable. – Akshit Baunthiyal Jul 19 '12 at 12:31

One way is to use permissions options which will let you change permissions of your indiviual file thus making it possible to be executed. If you mount the ntfs partition with the permissions option, then chmod / chown will work

/dev/sda2   /mnt/excess ntfs-3g    permissions,locale=en_US.utf8    0   0

You can then

sudo chown your_user:your_user /mnt/excess

This is very relevant https://askubuntu.com/a/208349/11212 adding someWeirdId /media/name ntfs auto,stuff,stuff,stuff,**uid=1000,gid=1000,umask=0000** 0 0

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.