Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a NTFS partition on my PC. It shares data between Linux and a Windows dual boot system.

My /etc/fstab line for that is:

#Mount Dati at boot=
UUID=01CD9E64E80BD460 /mnt/Dati ntfs nls=iso8859-1,umask=0022,uid=1000,gid=1000,dmask=027,fmask=137 0 0

There is something wrong, because I can not make any files executable. What should I change?

In addition, can someone help me understand umask, dmask, and fmask or post a link to some guide?

Summarizing: What permission should I give to a NTFS partition that is shared between Linux and Windows, and shared on samba network?

share|improve this question
    
Are you trying to prevent files on that filesystem from being executed or you want to be able to execute them? The permissions you should give do not depend on which OS is going to use the FS but on what you want to do with the files in it. –  David Kohen Nov 28 '12 at 14:27
    
i want to be able to execute them. i'm not well explained, my mistake. –  f.lambe Nov 29 '12 at 13:08
    
On the Windows system? If so you don't need the execute bit, Windows ignores it. –  David Kohen Nov 29 '12 at 14:18
    
misunderstanding.. I'm not able to execute files from Linux system. I've written about win, beacause the partition where there are these files is NTFS –  f.lambe Nov 29 '12 at 17:55

1 Answer 1

I know this question was asked a while ago, but I will try to answer it anyway for future users:

About mask in file system:

The use of masks in linux filesystem is to control - read, write, and execute permission among different users/groups for specific files and folders. I emphasize the word 'control' because masks are not same as giving permission. Just the opposite; they are to control or limit permission. So, if you want to set 777 for a file as permission, then you have to use 000 as mask for that file. For permission 655, mask will be 122 (i.e: for permission xyz mask will be (777-xyz)).

What is umask,dmask, and fmask?

  • umask = user mask (folder and directory!)
  • dmask = directory only mask
  • fmask = file only mask

How To Set Executable Permission for NTFS Partition files?

Run this command to get UUID (Universally Unique IDentifier) for every NTFS drive:

$ sudo blkid

You will get output like this:

/dev/sda6: LABEL="Software" UUID="FEDC5DB5DC5D6943" TYPE="ntfs" 
/dev/sda7: LABEL="Works" UUID="585AD06A35149024" TYPE="ntfs" 

Now edit the fstab file:

$ sudo vim /etc/fstab

In the fstab file add/edit every drive specifying line with the following options (remember to use other option carefully, as adding any other option may cause problem):

defaults,auto,umask=002 

So after edit/adding nfts drives your portion of fstab file will look something like this:

#<file system>           <mount point>   <type>  <options>                  <dump>  <pass>
UUID=FEDC5DB5DC5D6943   /media/software   ntfs    defaults,auto,umask=002      0      0
UUID=585AD06A35149024   /media/works      ntfs    defaults,auto,umask=002      0      0

Above umask will set permission equal 775, i.e read-write-execute for admin user (that is you) and admin user group and read-write permission for other users. For samba share you might need to use gid=YourGroupID,uid=YourUserID in the option set. You can find YourGroupID and YourUserID values using the following command:

$ id YourUserName

Now Unmount your drives if already mounted:

$ sudo umount -a

Then mount by this command:

$ sudo mount -a

After mount you can use the drives in whatever way you want.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.