Main problem: HDD in mount is 'noexec' but in /etc/fstab is 'exec'
I would like to run the following hello world program:
Code:
#include<stdio.h>
#include<stdlib.h>
int main()
{
printf("Hello World!");
return 0;
}
The resulting terminal window displays:
Code:
sh: 1: /media/a/LG/AC/Learn//Linux_home/Codeblocks/helloWorld: Permission denied
MY PROCEDURE:
S01:
I first go into the direcory /media/a/LG/AC/Learn//Linux_home/ and execute:
Code:
chmod -R 777 Codeblocks
in order to make sure all programs are 'rwx'.
S02
Check /etc/fstab contents:
Code:
# sda3: DATA (LG)
UUID=xxx /media/a/LG ext4 errors=remount-ro,auto,exec,rw,user 0 0
S03
Check codeblocks config files:
Code:
a@a-NC210-NC110:~$ ll ~/.codeblocks/
total 312
-rwxrwxrwx 1 a adm 29944 6 30 10:42 cbKeyBinder10.ini
-rwxrwxrwx 1 a adm 29766 3 22 16:40 cbKeyBinder10.ini.bak
-rwxrwxrwx 1 a a 119780 6 30 16:09 default.conf
-rwxrwxrwx 1 a a 0 7 1 11:15 en_US_personaldictionary.dic
-rwxrwxrwx 1 a a 29568 6 30 16:04 night.cbKeyBinder10.ini
-rwxrwxrwx 1 a a 29568 6 30 16:04 night.cbKeyBinder10.ini.bak
-rwxrwxrwx 1 a a 59962 7 1 11:15 night.conf
drwxrwxrwx 3 a adm 4096 4 10 16:42 share
S04
From within codeblocks, I check the configuration:
Code:
Menu Bar > Settings > Compiler > Global compiler settings > compiler settings > Other options(tab) > -std=c99
S05
I even 'chmod +x hello'
{***hello = name of resulting executable}
S06
I uninstalled codeblocks, codeblocks-common, codeblocks-contrib, gcc, build-essential and gcc-4.8-plugin-dev through synaptic, rebooted and then installed codeblocks, codeblocks-common, build-essential and gcc.
S07
Opening the newly installed codeblocks I then verified that the compiler settings were still configured as '-std=c99' (S04).
S08
I ran the same hello world program again and I still got the same "Permission denied" pop-out terminal window.
S09
Next I changed the path of this program to ~/Documents, were I received a "no g++ found" error message in the debugger.
S10
In terminal I then executed:
Code:
sudo apt-get install g++
After I do this I notice how it works from my lubuntu system hard drive(sda6). When I try this from the exact same file saved on either my main data(sda3) harddrive, I still get the same old permissions denied error:
Code:
sh: 1: /media/a/LG/a: Permission denied
When I try this saving the program to usb (FAT32) drive, codeblocks reads:
build log:
Code:
gcc -std=c99 -c /media/a/GParted-live/a.c -o /media/a/GParted-live/a.o
g++ -o /media/a/GParted-live/a /media/a/GParted-live/a.o
/usr/bin/ld: cannot open output file /media/a/GParted-live/a: Is a directory
collect2: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))
S11
I execute 'mount' from terminal:
Code:
/dev/sda6 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/cgroup type tmpfs (rw)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755)
none on /sys/fs/pstore type pstore (rw)
/dev/sda3 on /media/a/LG type ext4 (rw,noexec,nosuid,nodev,errors=remount-ro)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
systemd on /sys/fs/cgroup/systemd type cgroup (rw,noexec,nosuid,nodev,none,name=systemd)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user=a)
/dev/sdb1 on /media/a/GParted-live type vfat (rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks2)
Now I think that there must be a conflict somewhere. Why in /etc/fstab would it read
Code:
"UUID=xxx /media/a/LG ext4 errors=remount-ro,auto,exec,rw,user 0 0"
yet above when I run 'mount' sda3 comes up as being 'noexec'??