How to run an executable from a mounted drive?

Solution 1:

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.

Solution 2:

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