LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-15-2011, 07:48 AM   #1
Genocide_Hoax
Member
 
Registered: Apr 2011
Distribution: OpenSuse 12.3 , Slackware 13.1 ; Centos 6.2 ; Fedora 14
Posts: 90

Rep: Reputation: 8
Cannot execute C Programs in mounted drive(exec option enabled while mounting)


Hello Guys ,


I am not able to execute my C programs from my mounted drives. This is a snapshot of my /etc/fstab

Code:
#
# /etc/fstab
# Created by anaconda on Thu Mar 10 05:24:50 2011
#
# 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
#
#   80 GB Hard Drive

UUID=b7c8d20e-1753-4674-90b2-dc3ca1331c64        /                            ext4               defaults                             1 1
UUID=58d025cb-81ae-4c08-a6fb-7a9019253d37        swap                         swap               defaults                             0 0
UUID=7E8F-180A                                   /Stuffz                      vfat               rw,exec,user,utf8,uid=500,gid=500    0 0
tmpfs                                            /dev/shm                     tmpfs              defaults                             0 0
devpts                                           /dev/pts                     devpts             gid=5,mode=620                       0 0
sysfs                                            /sys                         sysfs              defaults                             0 0
proc                                             /proc                        proc               defaults                             0 0



# 500 GB Hard Drive

UUID=1610364A1036315B                            /ntfs/CORE                    ntfs               rw,exec,user,utf8,uid=500,gid=500    0 0              
UUID=9E80FD9180FD705F                            /ntfs/MuZiK                   ntfs               rw,exec,user,utf8,uid=500,gid=500    0 0
UUID=72A82123A820E777                            /ntfs/SoftwareZ               ntfs               rw,exec,user,utf8,uid=500,gid=500    0 0
UUID=1AC83C0EC83BE723                            /ntfs/STUDIES                 ntfs               rw,exec,user,utf8,uid=500,gid=500    0 0
UUID=4E44630C4462F65D                            /ntfs/VDOZ                    ntfs               rw,exec,user,utf8,uid=500,gid=500    0 0
UUID=7210B9AA10B975A7                            /ntfs/JUNKYARD                ntfs               rw,exec,user,utf8,uid=500,gid=500    0 0
UUID=FEC04B5CC04B1A73                            /ntfs/MOVIEZ                  ntfs               rw,exec,user,utf8,uid=500,gid=500    0 0
UUID=CE60F46E60F45F21                            /ntfs/STUFFZ                  ntfs               rw,exec,user,utf8,uid=500,gid=500    0 0
My C programs resides under /ntfs/STUDIES. Please explain me as to why am I not able to exec my programs even after having exec permission in the disk.

NB : Yes, I have given exec permission to the file explicitly after compiling the .c file


Thanking You

Regards

Genocide_Hoax
 
Old 06-15-2011, 08:49 AM   #2
adamk75
Senior Member
 
Registered: May 2006
Posts: 3,091

Rep: Reputation: 399Reputation: 399Reputation: 399Reputation: 399
What is the output of 'mount'? What's the error you receive when you try to execute one of those programs?

Adam
 
Old 06-15-2011, 08:54 AM   #3
Genocide_Hoax
Member
 
Registered: Apr 2011
Distribution: OpenSuse 12.3 , Slackware 13.1 ; Centos 6.2 ; Fedora 14
Posts: 90

Original Poster
Rep: Reputation: 8
The drives are auto-mounted I haven't checked my boot message but I suppose there is no error message in boot process else I would have been notified about it. And when I try to execute my programs it says Permission Denied. I can execute the same program smoothly if I copy it to my home folder but why should I do that if I have exec rights and ownership of the mounted drives.
 
Old 06-15-2011, 09:00 AM   #4
adamk75
Senior Member
 
Registered: May 2006
Posts: 3,091

Rep: Reputation: 399Reputation: 399Reputation: 399Reputation: 399
And again, what's the output of 'mount'. It's not a trick question...

Adam
 
Old 06-15-2011, 09:09 AM   #5
Genocide_Hoax
Member
 
Registered: Apr 2011
Distribution: OpenSuse 12.3 , Slackware 13.1 ; Centos 6.2 ; Fedora 14
Posts: 90

Original Poster
Rep: Reputation: 8
Sorry Adam I am not able to read you , I told you I don't manually mount the drives usin something like mount -t ntfs-3g /dev/sda4 /ntfs/somethin , thus I don't get any output from it. Since the drive are auto mounted during the boot process reading the entries from /etc/fstab if there was any error message I would have been notified about after boot up. I am sorry I am not pretty clear as to what u r asking me.
 
Old 06-15-2011, 09:15 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
Typing : mount <ENTER> : Will reply something, like
Code:
[knudfl@localhost ~]$ mount
/dev/sda8 on / type reiserfs (rw)
none on /proc type proc (rw)
none on /dev/pts type devpts (rw)
/dev/sda9 on /home type reiserfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
gvfs-fuse-daemon on /home/knudfl/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=knudfl)
/dev/sda13 on /media/SMART BTMGR type reiserfs (rw,nosuid,nodev,uhelper=hal)
/dev/sda10 on /media/SMART BTMGR_ type ext3 (rw,nosuid,nodev,uhelper=hal)
/dev/sda1 on /media/SMART BTMGR__ type ext3 (rw,nosuid,nodev,uhelper=hal)
 
