 |
 |
 |
 |
| Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum. |

11th March 2012, 11:32 AM
|
|
Registered User
|
|
Join Date: Apr 2011
Location: Helsinki
Posts: 44

|
|
System Command in mounted directory
Hello,
I am running Fedora 14 on a 32 bit system, was working with a mounted NTFS directory and came across this problem.
I was running a .m file (Matlab m file) in which there is a line where there is a call to "system" command . This line creates an error like this if the .m file is run from the NTFS mounted directory :-
Code:
Error using ==> mp3read>mysystem at 373
unable to execute "/media/Ajay/Documents/MusicWork/Codes/mp3info.glnx86" -r m -p "%Q %u %b
%r %v * %C %e %E %L %O %o %p" "/home/milli/Downloads/Khuda Kay Liye - Tiluk Kamod.mp3"
(/bin/bash: /media/Ajay/Documents/MusicWork/Codes/mp3info.glnx86: Permission denied
)
Error in ==> mp3read at 188
w = mysystem(cmd);
But it works fine if I execute the M-file from the /home direcrory or any folders beneath ( ie in the Fedora file system).
I have even tried to go to super user mode, but the error persists
Could someone clarify this ?
Ajay
|

11th March 2012, 01:52 PM
|
 |
Registered User
|
|
Join Date: Jun 2007
Location: Lytham St Annes, Lancashire, UK
Posts: 309

|
|
|
Re: System Command in mounted directory
Two things to check - is the file marked as executable? Run the following
Code:
ls -l /media/Ajay/Documents/MusicWork/Codes/mp3info.glnx86
And the other is, has the file system been mounted with the "noexec" option? Run the following command
Code:
grep media /etc/mtab
Post the output from those commands.
How are you mounting your NTFS partition? Also post the line in /etc/fstab that mounts it, or the command you use to mount it if you dont't use /etc/fstab..
|

11th March 2012, 02:14 PM
|
|
Registered User
|
|
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,150

|
|
|
Re: System Command in mounted directory
I lean a bit more to "/media/Ajay/Documents/MusicWork/Codes/mp3info.glnx86" using/creating some intermediate files and cannot - which causes an error exit, which in turn is mis-interpreted by MatLab as "can't execute".
I'm basing this on the fact that it works when in the users home directory, but doesn't work anywhere else.
|

11th March 2012, 03:33 PM
|
|
Registered User
|
|
Join Date: Apr 2011
Location: Helsinki
Posts: 44

|
|
|
Re: System Command in mounted directory
Hello,
The permission s for the file are not getting set, inspite of changing to super user mode and executing chmod +X.
Code:
milli@milli Codes]$ chmod +x mp3info.glnx86
[milli@milli Codes]$ ls -l mp3info.glnx86
-rw-------. 1 milli milli 26712 Nov 13 2006 mp3info.glnx86
Also, the output of etc / mtav is litsed below :-
Code:
grep media /etc/mtab/dev/sda5 /media/Ajay fuseblk rw,nosuid,nodev,allow_other,blksize=4096,default_permissions 0 0
I didnt use the "mount command" for mouting but just use it from the Desktop GUI... so I dont know what it uses.
Ajay
|

11th March 2012, 04:24 PM
|
|
Registered User
|
|
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,150

|
|
|
Re: System Command in mounted directory
NTFS is not a trusted filesystem. By default it does not mount with execute privileges as this is a sure fire way to recieve/generate viruses on both Linux (running as the user) or windows (running as anybody).
|

11th March 2012, 05:49 PM
|
|
Registered User
|
|
Join Date: Apr 2011
Location: Helsinki
Posts: 44

|
|
|
Re: System Command in mounted directory
Hello,
I did not mention that I have a dual booted laptop with Fedora 14 and Windows 7.
I wanted all the data, Documents and Movies etc to be in a separate D drive and the files related to the two OS s separate. Also, I wanted to access this data from both Windows and Fedora . So I decided to keep the data partition as separate and format it as NTFS.
A simple way to get out of this would be to copy the files with which I was working into the Linux file system. But is there any other way ? I want to know if reformatting the data drive as anything other than NTFS would make it unreadable from Wnidows 7.
Ajay
|

11th March 2012, 09:53 PM
|
 |
Registered User
|
|
Join Date: Jun 2007
Location: Lytham St Annes, Lancashire, UK
Posts: 309

|
|
|
Re: System Command in mounted directory
The problem is that NTFS knows nothing about Linux file permissions and ownership. Therefore when you mount such a non-Linux file system, Linux just applies a default set of permissions to everything in the file system and you cannot modify individual files with "chmod" and "chown" - the file system does not support it. Mounting the NTFS partition using the GUI means you have little control over the defaults applied to the file system.
You could make files executable on the NTFS partition by using /etc/fstab to mount it at boot with the required options. E.g. make a mount-point (don't use /media as Gnome uses this for auto-mounting removable media etc.) As root then add a line similar to this in /etc/fstab
Code:
/dev/sda5 /data ntfs rw,auto,async,exec,nosuid,nodev,umask=022,uid=500,gid=500 0 0
Note the values for "uid" and "gid" above should be as shown by running the "id <your user name>" as your usual user. You can mount this the first time without rebooting (and check that the fstab entry is correct) by running as root However, the problem is really having Linux programs on the shared drive rather than on your Linux file system.
Last edited by SteveGYBE; 11th March 2012 at 09:57 PM.
Reason: Check after putting on glasses...
|

12th March 2012, 10:41 PM
|
|
Registered User
|
|
Join Date: Apr 2011
Location: Helsinki
Posts: 44

|
|
Re: System Command in mounted directory
Hello,
I did a simple workaround. I transferred the files .M files which I was working with into the MATLAB path under the home directory, and added the path and called the files from there . It works !
I will mark this thread as solved.
Ajay
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 05:44 (Thursday, 20-06-2013)
|
|
 |
 |
 |
 |
|
|