FAQ SearchLogin
Tuxera Home
View unanswered posts | View active topics It is currently Thu Jun 17, 2021 08:14



Post new topic Reply to topic  [ 7 posts ] 
Forced Executable Status for All Files? 
Author Message

Joined: Sat Aug 14, 2010 19:30
Posts: 4
Post Forced Executable Status for All Files?
I know that Windows and Linux use permissions differently, but I have a problem where any file on my NTFS drive (from both of my computers) is being read as 777 (read/write/execute for all) regardless of its original permissions and whether or not it was created in Linux (Ubuntu 10.04) or Windows. Checking other drives, it seems to be universal problem with my NTFS support.

I am trying to transfer all of my files from my old computer (running Ubuntu 10.04) to the external drive (connected to a computer using both Windows 7 and Ubuntu 10.04). Unfortunately, since the files don't maintain their original permissions during the transfer, this would be extraordinarily difficult. I don't really care if all of the files have their permissions modified so long as the executable bits remain the way they were (ie I don't care if a 600 file goes to 666, but it going to 777 is a problem).

Does anyone know of a way to keep the executable bits constant during such a transfer?


Sat Aug 14, 2010 19:37
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: Forced Executable Status for All Files?
Hi,

Quote:
I know that Windows and Linux use permissions differently, but I have a problem where any file on my NTFS drive (from both of my computers) is being read as 777 (read/write/execute for all) regardless of its original permissions and whether or not it was created in Linux (Ubuntu 10.04) or Windows. Checking other drives, it seems to be universal problem with my NTFS support.

You may tar your original files and untar them to the destination (if ntfs is just an intermediate store).
Quote:
Does anyone know of a way to keep the executable bits constant during such a transfer?

With the latest released version ntfs-3g-2010.8.8 you can set and use the ownership and permissions to files the usual way (which is doing a "cp -Rp" or "cp -a" in your use case). Just define the option "permissions" on the mount command (see the manual at http://www.tuxera.com/community/ntfs-3g-manual/ and more details at http://www.tuxera.com/community/ntfs-3g ... rmissions/ ).

Note : on a different computer, the Windows identification of users will change. Your new Windows instance may deny permissions given to some user by your old Windows. Same on Ubuntu if the numeric user identification in not the same. An execution flag restricted to the owner (mode 0700) will appear as non-executable to another user on a different computer.

Regards

Jean-Pierre


Sat Aug 14, 2010 21:58
Profile

Joined: Sat Aug 14, 2010 19:30
Posts: 4
Post Re: Forced Executable Status for All Files?
Thanks! I didn't think of the tarball solution, which might help (I was hoping to have a more permanent store on the drive, but the tar will help for immediate transfer). As for the mount options, I'll have try them out and see if they work. My drive is being automounted by Ubuntu, do you know how to change the way it automounts, or would I have to go into the system and un/remount every time?


Sun Aug 15, 2010 00:11
Profile

Joined: Sat Aug 14, 2010 19:30
Posts: 4
Post Re: Forced Executable Status for All Files?
I tried using this command after unmounting the automounted drive:
Code:
ntfs-3g -o permissions /dev/sdb1 /media/extDrive


The command seemed to work, but all files on the drive were still treated as executable, and any new file I created and/or copied was still treated as executable (in other words, using the permissions flag did not fix my problems). Am I running this command right?


Sun Aug 15, 2010 00:26
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: Forced Executable Status for All Files?
Hi,

Quote:
ntfs-3g -o permissions /dev/sdb1 /media/extDrive

Am I running this command right?

Yes, but ... this is only valid since ntfs-3g-2010.8.8
If you use another version, not older than ntfs-3g-2009.11.14 you get the same result by creating the file .NTFS-3G/UserMapping containing the following line :
Code:
::S-1-5-21-3141592653-589793238-462643383-10000

(the directory .NTFS-3G - do not forget its initial dot - must be located in the root of the ntfs file system).

To know the ntfs version you are using, just type :
Code:
ntfs-3g --help


Regards

Jean-Pierre


Sun Aug 15, 2010 08:24
Profile

Joined: Sat Aug 14, 2010 19:30
Posts: 4
Post Re: Forced Executable Status for All Files?
Thanks for the help. My version is 2010.3.6, so that explains why the permissions flag isn't doing anything different.

I assume the .NTFS-3G folder goes in the home directory of the user mounting the drive? There isn't a directory with that name already in my home directory, should I just create it? If I'm using root to mount the drive (ie sudo ntfs-3g) should the file go in root's home instead of mine?


Sun Aug 15, 2010 17:55
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: Forced Executable Status for All Files?
Hi,

Quote:
I assume the .NTFS-3G folder goes in the home directory of the user mounting the drive?

Usually no. Mounting is not specific to a user.

Its default location is the root directory of the ntfs partition (if you are mounting on /media/extDrive then the location after mounting is /media/extDrive/.NTFS-3G/UserMapping). This means you have to first mount, then create the directory and file, then unmount and mount again for the file to be taken into account.

Alternately, you may put the user mapping file on a previously mounted partition, and indicate its location in the mount command :

Code:
ntfs-3g -o usermapping=<full-path-to-file> /dev/sdb1 /media/extDrive

This is explained in your manual (man ntfs-3g).

Regards

Jean-Pierre


Sun Aug 15, 2010 19:50
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Original forum style by Vjacheslav Trushkin.