From b9dcdb44a709d4ac285779bb80598b344fb99ac2 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 22 Oct 2025 10:49:23 +0200 Subject: mount: improve --all documentation Add notes to the --all option description: - Historical context: mount -a was originally designed for init scripts - Modern usage: systemd-based distributions use systemd units instead - Swap handling: swap entries in fstab are silently ignored, use swapon -a Addresses: https://issues.redhat.com/browse/RHEL-123527 Signed-off-by: Karel Zak --- sys-utils/mount.8.adoc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys-utils/mount.8.adoc b/sys-utils/mount.8.adoc index 6e72d48c4..66ea7f61f 100644 --- a/sys-utils/mount.8.adoc +++ b/sys-utils/mount.8.adoc @@ -299,12 +299,16 @@ The *mount* command does not pass all command-line options to the **/sbin/mount. Command-line options available for the *mount* command are: *-a*, *--all*:: -Mount all filesystems (of the given types) mentioned in _fstab_ (except for those whose line contains the *noauto* keyword). The filesystems are mounted following their order in _fstab_. The *mount* command compares filesystem source, target (and fs root for bind mount or btrfs) to detect already mounted filesystems. The kernel table with already mounted filesystems is cached during *mount --all*. This means that all duplicated _fstab_ entries will be mounted. +Mount all filesystems (of the given types) mentioned in _fstab_ (except for those whose line contains the *noauto* keyword). This option was originally designed for use in init scripts. Note that many modern systemd-based distributions do not use *mount -a* on boot and instead mount filesystems in a more sophisticated way using systemd units. ++ +The filesystems are mounted following their order in _fstab_. The *mount* command compares filesystem source, target (and fs root for bind mount or btrfs) to detect already mounted filesystems. The kernel table with already mounted filesystems is cached during *mount --all*. This means that all duplicated _fstab_ entries will be mounted. + The option *--all* is possible to use for remount operation too. In this case all filters (*-t* and *-O*) are applied to the table of already mounted filesystems. + Since version 2.35 is possible to use the command line option *-o* to alter mount options from _fstab_ (see also *--options-mode*). + +Note that swap entries in _fstab_ are silently ignored by *mount -a*. Use *swapon -a* to enable swap devices and files. See *swapon*(8). ++ Note that it is a bad practice to use *mount -a* for _fstab_ checking. The recommended solution is *findmnt --verify*. *-B*, *--bind*:: -- 2.51.1