]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
mount: (man) add notes about remount behavior
authorKarel Zak <kzak@redhat.com>
Thu, 23 Mar 2023 15:10:22 +0000 (16:10 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 23 Mar 2023 15:10:22 +0000 (16:10 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/mount.8.adoc

index 39332e55c55c28f368f031263fac0cff6ca93f8b..127138148d015585594aa11db8c51bd7f9d13e19 100644 (file)
@@ -618,6 +618,15 @@ Attempt to remount an already-mounted filesystem. This is commonly used to chang
 +
 The remount operation together with the *bind* flag has special semantics. See above, the subsection *Bind mount operation*.
 +
+The default kernel behavior for VFS mount flags (nodev,nosuid,noexec,ro) is to
+reset all unspecified flags on remount. That's why mount(8) tries to
+keep the current setting according to fstab or /proc/self/mountinfo. This
+default behavior is possible to change by *--options-mode*. The recursive
+change of the mount flags (supported since v2.39 on systems with mount_setattr
+syscall), for example, "mount -o remount,ro=recursive", do not use
+"reset-unspecified" behavior, and it works as a simple add/remove operation
+and unspecified flags are not modified.
++
 The remount functionality follows the standard way the *mount* command works with options from _fstab_. This means that *mount* does not read _fstab_ (or _mtab_) only when both _device_ and _dir_ are specified.
 +
 *mount -o remount,rw /dev/foo /dir*
@@ -626,8 +635,9 @@ After this call all old mount options are replaced and arbitrary stuff from _fst
 +
 *mount -o remount,rw /dir*
 +
-After this call, *mount* reads _fstab_ and merges these options with the options from the command line (*-o*). If no mountpoint is found in _fstab_, then a remount with unspecified source is allowed.
+After this call, *mount* reads _fstab_ and merges these options with the options from the command line (*-o*). If no mountpoint is found in _fstab_, then it defaults to mount options from /proc/self/mountinfo.
 +
+
 *mount* allows the use of *--all* to remount all already mounted filesystems which match a specified filter (*-O* and *-t*). For example:
 +
 *mount --all -o remount,ro -t vfat*