Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I trying to deploy an rails application into /home/app/myapp, but when application tries to connect to Mysql, I get this error:

** [out ::] /home/app/myapp/shared/bundle/ruby/1.9.1/gems/mysql2-0.3.11/lib/mysql2/mysql2.so: failed to map segment from shared object: Operation not permitted - /home/app/myapp/shared/bundle/ruby/1.9.1/gems/mysql2-0.3.11/lib/mysql2/mysql2.so

'app' user has root privilegies, so it no make sense.

After googling, I find that noexec in home folder can block system calls. This my fstab file:

$cat /etc/fstab

# /etc/fstab
# Created by anaconda on Wed Oct 17 16:48:10 2012
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
/dev/mapper/VG00-LVbarra /                       ext4    defaults        1 1
UUID=3d5ccda7-932f-4b48-a010-9ddcb99873c0 /boot                   ext4    defaults        1 2
/dev/mapper/VG00-LVhome /home                   ext4    defaults,noexec,nosuid        1 2
/dev/mapper/VG00-LVtmp  /tmp                    ext4    defaults,noexec,nosuid        1 2
/dev/mapper/VG00-LVusr  /usr                    ext4    defaults        1 2
/dev/mapper/VG00-LVvar  /var                    ext4    defaults,noexec,nosuid        1 2

How to remove noexec flag from home folder? Thank you!

share|improve this question
up vote 3 down vote accepted

Looks like mprotect failed, but anyway, to remove the noexec flag, change

/dev/mapper/VG00-LVhome /home ext4 defaults,noexec,nosuid


/dev/mapper/VG00-LVhome /home ext4 defaults,nosuid

And remount /home with mount -o remount /home

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.