7

I have created an Eclipse Workspace on a mounted partition of my hard drive. I am able to successfully build the hello world program but when I try to execute the runnable I get the following error message:

Error starting process. Exec_tty error:Cannot run program
"/media/vineet/DEVDATA1/vinexpMount/Debug/vinExpeMount": Unknown
 reason Exec_tty error:Cannot run program
"/media/vineet/DEVDATA1/vinexpMount/Debug/vinExpeMount": Unknown
reason Exec_tty error:Cannot run program
"/media/vineet/DEVDATA1/vinexpMount/Debug/vinExpeMount": Unknown
 reason

Please tell what shall I do ? I have checked the permissions for the executable which is

-rw-r--r--

which means that I have not got the permission to execute. but when I create a workspace in root partition, I get the execute permission by default. what Shall I do to get the same behaviour here?

Raja G
  • 105,327
  • 107
  • 262
  • 331
bubble
  • 399

3 Answers3

8

This ought to be a comment, but it seems that I don't have the privilege to write any, so sorry in advance.

Have you tried to execute the mount command in terminal? This program produces output for every mount point in your system. At the end of every line in the output, the mount flags are listed in parentheses. Check if your mount point has noexec flag set.

If so, you can change it with the following command (for example assuming your drive is mounted in /mnt/cdrom):

sudo mount -o remount,exec /mnt/cdrom

If your mounted drive is a Windows partition (i.e. a partition formatted with NTFS filesystem), then you can mount it executable as described in this post.

bender
  • 1,854
1

You can use the Linux linker to run any file regardless of executable permissions and without changing the mount options like so:

/lib/ld-linux.so.2 /path/to/binary-file

or, on 64 bit systems:

/lib64/ld-linux-x86-64.so.2 /path/to/binary-file

1

My solution is remount it to another path:

$ sudo umount /dev/sdf
$ sudo mount -o exec,defaults,-default_permissions /dev/sdf ~/usbdrive

List all mounted drive:

$ cat /proc/mounts