File executable by all, yet still cannot be executed

executablemountpermissions

As shown by the following code:

ll
total 136
-rwxr-xr-x 1 kaiyin kaiyin  19067 May  9  2013 dbmeister.py
-rwxr-xr-x 1 kaiyin kaiyin   1617 Jul 29  2011 locuszoom
-rwxr-xr-x 1 kaiyin kaiyin 112546 May  9  2013 locuszoom.R


./locuszoom
-bash: ./locuszoom: Permission denied

locuszoom is executable globally, but still can't be executed. The files are on a harddisk mounted at /media/data1.

Best Answer

The harddisk needs to be remounted so that exec mount option is included.

excerpt from mount man page

FILESYSTEM INDEPENDENT MOUNT OPTIONS
    ....
    exec   Permit execution of binaries.

You can do this 1 of 2 ways.

Examples

Via the command line.

$ mount -o remount,exec /media/data1

Or in your /etc/fstab.

# <file system>      <dir>         <type>    <options>             <dump> <pass>
/dev/sdb1            /media/data1  ext4      rw,exec,noauto        0      0
Related Question