LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-23-2014, 04:43 PM   #1
StevenXL
Member
 
Registered: Jan 2014
Posts: 81

Rep: Reputation: Disabled
What are the Slackware Defaults for fstab


Hi guys,

So in my initial installation of Slackware, I mounted my Windows (NTFS) partition as read-only except for root. The fstab had the following for the NTFS partition:

/dev/sda2 /ntfs ntfs-3g fmask=133,dmask=022 1 0

And normal partitions had the following:

/dev/sda6 /home ext4 defaults 1 2

I tried to edit fstab in order to mount it read-write, and given the settings for /dev/sda6, I did the following:

/dev/sda2 /ntfs ntfs-3g defaults 1 0

However, this didn't have the intended effects. /dev/sda2 was not mounted read-write. I know how to edit the settings in order to mount it read-write, but I am wondering why changing it to defaults did not work.

What are the defaults in Slackware, and how could I have figured that out in the command line?

Thanks!

P.S., this is what I currently have in the fstab for the NTFS partition:

/dev/sda2 /ntfs ntfs-3g rw,suid,dev,exec,auto,user,async 1 0
 
Old 01-23-2014, 04:47 PM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,255

Rep: Reputation: Disabled
Code:
/dev/sda2   /ntfs   ntfs-3g   fmask=111,dmask=000   1   0
FYI this is how Slackware installer set it up if you request R/W for everyone:
Code:
  dialog --backtitle "Setting permissions on NTFS partition $NEW_DIR" \
  --title "SET SECURITY FOR NTFS PARTITION $NEW_DIR" \
  --default-item "fmask=177,dmask=077" \
  --menu "Because users could go snooping through (or destroy, depending on \
the settings) your Windows partition, you should choose how much access would you \
like your non-root users to have to partition $NEW_DIR.  The access level can \
range from no access at all, to read-only for everyone, to read-write access \
for every user on the machine.  A reasonable default (read-write for root only) \
is chosen, but you may set this any way that you like." \
18 77 4 \
"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)" \
2> $TMP/ntfs_security
PS I almost forgot: Hi, and welcome to LQ.

Last edited by Didier Spaier; 01-23-2014 at 04:59 PM.
 
2 members found this post helpful.
Old 01-23-2014, 05:01 PM   #3
neymac
Member
 
Registered: May 2009
Distribution: Slackware64-14.1
Posts: 138

Rep: Reputation: 19
@Didier Spaier: my fstab uses "umask=000" for ntfs partitions. Which is the difference using user mask (umask) instead of file and directory masks (fmask and dmask)?
 
Old 01-23-2014, 05:08 PM   #4
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,255

Rep: Reputation: Disabled
Quote:
Originally Posted by neymac View Post
@Didier Spaier: my fstab uses "umask=000" for ntfs partitions. Which is the difference using user mask (umask) instead of file and directory masks (fmask and dmask)?
Here is what says man ntfs-3g:
Code:
OPTIONS
       Below is a summary of the options that ntfs-3g accepts.

       uid=value and gid=value
              Set  the  owner  and  the  group of files and directories. The values are numerical.  The
              defaults are the uid and gid of the current process.

       umask=value
              Set the  bitmask of the file and directory permissions that are not present. The value is
              given in octal. The default value is 0 which means full access to everybody.

       fmask=value
              Set  the   bitmask  of  the file permissions that are not present.  The value is given in
              octal. The default value is 0 which means full access to everybody.

       dmask=value
              Set the  bitmask of the directory permissions that are not present. The value is given in
              octal. The default value is 0 which means full access to everybody.
So somehow umask=0 is equivalent to dmask=0 and fmask=0.
 
1 members found this post helpful.
Old 01-23-2014, 05:22 PM   #5
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
See https://www.linuxquestions.org/quest...issions-35729/
for my notes on how I fixed mine.
 
Old 01-23-2014, 06:30 PM   #6
StevenXL
Member
 
Registered: Jan 2014
Posts: 81

Original Poster
Rep: Reputation: Disabled
Thank you very much for all the input. (I certainly learned something new - which is my goal in switching to Slackware).

I think I might have confused people with all the information I offered.

My question is as follows:

fstab contains the following "/dev/sda6 /home ext4 defaults 1 2". What are the options set to when a user specifies that fstab should use the 'defaults' setting?

P.S. @Habitual - I like your signature.
 
Old 01-23-2014, 07:23 PM   #7
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by StevenXL View Post
What are the options set to when a user specifies that fstab should use the 'defaults' setting?
Users don't specify anything in /etc/fstab.

You, as an administrator, can set the options for a particular user, but they themselves do not have control over it.
I'm not sure that regular users can even issue a mount without elevated privileges (an explicit directive in sudoers)...

If allowed (sudo privs) a user can mount using the -o <option> -o <option> (multiples are ok) eg:
Code:
mount -t ntfs-3g /dev/sda2 ~/Windows -o  rw -o dmask=022 -o fmask=133 0 0
assuming the user has made a ~/Windows mount point.

man ntfs-3g shows:
Code:
Access Handling and Security
       By  default,  files and directories are owned by the effective user and group of the mounting process, and everybody
       has full read, write, execution and directory browsing permissions.  You can also assign  permissions  to  a  single
       user by using the uid and/or the gid options together with the umask, or fmask and dmask options.
So for example:
as root, I check the zabbix user's ID with
Code:
id zabbix
and I get
Code:
uid=101(zabbix) gid=156(zabbix) groups=156(zabbix)
I'd instruct the user, or create a script to use
Code:
mount -t ntfs-3g /dev/sda2 ~/Windows -o  rw -o dmask=022 -o fmask=133 0 0
That should allow the <user> to mount with Read/Write privs and honor Linux file and directory permissions (files=644 and directories=755)

the uid stuff in /etc/fstab for the above user <zabbix> could be
Code:
/dev/sda2 /home/zabbix/Windows ntfs-3g  rw,uid=101,gid=156,dmask=022,fmask=133 0 0

See http://linux.die.net/man/8/ntfs-3g

I probably got some of that wrong, but fortunately, there are better people than I at explaining this stuff. (also a "we" thing)
I don't get out much and live in a terminal.

Edit: "defaults" are conservative, probably to save the system from its users?

Subscribed with interest...

Last edited by Habitual; 01-23-2014 at 07:29 PM.
 
Old 01-23-2014, 07:47 PM   #8
StevenXL
Member
 
Registered: Jan 2014
Posts: 81

Original Poster
Rep: Reputation: Disabled
Thank you very much for your continued response Habitual. It is all very helpful and informative. However, it is not what I am looking for, so I will try to rephrase the question for others.

Ubuntu has a page that delineates what the defaults are (https://help.ubuntu.com/community/Fstab).

Specifically, it reads: defaults = rw, suid, dev, exec, auto, nouser, and async.

What I would like to know is what are the defaults in Slackware.

What are the options being passed to mount when it finds the following line in fstab:

/dev/sda2 /ntfs ntfs-3g defaults 1 0

Thanks guys!
 
Old 01-23-2014, 07:52 PM   #9
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by StevenXL View Post
Thank you very much for your continued response Habitual. It is all very helpful and informative. However, it is not what I am looking for, so I will try to rephrase the question for others.
and I'll butt out.
 
Old 01-23-2014, 09:20 PM   #10
slacksam
Member
 
Registered: Oct 2012
Location: Germany
Distribution: Slackware, Salix, slarm64
Posts: 212

Rep: Reputation: 40
Quote:
Originally Posted by StevenXL View Post
What are the options being passed to mount when it finds the following line in fstab:

/dev/sda2 /ntfs ntfs-3g defaults 1 0
As you can see in the manpage for "mount", the defaults in Slackware are the same as in Ubuntu:
Code:
$ man mount
...
       defaults
              Use  default  options:  rw,  suid,  dev, exec, auto, nouser, and
              async.
...

Last edited by slacksam; 01-23-2014 at 09:23 PM.
 
Old 01-23-2014, 09:39 PM   #11
StevenXL
Member
 
Registered: Jan 2014
Posts: 81

Original Poster
Rep: Reputation: Disabled
@slackslam,

Thank you. I feel like a dummy. :-(


Quote:
Originally Posted by slacksam View Post
As you can see in the manpage for "mount", the defaults in Slackware are the same as in Ubuntu:
Code:
$ man mount
...
       defaults
              Use  default  options:  rw,  suid,  dev, exec, auto, nouser, and
              async.
...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Slackware 12 - How do I change soundcard defaults? RicardoClaro Slackware 1 09-10-2007 05:07 PM
fstab defaults sets wrong permissions dibblethewrecke Linux - Newbie 3 12-11-2004 03:10 PM
can I have a .Xclients-defaults scripts in slackware ... purpleburple Slackware 3 07-24-2002 10:40 PM

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

All times are GMT -5. The time now is 11:55 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