From: Karel Zak Date: Thu, 19 Jul 2018 09:41:31 +0000 (+0200) Subject: mount: add details about mtab and --namespace to mount.8 X-Git-Tag: v2.33-rc1~123 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b6cc121043854e1048d020bc1d73d932df89eb4b;p=thirdparty%2Futil-linux.git mount: add details about mtab and --namespace to mount.8 Signed-off-by: Karel Zak --- diff --git a/sys-utils/mount.8 b/sys-utils/mount.8 index a27fcf0860..a04a11a67b 100644 --- a/sys-utils/mount.8 +++ b/sys-utils/mount.8 @@ -238,11 +238,15 @@ and .B umount traditionally maintained a list of currently mounted filesystems in the file .IR /etc/mtab . -This real mtab file is still supported, but on current Linux systems it is -better to make it a symlink to +The support for regular classic +.IR /etc/mtab +is completely disabled in compile time by default, because on current Linux +systems it is better to make it a symlink to .I /proc/mounts -instead, because a regular mtab file maintained in userspace cannot reliably +instead. The regular mtab file maintained in userspace cannot reliably work with namespaces, containers and other advanced Linux features. +If the regular mtab support is enabled than it's possible to +use the file as well as the symlink. .sp If no arguments are given to .BR mount , @@ -648,6 +652,15 @@ is on a read-only filesystem. Perform mount in namespace specified by \fIns\fR. \fIns\fR is either PID of process running in that namespace or special file representing that namespace. +.sp +.BR mount (8) +switches to the namespace when it reads /etc/fstab, writes /etc/mtab (or writes to /run/mount) and calls +.BR mount(2) +system call, otherwise it runs in the original namespace. It means that the target namespace does not have +to contain any libraries or another requirements necessary to execute +.BR mount(2) +command. +.sp See \fBnamespaces\fR(7) for more information. .TP .BR \-O , " \-\-test\-opts " \fIopts @@ -2452,18 +2465,22 @@ to the mount. helpers. All other options are used in a comma-separated list as argument to the \fB\-o\fR option. .SH FILES +See also "\fBThe files /etc/fstab, /etc/mtab and /proc/mounts\fR" section above. .TP 18n .I /etc/fstab filesystem table .TP +.I /run/mount +libmount private runtime directory +.TP .I /etc/mtab -table of mounted filesystems +table of mounted filesystems or symlink to /proc/mounts .TP .I /etc/mtab\s+3~\s0 -lock file +lock file (unused on systems with mtab symlink) .TP .I /etc/mtab.tmp -temporary file +temporary file (unused on systems with mtab symlink) .TP .I /etc/filesystems a list of filesystem types to try diff --git a/sys-utils/umount.8 b/sys-utils/umount.8 index 18ed3a2398..cad7d2aae1 100644 --- a/sys-utils/umount.8 +++ b/sys-utils/umount.8 @@ -132,6 +132,15 @@ server or a network partition. Remounts of the share will not be possible. Perform umount in namespace specified by \fIns\fR. \fIns\fR is either PID of process running in that namespace or special file representing that namespace. +.sp +.BR umount (8) +switches to the namespace when it reads /etc/fstab, writes /etc/mtab (or writes to /run/mount) and calls +.BR umount(2) +system call, otherwise it runs in the original namespace. It means that the target namespace does not have +to contain any libraries or another requirements necessary to execute +.BR umount(2) +command. +.sp See \fBnamespaces\fR(7) for more information. .TP .BR \-n , " \-\-no\-mtab"