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
Best Answer
That is part of the GNU coding standards, so all GNU (and many non-GNU) software follows it. However, it's by no means an absolute standard; there are other ways of implementing this, such as:
-Wlong-option
: originated from the C compiler, and specified as such in POSIX.-long-option
(i.e., single-dash): supported by most applications (usually as an alternative to the double-dash version) that don't have any short options.+long-option
: this is getting out of fashion, but there are a few older software packages that reserved the dash for short options, and the plus sign for long options. Not used much today, mostly because most getopt() implementations don't support itlong-option
: unfortunately there are also some applications which confuse options with arguments. I believe MegaCLI is one of the offenders there (it is an offender in pretty much everything else, anyway).