0

So I have a particular ext4 drive that doesn't allow me to execute files. I have the following example in bash where even with sudo and with the file having execute permissions for all users, the file does not execute. If I move the file to an alternate partition, it works fine. Thoughts?

$ ./pycharm.sh bash: ./pycharm.sh: Permission denied $ sudo ./pycharm.sh sudo: unable to execute ./pycharm.sh: Permission denied $ sudo -s # ./pycharm.sh bash: ./pycharm.sh: Permission denied # lsattr pycharm.sh -------------e-- pycharm.sh # ls -la pycharm.sh -rwxr-xr-x 1 me me 5908 Nov 20 03:18 pycharm.sh 
9
  • The mount options on linux default to rw, suid, dev, exec, auto, nouser, async, and relatime. However it is possible to mount witht he reverse, e.g. 'noauto' for optical drives. Please check if your volume is not mounted with no-exec. Commented Apr 11, 2015 at 11:46
  • @Hennes all my other drives don't have exec or noexec (must exec automatically) and they work. This drive doesn't and uses the same config: ext4 users,relatime,errors=remount-ro 0 1 Commented Apr 11, 2015 at 11:59
  • Yup. The default (if not specified) is exec. However it was worth checking for either this or for ACLs. Commented Apr 11, 2015 at 12:01
  • No ACLs present. The same thing happens to unrelated executables. Commented Apr 11, 2015 at 12:49
  • Does anything appear in logs (/var/log/messages, /var/log/secure) when you try to run the script? Commented Apr 11, 2015 at 13:08

1 Answer 1

1

Maybe you have set your fstab options to prevent execution on this filesystem?

Have a look at /etc/fstab, maybe you've set the noexec option.

2
  • It doesn't appear so. They are the same as my other partitions: ext4 users,relatime,errors=remount-ro 0 1 Commented Apr 11, 2015 at 11:58
  • What does the 'mount' command say? Perhaps there are errors that are forcing it to re-mount with restrictive options? Commented Apr 11, 2015 at 13:07

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.