Linux, noexec filesystem mount

Few days ago, a colleague of mine was facing an interesting problem. He was doing a ./script file from his terminal, and got back  permission denied as response. The permissions on the file looked fine, he had the x flag to execute the file. Initially, we thought that it had something to do with selinux, but fifteen minutes of googling around did not show up any solution. In the end, figured out (again by more googling) that the file system could have been mounted as noexec. A quick cat on /proc/mounts confirmed the same. We removed the noexec flag in /etc/fstab and remounted the volume and bang, everything was working as expected.

I realized later in the day, that two very interesting facts were bought to light by the incident,

1. If I’m not able to find an answer within 10 minutes of googling, I am asking the wrong question.

2. I have to learn to be wary of what is my observation and what is my inference. In this case, permission denied was my observation, and problem with selinux was my inference and I was looking for solutions in the wrong space. I guess, its always best to start searching for a solution from an observation, rather than an inference.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s