I have a shared drive with openSUSE 13.1 and Windows 8.1 Pro that is NTFS (originally formatted from Windows 7 SP1 Pro). I am trying to learn how to program in C (maybe relevant), and I am compiling to said NTFS partition with gcc without a problem lol!. The problem is when I try to execute the a.out file that is generated I always get this error >:(:
bash: ./a.out: Permission denied.
Ok, so I try to run ./a.out again as root and I get the same results. So I change the drive permissions with chmod (said partition is mounted as /home):
sudo chmod -R ugo+rwx /home
I try executing again to no avail, so I double check that the permissions were actually written:
michael@linux-kb46:~/Documents> ls -l /
total 112
drwxr-xr-x 2 root root 4096 Jan 26 01:57 bin
drwxr-xr-x 4 root root 4096 Jan 26 11:47 boot
drwxr-xr-x 20 root root 4100 Jan 27 22:52 dev
drwxr-xr-x 155 root root 12288 Jan 27 23:16 etc
drwxrwxrwx 1 root root 4096 Jan 27 18:11 home
drwxr-xr-x 15 root root 4096 Jan 26 12:18 lib
drwxr-xr-x 7 root root 12288 Jan 26 02:28 lib64
drwx------ 2 root root 16384 Jan 26 01:08 lost+found
drwxr-xr-x 2 root root 4096 Sep 27 16:24 media
drwxr-xr-x 2 root root 4096 Sep 27 16:24 mnt
drwxr-xr-x 5 root root 4096 Jan 27 23:35 opt
dr-xr-xr-x 261 root root 0 Jan 27 17:15 proc
drwx------ 25 root root 4096 Jan 27 23:21 root
drwxr-xr-x 31 root root 820 Jan 27 23:16 run
drwxr-xr-x 2 root root 12288 Jan 26 02:45 sbin
drwxr-xr-x 2 root root 4096 Sep 27 16:24 selinux
drwxr-xr-x 7 root root 4096 Jan 26 02:31 srv
dr-xr-xr-x 12 root root 0 Jan 27 22:15 sys
drwxrwxrwt 26 root root 4096 Jan 27 23:45 tmp
drwxr-xr-x 13 root root 4096 Nov 6 14:53 usr
drwxr-xr-x 16 root root 4096 Jan 26 02:06 var
drwxr-xr-x 1 root users 8192 Jan 25 11:43 win8
michael@linux-kb46:~/Documents>
So the I realize that ntfs-3g does not allow live alteration of permissions on an NTFS partition, so I changed my /etc/fstab file to this:
/dev/disk/by-id/ata-ST95005620AS_5YX1NEZD-part6 swap swap defaults 0 0
/dev/disk/by-id/ata-ST95005620AS_5YX1NEZD-part7 / ext4 acl,user_xattr 1 1
/dev/disk/by-path/pci-0000:00:1f.2-scsi-1:0:0:0-part5 /home ntfs-3g defaults,users,group=users,locale=en_US.UTF-8 0 2
/dev/disk/by-id/ata-ST95005620AS_5YX1NEZD-part4 /win8 ntfs-3g users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
Seems correct to me. So I restart my computer just to make sure the changes went into effect and it doesn’t help. I have had success moving the file to /opt and executing it as root. So does anyone know how I can fix this problem? It is especially perplexing since both reading and writing from/to the partition work, and running as root doesn’t help.
Thank you in advance.