man mount
describes -o defaults
as including the following set of default mount
options: rw
, suid
, dev
, exec
, auto
, nouser
, and async
.
Will mount
options enabled/disabled in the system kernel be added/removed from the -o defaults
set of default mount
options? Does the same apply to filesystem-specific default options?
How can I check the current -o defaults
set of default mount
options by inspecting /proc/mounts
? It only lists all currently mounted filesystems.
man mount
FILESYSTEM-INDEPENDENT MOUNT OPTIONS
Some of these options are only useful when they appear in the
/etc/fstab file.
Some of these options could be enabled or disabled by default in the
system kernel. To check the current setting see the options in
/proc/mounts. Note that filesystems also have per-filesystem specific
default mount options (see for example tune2fs -l output for extN
filesystems).
...
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.
-o defaults
is something internal to themount(8)
utility. What has/proc/mounts
to do with it? Why should you be able to inspect the defaults of a user-land utility via a kernel interface? – Apr 22 '20 at 08:21Some of these options could be enabled or disabled by default in the system kernel. To check the current setting see the options in /proc/mounts.
? – Shuzheng Apr 22 '20 at 08:49/proc/mounts
, even if they're defaults. Eg.relatime
(there was a recent discussion about it). If you mount a fs without any special options (no matter if you use themount(8)
program or use themount(2)
syscall directly), it will still have therelatime
option in/proc/mounts
or/proc/mountinfo
. Maybe that manpage should be clearer and do less hedging around the facts -- go submit a documentation patch ;-) – Apr 22 '20 at 08:56