LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - Installation
User Name
Password
Slackware - Installation This forum is for the discussion of installation issues with Slackware.

Notices


Reply
  Search this Thread
Old 04-05-2022, 12:34 PM   #1
waynelloydsmith
Member
 
Registered: Feb 2012
Location: Canada
Distribution: Slackware15
Posts: 78

Rep: Reputation: Disabled
ntfs3 dmask fmask


I'm running Slackware64 15
I do not understand what the fmask and dmask are doing
the doc I have found says
"fmask=177,dmask=077" "Root has read/write access, users have no access (ntfs-3g)"
"fmask=333,dmask=222" "Everyone has read only access (built-in kernel ntfs driver)"
"fmask=133,dmask=022" "Everyone has read access, but only root can write (ntfs-3g)"
"fmask=111,dmask=000" "All users can read/write to any file (ntfs-3g)" .
my fstab was
/dev/nvme0n1p3 /mnt/ntfs-c ntfs3 fmask=333,dmask=222,uid=500,gid=500 1 0
and yet as root I can still use mkdir on the ntfs partition ?
the mount command says
/dev/nvme0n1p3 on /mnt/ntfs-c type ntfs3 (rw,relatime,uid=500,gid=500,fmask=37777600333,dmask=37777600222,iocharset=utf8)
these mask numbers look strange ?
if I change my fstab to
/dev/nvme0n1p3 /mnt/ntfs-c ntfs3 ro,fmask=333,dmask=222,uid=500,gid=500 1 0
I cannot do mkdir on the ntfs partition as expected
so why does fmask=333 and dmask=222 not prevent root from writing into the NTFS partition ?

I tried fmask=133 and dmask=022 (which is what I want)
but ended up having to run chkdsk on the NTFS partition to repair it.
I had used dolphin to drag and drop some files and directories to the NTFS partition as a user by mistake.

Also the vfat defaults seem to be fmask=0022 and dmask=0022.
what does this mean ?
 
Old 04-05-2022, 12:42 PM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,830

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
probably this helps a bit: https://en.wikipedia.org/wiki/Umask
 
Old 04-05-2022, 02:40 PM   #3
waynelloydsmith
Member
 
Registered: Feb 2012
Location: Canada
Distribution: Slackware15
Posts: 78

Original Poster
Rep: Reputation: Disabled
thanks
that explains what 0022 means.u=rwx,g=rx,o=rx
but not why my mount command shows strange fmask and dmask values
/dev/nvme0n1p3 on /mnt/ntfs-c type ntfs3 (rw,relatime,uid=500,gid=500,fmask=37777600333,dmask=37777600222,iocharset=utf8)
is the dmask/fmask suppose to be 3 digits or 4 digits long
 
Old 04-05-2022, 04:41 PM   #4
waynelloydsmith
Member
 
Registered: Feb 2012
Location: Canada
Distribution: Slackware15
Posts: 78

Original Poster
Rep: Reputation: Disabled
I didn't like what was going on with fmask and dmask so I removed them from fstab
my fstab now looks like this
/dev/nvme0n1p3 /mnt/ntfs-c ntfs3 ro,uid=500,gid=500 1 0
my mount command now shows this
/dev/nvme0n1p3 on /mnt/ntfs-c type ntfs3 (ro,relatime,uid=500,gid=500,iocharset=utf8)
using a usb stick to move files from slackware to windows isn't a big deal for me.
 
Old 04-06-2022, 11:29 AM   #5
waynelloydsmith
Member
 
Registered: Feb 2012
Location: Canada
Distribution: Slackware15
Posts: 78

Original Poster
Rep: Reputation: Disabled
what is the difference between ntfs3 and ntfs-3g
on my slackware15 system there is a "man ntfs-3g" but no "man ntfs3"
 
Old 04-06-2022, 11:33 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,830

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
https://www.kernel.org/doc/html/late...ems/ntfs3.html
https://github.com/tuxera/ntfs-3g/wiki
https://www.paragon-software.com/home/ntfs3-driver-faq/
Quote:
Original Kernel level support for NTFS was contributed into a Linux Kernel back in 2001 and is very limited in functionality, especially write-support. Till now, NTFS-3G was the de facto way to enable NTFS in Linux. However, NTFS-3G is a filesystem in userspace (FUSE). The main drawback of this implementation is performance. On the contrary, NTFS3 is a kernel NTFS implementation, which offers much faster performance than FUSE based implementations.
 
Old 04-06-2022, 11:54 AM   #7
waynelloydsmith
Member
 
Registered: Feb 2012
Location: Canada
Distribution: Slackware15
Posts: 78

Original Poster
Rep: Reputation: Disabled
what is the difference between ntfs3 and ntfs-3g
on my slackware15 system there is a "man ntfs-3g" but no "man ntfs3"
 
