LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Setting execute permissions on a second hard drive (https://www.linuxquestions.org/questions/linux-newbie-8/setting-execute-permissions-on-a-second-hard-drive-872927/)

Diogones 04-04-2011 01:30 PM

Setting execute permissions on a second hard drive
 
I am running Linux Mint on my primary hard drive, and I would like to access some folders I have on my second hard drive, which has Windows XP installed on it. However, whenever I try to use these folders, I am greeted with the error message, "The file is not marked as executable." While I know how to set files as executable whenever I am using folders on my Linux drive, whenever I try to set such permissions on my XP folders, I can't seem to make it work. The files revert to their former status, and I'm told that I don't have permission. Should I set the files as sharable from within XP, so that they aren't marked as read-only? Or is there another solution I've missed?

T3RM1NVT0R 04-04-2011 01:36 PM

@ Reply
 
Hi Diogones,

Try chattr -i filename.

It might be possible that immutable attribute has been set on the file which is not allowing you to change the permission.

frankbell 04-04-2011 09:30 PM

My understanding is that Windows file systems don't understand Linux permissions routine.

I'm a little curious, too. Linux cannot "execute" Windows executables (*.exe files), so the executable attribute would seem to me not to be much of an issue, whereas "read" and "write" could be extremely important.

Just for grins and giggles, try running ls -l on the some files on the Windows partition and report back what it tells you.

As I write this, it occurs to me to ask whether the Windows drives are in your /etc/fstab and, if so, what does fstab say about them.

David the H. 04-04-2011 09:47 PM

frankbell is correct. FAT and NTFS are not capable of natively handling *nix style permissions and ownership. They can only be simulated at mount time with various masking options (uid, gid, umask, fmask, and dmask). See the relative sections of the mount and ntfs-3g man pages for more.

Diogones 04-05-2011 11:29 AM

Wow thanks everyone for the helpful replies! I'm still a recent newcomer to Linux, but it just amazes me how helpful the community is!

OK, I understand that Linux can't understand .exe files, so I was hoping that I would be able to run them with WINE, and this is why I was trying to get executable permissions. I ran the ls -l on the partition as you suggested Frankbell, and so far it has been a mixed bag. I see a lot of different permissions for different files, but for the executable folders I'm trying to access, their permission status isn't listed at all, including no reading or writing permissions.

Just a quick question T3RM1NVTOR: what does it mean when the file has an immutable attribute? Does it simply mean that it is inalterable, or could I change the permissions, with that command?

Alright David the H, so the XP partition will not change because it uses a different ownership system than Linux, so thank you for explaining that. I will certainly check out the mount and ntfs -3g man pages for more info, but I'm uncertain what you mean by masking options. I'm afraid I haven't gotten that far with my Linux usage to learn what masking is.

As a final note, maybe I could simply mount the XP Partition with VirtualBox, and run the programs that way? It might be easier than trying to set the permissions so that Wine could launch the files.

T3RM1NVT0R 04-05-2011 04:48 PM

@ Reply
 
Hi Diogones,

Yes when a file is set with immutable attribute it is inalterable, you will not be able to make any changes to permission nor you will be able to edit the file, it will open in Read Only mode. You have to first remove the immutable attribute then only you will be able to edit the file or change permissions.

To check if the file is set with immutable attribute you can type: lsattr filename

More information on lsattr can be found at: http://linux.die.net/man/1/lsattr

One more thing that you might find useful is that if you would like to run any Windows application you would require an emmulation software for this on Linux. Wine (www.winehq.com) and CrossOver Office (www.codesweaver.com) are the ones which I am aware of.

frankbell 04-05-2011 06:15 PM

Quote:

Originally Posted by Diogones (Post 4314736)
OK, I understand that Linux can't understand .exe files, so I was hoping that I would be able to run them with WINE, and this is why I was trying to get executable permissions.

I don't think wine cares about Linux permissions on Windows programs. I have a Windows executable that I use from time to time.

In Linux, it has the following permissions:

Code:

-rw-r--r--
Nevertheless, it runs just fine under wine.

TobiSGD 04-05-2011 06:41 PM

Please don't try to run Windows programs with Wine from a working Windows installation. The WineHQ website warns that this will definitely damage your Windows. By the way, as frankbell also stated, you don't need the executable flag for wine, because wine is the part that will be executed and then run the Windows executable.
If you want to run Windows programs in Linux, I would either recommend a clean install of that program through Wine (if it is supported) or a clean install of Windows in a virtual machine.

Diogones 04-06-2011 09:26 AM

Thank you for that clarification, T3R, I'll use that command and find out about the immutable attributes (if any) held by the folders.

I didn't realize that Wine doesn't need executable permissions, Tobi and frankbell, so thanks for explaining that. However, whenever I select the program and tell Linux to open it with Wine, I still get the "not marked as executable" error message. Wine may not care, but Linux still does for some reason.

Dash it all, Tobi, I didn't realize that Wine shouldn't be run from a Windows installation. Now that might explain why, after trying to launch a Windows program with Wine, I can no longer boot up XP. The partition is fine, as all the files are there, and it does appear in the Mint bootloader, but whenever I select it now, it just defaults to the Mint partition boot. I guess I'll just have to find a way to repair it, or restore if that isn't an option. Thank you for the advice!


All times are GMT -5. The time now is 01:03 PM.