Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run C++ binaries on NTFS in Ubuntu 10.10?

Just installed Ubuntu 10.10. Previously I had Ubuntu 10.04. I have a shared partition between Ubuntu and Windows which is NTFS. I store my development files (Eclipse C++ project files) in that partition.

So here is the problem: with 10.04 everything was ok, but now I can't run any of my programs which reside in the NTFS partition. Eclipse says:

Error starting process.
Exec_tty error:Cannot run program "/media/../Eclipse/Hello/Debug/Hello": Unknown reason

When I try to execute it in a terminal it says:

bash: ./Hello: Permission denied

I understand that it is the permissions issue because NTFS filesystem do not support Unix permissions, but how it can be that on 10.04 was everything ok. Does this release add any restrictions for the NTFS filesystem?

Has anyone faced a similar problem and know how to fix this?

Thank you.

like image 286
Robertas Avatar asked Nov 29 '10 18:11

Robertas


1 Answers

The default mount options for ntfs filesystems probably changed between Ubuntu versions.

Locate the line in /etc/fstab that controls the mount point in question.

First thing to try: Make sure that the option string does not contain noexec. If it does, remove it, umount, remount and see if that fixes it for you.

If noexec wasn't there or you still cannot execute, then check to see if user or users is one of the options. Since user implies noexec (normally) you may need to add (after user) the option exec, so the result would read:

user,exec

If user was present try making this change, then umount and remount.

If at this point you still cannot execute, then and add or set the following mount option in the option string for the mount point in question:

fmask=002

This is probably excessively permissive but should be okay for a single user system. This tells mount that all files in the filesystem should be treated as (among other things) executable by default. Now umount and remount again and see if it's working.

like image 187
sorpigal Avatar answered Oct 07 '22 08:10

sorpigal