From: Karel Zak Date: Thu, 23 Mar 2023 15:10:22 +0000 (+0100) Subject: mount: (man) add notes about remount behavior X-Git-Tag: v2.39-rc2~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=abf3f8a670fbf116c76a8bd92ffc0972fdb7ac63;p=thirdparty%2Futil-linux.git mount: (man) add notes about remount behavior Signed-off-by: Karel Zak --- diff --git a/sys-utils/mount.8.adoc b/sys-utils/mount.8.adoc index 39332e55c5..127138148d 100644 --- a/sys-utils/mount.8.adoc +++ b/sys-utils/mount.8.adoc @@ -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*