Old 06-15-2011, 09:20 AM   #7
Genocide_Hoax
Member
 
Registered: Apr 2011
Distribution: OpenSuse 12.3 , Slackware 13.1 ; Centos 6.2 ; Fedora 14
Posts: 90

Original Poster
Rep: Reputation: 8
lol sorry.. :P

Here is the output

Code:
mount
/dev/sda1 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sda3 on /Stuffz type vfat (rw,noexec,nosuid,nodev,utf8,uid=500,gid=500)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
/dev/sdb1 on /ntfs/CORE type fuseblk (rw,noexec,nosuid,nodev,allow_other,blksize=4096,default_permissions)
/dev/sdb5 on /ntfs/MuZiK type fuseblk (rw,noexec,nosuid,nodev,allow_other,blksize=4096,default_permissions)
/dev/sdb6 on /ntfs/SoftwareZ type fuseblk (rw,noexec,nosuid,nodev,allow_other,blksize=4096,default_permissions)
/dev/sdb7 on /ntfs/STUDIES type fuseblk (rw,noexec,nosuid,nodev,allow_other,blksize=4096,default_permissions)
/dev/sdb8 on /ntfs/VDOZ type fuseblk (rw,noexec,nosuid,nodev,allow_other,blksize=4096,default_permissions)
/dev/sdb9 on /ntfs/JUNKYARD type fuseblk (rw,noexec,nosuid,nodev,allow_other,blksize=4096,default_permissions)
/dev/sdb10 on /ntfs/MOVIEZ type fuseblk (rw,noexec,nosuid,nodev,allow_other,blksize=4096,default_permissions)
/dev/sda4 on /ntfs/STUFFZ type fuseblk (rw,noexec,nosuid,nodev,allow_other,blksize=4096,default_permissions)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
gvfs-fuse-daemon on /home/Genocide_Hoax/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=Genocide_Hoax)
Hey ! it says noexec why is that so?
 
Old 06-15-2011, 09:44 AM   #8
adamk75
Senior Member
 
Registered: May 2006
Posts: 3,091

Rep: Reputation: 399Reputation: 399Reputation: 399Reputation: 399
Doesn't see to be using really any of the options you have in /etc/fstab. Let's try a little experiment. Unmount /ntfs/STUDIES ('umount /ntfs/STUDIES') and then mount it manually ('mount /ntfs/STUDIES').

Adam
 
Old 06-15-2011, 08:28 PM   #9
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Quote:
/dev/sdb7 on /ntfs/STUDIES type fuseblk (rw,noexec,nosuid,nodev,allow_other,blksize=4096,default_permissions)
It's set to noexec ....

Can I ask why you're using an MS-Win disk format for a partition that you claim to be doing Linux dev on? It's bound to have issue sooner or later (eg now...).
Note that ntfs ownerships and perms concepts are different to Linux.

Anyway, try something like
Code:
mount -o remount,exec /dev/sdb7
http://linux.die.net/man/8/mount
 
Old 06-16-2011, 08:37 AM   #10
Genocide_Hoax
Member
 
Registered: Apr 2011
Distribution: OpenSuse 12.3 , Slackware 13.1 ; Centos 6.2 ; Fedora 14
Posts: 90

Original Poster
Rep: Reputation: 8
if I mount it manually it does work for me. But question is why should I mount it manually ? I have mentioned it all in my /etc/fstab/ why isn't that doing the work for me? Is there something I must add or remove from my /etc/fstab inorder to get my desired behaviour from the mounts?
 
Old 06-16-2011, 09:27 PM   #11
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Did you reboot after setting fstab? It's not a dynamic setting, you have to force it to re-read that file.
Have a read of that link.
 
Old 06-17-2011, 06:21 AM   #12
Genocide_Hoax
Member
 
Registered: Apr 2011
Distribution: OpenSuse 12.3 , Slackware 13.1 ; Centos 6.2 ; Fedora 14
Posts: 90

Original Poster
Rep: Reputation: 8
Yes I did , many a times.
 
Old 06-20-2011, 05:59 AM   #13
Genocide_Hoax
Member
 
Registered: Apr 2011
Distribution: OpenSuse 12.3 , Slackware 13.1 ; Centos 6.2 ; Fedora 14
Posts: 90

Original Poster
Rep: Reputation: 8
sorry to pop this up again. I really need a solution to this problem.
 
Old 07-06-2011, 07:00 AM   #14
Genocide_Hoax
Member
 
Registered: Apr 2011
Distribution: OpenSuse 12.3 , Slackware 13.1 ; Centos 6.2 ; Fedora 14
Posts: 90

Original Poster
Rep: Reputation: 8
Solution : All I had to do was change it to defaults from rw,exec... in the /etc/fstab. Still nt to sure why my previous config failed bt for nw defaults seems to do the job for me nw.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Execute EXEC or SHELL as a root mafesabu Linux - Newbie 5 02-18-2011 01:35 PM
how can I execute two commands on exec of a find? eantoranz Programming 3 08-03-2010 05:51 PM
Can mounting a usb flash drive with the sync option damage it ? electronpusher Linux - General 4 03-04-2008 12:46 PM
How do I set exec option on USB drive hot plug mount? dhuseby Linux - Hardware 2 05-30-2006 10:16 AM
Mounting a mounted drive across network brelic Linux - Hardware 3 03-17-2005 04:15 PM


All times are GMT -5. The time now is 11:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration