Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11th March 2012, 11:32 AM
ajayram Offline
Registered User
 
Join Date: Apr 2011
Location: Helsinki
Posts: 44
linuxopera
Unhappy 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
Reply With Quote
  #2  
Old 11th March 2012, 01:52 PM
SteveGYBE's Avatar
SteveGYBE Offline
Registered User
 
Join Date: Jun 2007
Location: Lytham St Annes, Lancashire, UK
Posts: 309
linuxfirefox
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..
Reply With Quote
  #3  
Old 11th March 2012, 02:14 PM
jpollard Offline
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,150
linuxfirefox
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.
Reply With Quote
  #4  
Old 11th March 2012, 03:33 PM
ajayram Offline
Registered User
 
Join Date: Apr 2011
Location: Helsinki
Posts: 44
linuxopera
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
Reply With Quote
  #5  
Old 11th March 2012, 04:24 PM
jpollard Offline
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,150
linuxfirefox
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).
Reply With Quote
  #6  
Old 11th March 2012, 05:49 PM
ajayram Offline
Registered User
 
Join Date: Apr 2011
Location: Helsinki
Posts: 44
linuxopera
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
Reply With Quote
  #7  
Old 11th March 2012, 09:53 PM
SteveGYBE's Avatar
SteveGYBE Offline
Registered User
 
Join Date: Jun 2007
Location: Lytham St Annes, Lancashire, UK
Posts: 309
linuxfirefox
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
Code:
mkdir /data
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
Code:
mount /data
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...
Reply With Quote
  #8  
Old 12th March 2012, 10:41 PM
ajayram Offline
Registered User
 
Join Date: Apr 2011
Location: Helsinki
Posts: 44
linuxopera
Smile 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
Reply With Quote
Reply

Tags
command, directory, mounted, ntfs, system command

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there any way to see which devices are not mounted from the command line? IcicleSteak Using Fedora 5 3rd October 2011 02:34 AM
NFS Mounts, but no files in mounted directory gmdune Using Fedora 10 10th February 2011 08:28 PM
Mounted NFS directory contents not visible in file browser. Cteam1 Using Fedora 0 23rd September 2010 02:51 AM
Copying a mounted, read-only file system with dd gerry.butler Using Fedora 2 28th November 2009 05:47 AM
vsftpd + mounted windows partitions as root directory leonard Servers & Networking 0 3rd November 2006 08:13 AM


Current GMT-time: 05:44 (Thursday, 20-06-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat