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

2

6

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.

Gabbie answered 29/11, 2010 at 18:24 Comment(4)
Just FYI, it doesn't matter what language was used to make the executable.Crimson
Could you recompile the binaries and test by any chance?Monition
main.o is an object file, not an executable, so you shouldn't be trying to execute it. What happens when you run the actual executable?Kannry
Yes I shouldn't try to run object file. I meant executable ./Hello. It says the same thing, that permission denied. Yes I can recompile the binaries, but it stays the same.Gabbie
F
8

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.

Fluviomarine answered 29/11, 2010 at 18:38 Comment(2)
Thank you for your help. I have managed to make it work by mounting my partition through terminal, but I would like to do it with a GUI like Places->Data. What should I modify to make it work? My /ect/fstab now loks like: <code>proc /proc proc nodev,nosuid,exec 0 0 # / was on /dev/sda4 during installation UUID=51969b4e-cfee-4f40-9896-c73460ef462e / ext4 errors=remount-ro 0 1 UUID=9C5AE9025AE8DA52 /media/Data ntfs defaults,exec 0 0</code> I added the last entry in order to mount it automaticaly.Gabbie
If the fstab entry exists it should be used by default, unless nautilus is doing something funky. Someone who is more of a GNOME export may need to answer this part of the question. I would expect that if you have the fstab entry and umount the filesystem manually, then attempt to navigate via the Places menu, it should automount using the specified options. If this doesn't work then I cannot help since I do not know anything about GNOME.Fluviomarine
Y
0

I am agree, Ubuntu 10.10 changed the default mount options for ntfs filesystems.

Some people make that http://waystop.blogspot.com/2010/12/ubuntu-1010-maverick-meerkat.html

Yellowweed answered 25/12, 2010 at 9:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.