summaryrefslogtreecommitdiffstats
path: root/sys-utils/mount.8
diff options
context:
space:
mode:
authorKarel Zak2017-06-20 12:46:02 +0200
committerKarel Zak2017-06-20 12:46:02 +0200
commit9b76b0e98b7f9e8a7ea1c2b89cf9a73b89fd6bcb (patch)
tree31723bd29fb5946a5b47d2f93df1499b33cbb5a9 /sys-utils/mount.8
parentdmesg: fragment concatenation (diff)
downloadkernel-qcow2-util-linux-9b76b0e98b7f9e8a7ea1c2b89cf9a73b89fd6bcb.tar.gz
kernel-qcow2-util-linux-9b76b0e98b7f9e8a7ea1c2b89cf9a73b89fd6bcb.tar.xz
kernel-qcow2-util-linux-9b76b0e98b7f9e8a7ea1c2b89cf9a73b89fd6bcb.zip
libmount: ignore "bind" from fstab on command line "remount"
The current code always apply all flags from /etc/fstab on remount. Unfortunately remount+bind has special semantic and it's impossible from command line to avoid interaction with the "bind" from fstab. Example, fstab: /dev/sda1 /bar ext4 defaults 0 1 /bar /foo none bind 0 0 Command line: # mount /foo -o remount,rw produces: mount(... MS_REMOUNT|MS_BIND ) syscall This changes the per-mountpoint (VFS) ro flag to rw, but doesn't change the filesystem itself. This patch forces libmount to ignore "bind" from fstab when "-o remount" specified on command line. If you need remount+bind semantic you have to specify the "bind" flag on command line. This allow to differentiate between # mount /foo -o remount,bind,rw --> mount(MS_REMOUNT|MS_BIND) and # mount /foo -o remount,rw --> mount(MS_REMOUNT) Suggested-by: NeilBrown <neilb@suse.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/mount.8')
-rw-r--r--sys-utils/mount.818
1 files changed, 18 insertions, 0 deletions
diff --git a/sys-utils/mount.8 b/sys-utils/mount.8
index ac410640e..3bd278e6a 100644
--- a/sys-utils/mount.8
+++ b/sys-utils/mount.8
@@ -385,6 +385,20 @@ will be read-only.
It's also possible to change nosuid, nodev, noexec, noatime, nodiratime and
relatime VFS entry flags by "remount,bind" operation. It's impossible to change
mount options recursively (for example with \fB-o rbind,ro\fR).
+
+.BR mount (8)
+since v2.31 ignores the \fBbind\fR flag from
+.I /etc/fstab
+on
+.B remount operation
+(if "-o remount" specified on command line). This is necessary to fully control
+mount options on remount by command line. In the previous versions the bind
+flag has been always applied and it was impossible to re-define mount options
+without interaction with the bind semantic. This
+.BR mount (8)
+behavior does not affect situations when "remount,bind" is specified in the
+.I /etc/fstab
+file.
.RE
.SS The move operation
@@ -1088,6 +1102,10 @@ Attempt to remount an already-mounted filesystem. This is commonly
used to change the mount flags for a filesystem, especially to make a
readonly filesystem writable. It does not change device or mount point.
+The remount operation together with the
+.B bind
+flag has special semantic. See above, the subsection \fBBind mounts\fR.
+
The remount functionality follows the standard way the mount command works
with options from fstab. This means that \fBmount\fR does not
read fstab (or mtab) only when both