Execute Permission through Terminal for a file stored on /Media/DISK-1

Asked by Abhijit P. Bongale

Recently I have started to learn Shell_Scripting under UBUNTU. Where I am facing a problem while executing permission to a file which is stored on /media/6A60F69B60F66D67. When I give command like,

abhijit@ubuntu:/media/6A60F69B60F66D67/Programs/Shell_Scripting$ chmod 755 first
abhijit@ubuntu:/media/6A60F69B60F66D67/Programs/Shell_Scripting$ ./first
bash: ./first: Permission denied
abhijit@ubuntu:/media/6A60F69B60F66D67/Programs/Shell_Scripting$

-system does not show any error massage, but while executing program system show me 'Permission Denied' error.
Please look into this as soon as possible.

Regards,
Abhijit.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gnome-terminal Edit question
Assignee:
No assignee Edit question
Solved by:
Eliah Kagan
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

is the file owned by your user?

Revision history for this message
Abhijit P. Bongale (a-bongale) said :
#2

Hi,

The file is newly created under the same user. I appreciate your help.

Regards,
Abhijit.

From: actionparsnip &lt;<email address hidden>&gt;
Sent: Sat, 15 Oct 2011 23:05:51
To: <email address hidden>
Subject: Re: [Question #174526]: Execute Permission through Terminal for a file stored on /Media/DISK-1
Your question #174526 on gnome-terminal in Ubuntu changed:

https://answers.launchpad.net/ubuntu/+source/gnome-terminal/+question/174526

 &nbsp; &nbsp;Status: Open =&gt; Needs information

actionparsnip requested more information:

is the file owned by your user?

--

To answer this request for more information, you can either reply to

this email or enter your reply at the following page:

https://answers.launchpad.net/ubuntu/+source/gnome-terminal/+question/174526

You received this question notification because you asked the question.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

Noticed the file is in /media is this a USB storage etc? If so what file system is it?

Revision history for this message
delance (olivier-delance) said :
#4

Please avoid posting with previous message included. It makes Web interface hard to read.
Could you run command:
   ls -l first
   who am i

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#5

Can you also give the output of:

mount

Thanks

Revision history for this message
Abhijit P. Bongale (a-bongale) said :
#6

Hi,

Do you have any suggestion of below issue.

Regards,
Abhijit.

From: "Abhijit Prakash Bongale"&lt;<email address hidden>&gt;
Sent: Tue, 18 Oct 2011 22:01:50
To: &lt;<email address hidden>&gt;
Subject: Re: [Question #174526]: Execute Permission through Terminal for a file stored on /Media/DISK-1
Hi,

Please check below is the output of 'mount',

abhijit@ubuntu:~$ mount

/dev/loop0 on / type ext4 (rw,errors=remount-ro,commit=0)

proc on /proc type proc (rw,noexec,nosuid,nodev)

none on /sys type sysfs (rw,noexec,nosuid,nodev)

fusectl on /sys/fs/fuse/connections type fusectl (rw)

none on /sys/kernel/debug type debugfs (rw)

none on /sys/kernel/security type securityfs (rw)

none on /dev type devtmpfs (rw,mode=0755)

none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)

none on /dev/shm type tmpfs (rw,nosuid,nodev)

none on /var/run type tmpfs (rw,nosuid,mode=0755)

none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)

/dev/sda1 on /host type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)

binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)

gvfs-fuse-daemon on /home/abhijit/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=abhijit)

/dev/sda5 on /media/30F8B80BF8B7CD7A type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)

/dev/sda6 on /media/2898C19398C16044 type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)

Regards,

Abhijit.

On Tue, 18 Oct 2011 09:45:53 +0530 wrote

&gt;Your question #174526 on gnome-terminal in Ubuntu changed:

https://answers.launchpad.net/ubuntu/+source/gnome-terminal/+question/174526

actionparsnip requested more information:

Can you also give the output of:

mount

Thanks

--

To answer this request for more information, you can either reply to

this email or enter your reply at the following page:

https://answers.launchpad.net/ubuntu/+source/gnome-terminal/+question/174526

You received this question notification because you asked the question.

Treat yourself at a restaurant, spa, resort and much more with Rediff Deal ho jaye!

Revision history for this message
Best Eliah Kagan (degeneracypressure) said :
#7

The output of mount does not show /media/6A60F69B60F66D67, suggesting that you ran the command when that volume was not mounted. You must mount the volume in order for the mount command to show how it is being mounted.

However, it seems likely that it is either being mounted in such a way that you cannot change the execute bit on files (or it's a filesystem that doesn't have an execute bit and the permissions assigned have it disabled, which comes down to the same thing), or it is mounted so that programs are not permitted to be executed from it. Either way, if the program you are trying to run is a script, you can get around the problem by invoking the scripting engine itself, with the name of the program as the argument. So if the program is a shell script, you would invoke the appropriate shell.

If you wrote it yourself, then you probably know what shell to use. If the shell is sh, you can run:

sh first

If the shell is bash, you can run:

bash first

And so forth.

If for some reason you do not know what shell the script uses (or whether or not it is a shell script...or even any kind of script at all), you can find out by using the file utility:

file first

Revision history for this message
Abhijit P. Bongale (a-bongale) said :
#8

I am using the bash shell, so after running the script with 'bash <script name>' the problem solved.
Thanks.

Revision history for this message
Abhijit P. Bongale (a-bongale) said :
#9

Hi,

The file is stored on hard disk drive and it has NTFS (MS-Windows) file system.

Regards,
Abhijit.

On Sun, 16 Oct 2011 14:15:49 +0530 wrote
>Your question #174526 on gnome-terminal in Ubuntu changed:

https://answers.launchpad.net/ubuntu/+source/gnome-terminal/+question/174526

  Status: Open => Needs information

actionparsnip requested more information:

Noticed the file is in /media is this a USB storage etc? If so what file

system is it?

--

To answer this request for more information, you can either reply to

this email or enter your reply at the following page:

https://answers.launchpad.net/ubuntu/+source/gnome-terminal/+question/174526

You received this question notification because you asked the question.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#10

Then the file system needs marking all as executable when it is mounted as NTFS cannot hold complex Linux file permissions.

Revision history for this message
Abhijit P. Bongale (a-bongale) said :
#11

Hi,

Please check below is the output of 'mount',
abhijit@ubuntu:~$ mount
/dev/loop0 on / type ext4 (rw,errors=remount-ro,commit=0)
proc on /proc type proc (rw,noexec,nosuid,nodev)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
none on /dev type devtmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /dev/shm type tmpfs (rw,nosuid,nodev)
none on /var/run type tmpfs (rw,nosuid,mode=0755)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
/dev/sda1 on /host type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/abhijit/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=abhijit)
/dev/sda5 on /media/30F8B80BF8B7CD7A type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)
/dev/sda6 on /media/2898C19398C16044 type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)

Regards,
Abhijit.

On Tue, 18 Oct 2011 09:45:53 +0530 wrote
>Your question #174526 on gnome-terminal in Ubuntu changed:

https://answers.launchpad.net/ubuntu/+source/gnome-terminal/+question/174526

actionparsnip requested more information:

Can you also give the output of:

mount

Thanks

--

To answer this request for more information, you can either reply to

this email or enter your reply at the following page:

https://answers.launchpad.net/ubuntu/+source/gnome-terminal/+question/174526

You received this question notification because you asked the question.