You are not logged in.

#1 2010-04-28 13:02:14

Orm
Member
Registered: 2009-08-10
Posts: 24

(Solved) Problems Running Programs Located on Portable Drive

This is a bit of a bother. I keep the source and compile of my cross platform projects on a portable hard disk and have no problems running them where they are on my Windows Laptop (boo, I know), but when I work on my Arch desktop, everything will compile and write fine, but try to run the compiled project located on the hard disk, it spits out a "Insufficient permissions" error at me, even when I try to run the program as root. Ignoring the blatantly and painfully obvious problem (I am 9001% certain that I am running the Linux build, not the windows build), what permissions do I need to set to be able to run executable files located on a portable/removable drive?

Here's the ls -l for the media directory:

drwxrwxr-x 2 root root  4096 Feb 25 23:56 cd
drwxrwxr-x 2 root root  4096 Mar 26 11:25 cdrom
drwxrwxr-x 2 root root  4096 Feb 25 23:56 dvd
drwxrwxr-x 2 root root  4096 Mar 26 11:25 dvdrw
drwxrwxr-x 2 root root  4096 Mar 27 15:37 extdrive
drwxrwxr-x 2 root root  4096 Mar 26 11:25 fd0
drwxrwxr-x 2 root root  4096 Feb 25 23:56 fl

#these are my external media mount directories.
drwxrwxr-x 2 orm users 4096 Apr 11 13:45 flash #Even this one won't work. Ignore me please.
drwxr-xr-x 2 root root  4096 Apr 18 18:58 sdc1   #I usually mount drives here
drwxrwxr-x 2 root root  4096 Apr 18 18:54 sdd1 #and here. These are the directories I'm focused on.

Here is the relevant part of my /etc/fstab

#I manually mount to the /media/flash directory.
/dev/sdc1              /media/sdc1    auto    rw,user,noauto          0      0
/dev/sdd1              /media/sdd1    auto    rw,user,noauto          0      0

For the life of me, I can not see anything wrong with any of these. Am I looking in the wrong place?

Last edited by Orm (2010-05-02 04:31:19)


Clever tagline here.

Offline

#2 2010-04-28 13:27:18

knopwob
Member
From: Hannover, Germany
Registered: 2010-01-30
Posts: 239
Website

Re: (Solved) Problems Running Programs Located on Portable Drive

just an idea: are the external drives formatted with ntfs or fat? These filesystems don't support permission settings like the unix filesystems. But i can't test this theory atm.

Offline

#3 2010-04-28 13:47:24

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,397

Re: (Solved) Problems Running Programs Located on Portable Drive

...Or you can try something like:

. ./myexecutable

Which should force execution even if no permissions are set.
(works in bash, at least)

Last edited by kokoko3k (2010-04-28 13:47:39)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#4 2010-04-28 16:31:28

grey
Member
From: Europe
Registered: 2007-08-23
Posts: 679

Re: (Solved) Problems Running Programs Located on Portable Drive

kokoko3k wrote:

...Or you can try something like:

. ./myexecutable

Which should force execution even if no permissions are set.
(works in bash, at least)

... provided that myexecutable is a bash script. '.' sources its argument. It doesn't work on a binary file.


Good ideas do not need lots of lies told about them in order to gain public acceptance.

Offline

#5 2010-04-28 16:34:25

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: (Solved) Problems Running Programs Located on Portable Drive

don't you just need to add exec to the fstab line?

Offline

#6 2010-04-28 16:35:58

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,804

Re: (Solved) Problems Running Programs Located on Portable Drive

try executing mount and see if the drive mounted with the noexec option

edit:  Doh!  brisbin33 beat me to it.

Last edited by ewaller (2010-04-28 16:37:00)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#7 2010-04-28 17:36:51

grey
Member
From: Europe
Registered: 2007-08-23
Posts: 679

Re: (Solved) Problems Running Programs Located on Portable Drive

Here is the entry from man mount:

user   Allow  an  ordinary  user  to  mount the filesystem.  [...]  
         This option implies the options noexec, nosuid, and nodev 
         (unless overridden by subsequent  options,  as  in  
         the  option  line user,exec,dev,suid)

Last edited by grey (2010-04-28 17:37:39)


Good ideas do not need lots of lies told about them in order to gain public acceptance.

Offline

#8 2010-04-30 23:53:18

Orm
Member
Registered: 2009-08-10
Posts: 24

Re: (Solved) Problems Running Programs Located on Portable Drive

When I get back, ill try the exec line in fstab.


Clever tagline here.

Offline

#9 2010-05-01 05:57:01

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: (Solved) Problems Running Programs Located on Portable Drive

running "mount" with no arguments should tell you whether the devices are getting mounted with exec permissions or not. If they are, then adding exec to the fstab should be redundant and the problem is something else. If they aren't, then there's your problem.

Offline

#10 2010-05-02 04:30:59

Orm
Member
Registered: 2009-08-10
Posts: 24

Re: (Solved) Problems Running Programs Located on Portable Drive

Adding the exec line in fstab solved it. Thanks guys!


Clever tagline here.

Offline

Board footer

Powered by FluxBB