LX0-103 · Question #62
What does the command mount -a do?
The correct answer is D. It mounts all filesystems listed in /etc/fstab which have the option auto set.. The command 'mount -a' reads /etc/fstab and mounts all filesystems that do not have the 'noauto' option, which is equivalent to those with the 'auto' option (the default).
Question
What does the command mount -a do?
Options
- AIt mounts all available filesystems onto the current directory.
- BIt shows all mounted filesystems.
- CIt mounts all user mountable filesystems for the current user.
- DIt mounts all filesystems listed in /etc/fstab which have the option auto set.
- EIt mounts all filesystems listed in /etc/fstab which have the option noauto set.
How the community answered
(26 responses)- A4% (1)
- B8% (2)
- D88% (23)
Why each option
The command 'mount -a' reads /etc/fstab and mounts all filesystems that do not have the 'noauto' option, which is equivalent to those with the 'auto' option (the default).
mount -a does not mount filesystems onto the current directory; it uses the mount points defined in /etc/fstab.
Displaying mounted filesystems is done with 'mount' (no arguments) or 'findmnt', not 'mount -a'.
There is no concept of 'user mountable' filtering in 'mount -a'; the command operates on /etc/fstab entries regardless of the user option.
When 'mount -a' is invoked, it iterates through every entry in /etc/fstab and attempts to mount each filesystem whose options include 'auto' or omit 'noauto'. Filesystems explicitly marked 'noauto' (such as swap or removable media) are skipped, making this command the standard way to mount all standard boot-time filesystems on demand.
Filesystems with 'noauto' are explicitly excluded by 'mount -a', not included.
Concept tested: mount -a behavior with /etc/fstab auto option
Source: https://man7.org/linux/man-pages/man8/mount.8.html
Topics
Community Discussion
No community discussion yet for this question.