Do you need to specify the "defaults" option in fstab?
You only need defaults
if the field would otherwise be empty.
You can leave out the options field altogether if it's empty, unless the 5th or 6th fields are present. Field 5 is the dump frequency, rarely used nowadays. Field 6 fsck
order, should be 1 for /
, 2 for other filesystems mounted on boot and 0 otherwise. Fields 5 and 6 can be omitted if their value is 0, except that field 5 needs to be present if field 6 is.
Thus defaults
is necessary in
/dev/foo /foo somefs defaults 0 1
(though you can use some other option like rw
or ro
instead)
But it can be omitted when you specify another option.
eg: The mounts below have the same effect.
/dev/foo /foo somefs ro 0 1
/dev/foo /foo somefs defaults,ro 0 1
But these also have the same effect.
/dev/foo /foo somefs defaults 0 0
/dev/foo /foo somefs
Related videos on Youtube
StrongBad
Updated on September 18, 2022Comments
-
StrongBad almost 2 years
The Arch Wiki on
fstab
specifies the options of/
to bedefaults,noatime
, but on my installation the defaultfstab
is created with the options ofrw,relatime
. The Arch Wiki covers theatime
issues. What I am curious about is thedefaults
option. Theman
page formount
says:defaults
Use the default options: rw, suid, dev, exec, auto, nouser, and async.
Note that the real set of all default mount options depends on kernel and filesystem type. See the beginning of this section for more details.
Are the default options used only if the
defaults
option is provided or are they used in all cases? Do I needdefaults
in myfstab
?-
Арсений Черенков over 9 yearsyou have to specify defaults as least as place holder, however should you specify anything else (like
ro
ornosuid
), you can forget default.
-