Old 04-07-2022, 01:59 AM   #8
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,830

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
What do you think? Should I repeat my post too? That is explained on those pages and I also quoted the most relevant part.
 
Old 04-07-2022, 12:24 PM   #9
waynelloydsmith
Member
 
Registered: Feb 2012
Location: Canada
Distribution: Slackware15
Posts: 78

Original Poster
Rep: Reputation: Disabled
thanks
that explains what is going on with NTFS3
only thing not explained is why
when my fstab was
/dev/nvme0n1p3 /mnt/ntfs-c ntfs3 fmask=333,dmask=222 1 0 (this should be read only)
the mount command shows
/dev/nvme0n1p3 on /mnt/ntfs-c type ntfs3 (rw,relatime,fmask=37777600333,dmask=37777600222,iocharset=utf8)
where did those strange fmask and dmask numbers come from ?
and as root I was still able to use mkdir on the ntfs partition ?
 
Old 04-08-2022, 03:49 AM   #10
Windu
Member
 
Registered: Aug 2021
Distribution: Arch Linux, Debian, Slackware
Posts: 589

Rep: Reputation: Disabled
At least you are not the only one seeing these "3777760" prefixes before your fmask and dmask values.
If you search for "dmask 37777600022" which is a more normal value for a dmask (0022 meaning writable for the owner), you'll find several discussions involving multiple Linux distributions. And no explanation to be found.
 
Old 04-08-2022, 04:46 AM   #11
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,830

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
probably this: https://www.spinics.net/lists/ntfs3/msg00693.html
 
Old 04-08-2022, 11:36 AM   #12
waynelloydsmith
Member
 
Registered: Feb 2012
Location: Canada
Distribution: Slackware15
Posts: 78

Original Poster
Rep: Reputation: Disabled
OK
so the funny numbers are only a display problem (we think)
but
dev/nvme0n1p3 /mnt/ntfs-c ntfs3 fmask=333,dmask=222 1 0
"fmask=333,dmask=222" "Everyone has read only access (built-in kernel ntfs driver)"
as root I was still able to use mkdir on the ntfs partition ?
is root not part of "Everyone" ?
 
Old 04-08-2022, 12:04 PM   #13
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,830

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
no, root has special rights. But anyway umask does not restrict users, just modifies the permissions (see the man page I sent): the mask acts as a last-stage filter that strips away permissions as a file (or dir) is created
 
1 members found this post helpful.
Old 04-08-2022, 01:53 PM   #14
waynelloydsmith
Member
 
Registered: Feb 2012
Location: Canada
Distribution: Slackware15
Posts: 78

Original Poster
Rep: Reputation: Disabled
looking at the NTFS3 manual it says
umask Controls the default permissions for files/directories created after the NTFS volume is mounted
so my concept of what these masks do is completely wrong.
I believe I got this misconception from the wording in the Slackware install.
I'm not going to run the install again but what I remember I was given several choices
on how to mount the NTFS on my machine . I was under the impression it had to do with restricting users.
No wonder I messed up my NTFS.
Thanks
 
Old 04-10-2022, 02:37 PM   #15
waynelloydsmith
Member
 
Registered: Feb 2012
Location: Canada
Distribution: Slackware15
Posts: 78

Original Poster
Rep: Reputation: Disabled
I figured out what happened to my NTFS
if I remove the line
/dev/nvme0n1p3 /mnt/ntfs-c ntfs3 fmask=133,dmask=022 1 0
from fstab and reboot I get
bash-5.1$ pwd
/mnt
ls -l
drwxr-xr-x 2 root root 4096 Feb 27 06:51 ntfs-c
which is great
if I put the line
/dev/nvme0n1p3 /mnt/ntfs-c ntfs3 fmask=133,dmask=022 1 0
back in I get
bash-5.1$ pwd
/mnt
ls -l
drwxrwxrwx 1 root root 8192 Apr 10 12:31 ntfs-c
this is bad news
the root of my NTFS partition is wide open
not sure how to fix this so i'm going back mounting it read only.
 
  


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 Off
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
Why is fmask & dmask required to write to a WinXP share mounted on Mdrake SMB client ruscook_oz Linux - Networking 1 02-08-2007 05:50 PM
getting fat32 (Win98SE) part to mount with dmask and fmask options Simon Bridge Linux - General 3 06-22-2005 01:50 AM
smbmnt,fmask=,dmask=,umask= ARRGGHHH mickboda Linux - Networking 3 12-23-2004 05:04 PM
umask,dmask,fmask mmm Linux - General 1 08-14-2003 12:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - Installation

All times are GMT -5. The time now is 04:02 PM.

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