LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-17-2013, 03:44 PM   #1
plisken
Member
 
Registered: Dec 2001
Location: Scotland
Distribution: Slackware 9.1-15 RH 6.2/7, RHEL 6.5 SuSE 8.2/11.1, Debian 10.5
Posts: 516

Rep: Reputation: 32
mounting ntsf drive in fstab , unsure of fmask and dmask values


I've created a mount point and an entry in my fstab which is as follows:
Code:
/dev/sdc1   /DATA   ntfs-3g  fmask=111,dmask=000   1   0
Now, I'm unsure what values I should have for fmask and dmask

From googling, I believe the above is full access to all, which I'm not wanting.
The other options I tried were
Code:
 fmask=133,dmask=022
I wish only 1 user and root to be able to have full access, none else.

All help appreciated...

thanks
 
Old 04-17-2013, 04:00 PM   #2
alkk
LQ Newbie
 
Registered: Feb 2013
Posts: 4

Rep: Reputation: Disabled
Mount it with options "umask=022,dmask=022,uid=1000", where "1000" is id of the user allowed to acces. You can check your user id with command "id"

More information on umask: http://en.wikipedia.org/wiki/Umask
 
Old 04-17-2013, 11:57 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Actually, if you read that link carefully and this http://linux.die.net/man/8/mount, dmask+fmask are for (V)FAT filesytems.
For NTFS its just umask.
 
Old 04-18-2013, 04:46 AM   #4
alkk
LQ Newbie
 
Registered: Feb 2013
Posts: 4

Rep: Reputation: Disabled
Quote:
Originally Posted by chrism01 View Post
Actually, if you read that link carefully and this http://linux.die.net/man/8/mount, dmask+fmask are for (V)FAT filesytems.
For NTFS its just umask.
You are wrong, dmask+fmask is supported by ntfs3g (but can be replaces with ulimit, yes): http://linux.die.net/man/8/ntfs-3g
 
Old 04-18-2013, 08:44 AM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
I'm surprised those other links don't mention it.
 
Old 04-18-2013, 01:14 PM   #6
plisken
Member
 
Registered: Dec 2001
Location: Scotland
Distribution: Slackware 9.1-15 RH 6.2/7, RHEL 6.5 SuSE 8.2/11.1, Debian 10.5
Posts: 516

Original Poster
Rep: Reputation: 32
I found the following text quite informative, I take no responsability for it and unfortunately, can not remember from where it came.
Code:
fmask, dmask, and umask taken together pertain only to Windows filetypes ( NTFS and FAT32 ) whereas umask alone pertains to both windows and Linux filetypes but are implemented 2 different ways.

On Linux Filesystems

At the moment of birth every file has permissions of 666 and every directory has permissions of 777. A system wide umask is created to modify these permissions immediately after birth and it's currently set at 002. So when you create a new file it's permissions are:

666
002 <-- minus the umask
==
664

And every new directory has permissions of:

777
002 <-- minus the umask
==
775

On Windows Filesystems

Windows fileystems have no Linux file permission attributes so a virtual filesystem is used to create a "view" to give them the appearance that they do have them. The system wide umask has no affect on these filesystems nor does a chmod or a chown. They can only be set when the "view" is created in fstab.

At the moment of birth NTFS files and folders start out with exactly the same permissions: 777. If you were to set up in fstab a umask of 002 for these partitions then the result would be different from a Linux filesystem:

File: 777 - 002 = 775
Folder: 777 - 002 = 775

The folder setting is fine and that's the way you want them to be but the files have all been made executable - every single one of them. You can change that by separating umask into it's constituent parts: fmask and dmask:

So if you set up fstab this way for an NTFS partition: dmask=002,fmask=113

File: 777 - 113 = 664
Folder: 777 - 002 = 775
All that said, I have opted for the folling line to be added to my fstab:
Code:
/dev/sdc1        /DATA            ntfs-3g     fmask=113,dmask=002,uid=1000    1   0
which seems to be working for me just now.

giving root and myself (1000) rw access to files and rwx access to folders
other users r access to files and rx access to folders.

This was based on a standard Slack install setting fmask to 133 and dmask to 022 based on root having read/write access to the ntfs partition.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
dmask=,fmask=,umask= ARGHHHHHHH mickboda Linux - General 3 02-21-2019 06:17 AM
fmask dmask for ntfs-3g Eerie Linux - Newbie 1 06-08-2012 12:16 PM
default fmask, dmask, umask Nick_C Linux - General 2 05-14-2012 10:53 AM
[SOLVED] mount ntfs with fstab dmask=027,fmask=137 but no write access menthor Debian 3 01-29-2012 04:56 PM
umask,dmask,fmask mmm Linux - General 1 08-14-2003 12:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration