Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
using defaults option in fstab
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
dcljr
Tux's lil' helper
Tux's lil' helper


Joined: 20 Aug 2005
Posts: 139
Location: Austin, TX

PostPosted: Tue Sep 23, 2014 9:07 am    Post subject: using defaults option in fstab Reply with quote

So, as I understand things, the "defaults" option in the fourth field in /etc/fstab entries -- for example:
Code:
/dev/sda2   /boot     ext2    defaults        0 2

stands for a predetermined set of, well... default options.

Fine... so two questions about this:
  1. Is there any reason at all to specify "defaults" along with other options?
  2. Doesn't the exact list of options implied by "defaults" actually depend on the filesystem type?

Regarding question 1:
The x86, amd64, alpha, hppa, and mips versions of the Handbook provide in Chapter 8 a "full /etc/fstab example" containing the line:
Code:
/dev/sda2   /boot        ext2    defaults,noatime     0 2

Now, if the "defaults" are indeed defaults, they shouldn't need to be referred to explicitly alongside other options. The only time "defaults" should need to be specified is if the options field would otherwise be empty (as in the first code snippet above). IOW, the second fstab entry above actually need only say:
Code:
/dev/sda2   /boot        ext2    noatime     0 2

Right? These two lines are completely equivalent?

Regarding question 2:
Both fstab(5) and mount(8) explain that "defaults" stands for:
Code:
rw, suid, dev, exec, auto, nouser, and async

But then in the various "Mount options for ..." sections farther down in mount(8), lots of options are described as "the default" for the respective filesystems. (For example, the "nocheck" option for ext2 filesystems. -- And even in the "FILESYSTEM INDEPENDENT MOUNT OPTIONS" section, "diratime" is described as "the default", even though that option wasn't listed among the options implied by "defaults".)

So the actual list of options implied by "defaults" technically depends on the filesystem type. Right?
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3664

PostPosted: Thu Sep 25, 2014 1:40 pm    Post subject: Reply with quote

True, that looks really confusing. And creating test cases for just trying it out is time consuming. That's the reason why I never use "defaults" in field 4 of fstab.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum