1

All the scripts in my ~/bin have '#!/bin/sh' as the first line, yet the scripts won't run without sh. This problem appeared after I shifted all my personal data to an ntfs partition and made symlinks to them in the home directory. I think I have set the permissions correctly in all the affected folders(774 to directories and files in bin and 664 to all the other files), and added this entry to /etc/fstab:

UUID=5BE8B8E020325D09                                 /mnt/DATA       ntfs-3g auto,users,permissions                       0           0

That's how the problem looks:

saga@terminal:~$ syncit a b
bash: /home/saga/bin/syncit: Permission denied
saga@terminal:~$ sh ~/bin/syncit a b
    <works correctly>

Any idea what's happening here?

output of ls -l:

for /mnt/DATA/bin/:

-rwxrwxr-- 1 saga 1001   67 Sep 22 23:56 bldcpp
-rwxrwxr-- 1 saga 1001   23 Sep 22 23:56 cnl
-rwxrwxr-- 1 saga 1001   62 Sep 22 23:57 conct
-rwxrwxr-- 1 saga 1001   23 Sep 22 23:57 cx
-rwxrwxr-x 1 saga 1001  479 Sep 22 23:44 defperms
-rwx------ 1 saga saga    0 Sep 22 23:48 ju
-rwxrwxr-- 1 saga 1001   27 Sep 22 23:57 mke
-rwxrwxr-- 1 saga 1001   58 Sep 22 01:54 process
-rwxrwxr-- 1 saga 1001  329 Sep 22 23:58 ptr
-rwxrwxr-- 1 saga 1001 1336 Sep  1 22:48 syncit
-rwxrwxr-- 1 saga 1001  639 Sep  8 12:13 vidplacer

for ~/bin:

lrwxrwxrwx 1 saga saga 13 Sep 22 04:04 /home/saga/bin -> /mnt/DATA/bin

output of mount:

saga@terminal:~$ mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs       (rw,nosuid,relatime,size=1963732k,nr_inodes=490933,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=396576k,mode=755)
none on /dev/.bootchart/proc type proc (rw,relatime)
/dev/mapper/terminal--vg-root on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (rw,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event,release_agent=/run/cgmanager/agents/cgm-release-agent.perf_event)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb,release_agent=/run/cgmanager/agents/cgm-release-agent.hugetlb)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids,release_agent=/run/cgmanager/agents/cgm-release-agent.pids)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset,clone_children)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=35,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
tracefs on /sys/kernel/debug/tracing type tracefs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
/dev/sda1 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/sda10 on /mnt/DATA type fuseblk (rw,nosuid,nodev,noexec,relatime,user_id=0,group_id=0,default_permissions,allo    w_other,blksize=4096)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
cgmfs on /run/cgmanager/fs type tmpfs (rw,relatime,size=100k,mode=755)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=396576k,mode=700,uid=1000,gid=1000)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
gvfsd-fuse on /root/.gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=0,group_id=0)

I moved my data to sda10

  • 664 files wont auto execute. – Archemar Sep 21 '16 at 13:58
  • As I said, files in bin have 774 permission. – saga Sep 21 '16 at 14:10
  • Can we see ls -l on those files? And also mount command could be useful to see mount options. – Kalavan Sep 21 '16 at 14:15
4

/mnt/DATA is mounted with the noexec flag. As a quick fix remount /mnt/DATA without noexec, i.e.

mount -o remount,exec /mnt/DATA

For persistence, modify the according entry in /etc/fstab such that this flag is not set by default.

  • So what do I do about it. – saga Sep 21 '16 at 15:07
  • You'll have to remove the noexec flag from the /dev/sda10 line in /etc/fstab. – Johan Myréen Sep 21 '16 at 15:10
  • noexec flag isn't set in fstab. sda10 has auto,users and permissions options set. – saga Sep 21 '16 at 15:14
  • Try adding the exec flag. – Johan Myréen Sep 21 '16 at 15:18
  • I see the mount is a fuse (File system in user space) mount. What does /etc/fuse.conf contain? – Johan Myréen Sep 21 '16 at 15:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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