LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   problem executing scripts on mounted fat32 partition (https://www.linuxquestions.org/questions/linux-general-1/problem-executing-scripts-on-mounted-fat32-partition-178934/)

roald 05-07-2004 09:14 AM

problem executing scripts on mounted fat32 partition
 
Hi,

I have a problem with executing e.g. perl scripts that are on a mounted drive.
I have Fedora Core 1 installed on an ext3 partition and an extra fat32 partition. The fat32 partition is mounted with the command "mount /scratch", with in my fstab "/dev/hda6 /scratch vfat noauto,users,rw 0 0". In my home directory I have no problem executing any scripts or binaries, but I cannot do that in directories on the mounted partition. What does work is "perl script.pl" but not "script.pl". When I try to execute a binary ("./program.x"), I get the error "bash: ./program.x: Permission denied", but for all files I do have execute permissions.
It doesn't make a difference if I do this as root or as a user.

I suspect it has to do with how I mount the partition, and may be related to the problem that I cannot unmount the partition with "umount /scratch" (error: "/scratch: device is busy").
Anybody has a clue to what is the problem?

andredude 05-07-2004 09:35 AM

you've got it the wrong way around, i think - execute scripts with "./" and binaries without.

roald 05-07-2004 10:17 AM

./ just indicates that the file I want to execute is in the current directory. Both "./binary.x" and "binary.x" do the same thing in my case (I tried), which is what I expected since ./ is the first directory listed in my "$PATH".

Thanks anyway,
Roald

Grymme 05-07-2004 10:44 AM

I would suggest using umask=022 in your fstab as a mount option.

roald 05-08-2004 02:15 AM

Sorry, tried that and it doesn't make any difference.

Roald

esben 05-08-2004 02:20 AM

Let's get the permission thing out of the way: Please post
Code:

ls -l (scriptname)

roald 05-08-2004 03:48 AM

ls -l script.pl gives:

-rwxr-xr-x 1 roald roald 37 May 7 14:49 script.pl

I don't know about the 1; for the rest I would say:
permissions 1?? user group filesize date time filename

roald 05-08-2004 04:17 AM

Found it!
 
Thanks for the help, but I found the solution. For those interested, mounting with:

"/dev/hda6 /scratch vfat noauto,owner,umask=022 0 0"

instead of:

"/dev/hda6 /scratch vfat noauto,users,rw 0 0"

works fine! It allows me to execute files and also solves the umount and some other things, like I wasn't able to change the group of my own files (chgrp ..).

Thanks anyway!

Roald

avni 06-14-2004 06:02 AM

Re: Found it!
 
Quote:

Originally posted by roald
Thanks for the help, but I found the solution. For those interested, mounting with:

"/dev/hda6 /scratch vfat noauto,owner,umask=022 0 0"

instead of:

"/dev/hda6 /scratch vfat noauto,users,rw 0 0"

works fine! It allows me to execute files and also solves the umount and some other things, like I wasn't able to change the group of my own files (chgrp ..).

Thanks anyway!

Roald

Actually you can only add the option "exec" after "users" or "user". No need for umask=022 since it is usually the default.

Code:

/dev/hda6 /scratch vfat noauto,users,exec,rw 0 0
This is since the user(s) options imply "noexec".
Strangly, the owner option, which is not well documented, doesn't imply "noexec" like the user(s) options.

See man mount.

Ofir Avni


All times are GMT -5. The time now is 02:58 PM.