XK0-004 · Question #55
What does the command mount -a do?
The correct answer is D. It ensures that all file systems listed with the option auto in /etc/fstab are mounted.. The 'mount -a' command mounts all filesystems defined in /etc/fstab that carry the 'auto' mount option, which is the default when no option is explicitly set.
Question
What does the command mount -a do?
Options
- AIt ensures that all file systems listed with the option noauto in /etc/fstab are mounted.
- BIt shows all mounted file systems that have been automatically mounted.
- CIt opens an editor with root privileges and loads /etc/fstab for editing.
- DIt ensures that all file systems listed with the option auto in /etc/fstab are mounted.
- EIt ensures that all file systems listed in /etc/fstab are mounted regardless of their options.
How the community answered
(51 responses)- A6% (3)
- C4% (2)
- D88% (45)
- E2% (1)
Why each option
The 'mount -a' command mounts all filesystems defined in /etc/fstab that carry the 'auto' mount option, which is the default when no option is explicitly set.
This inverts the logic - 'mount -a' skips entries marked 'noauto', it does not mount them.
Displaying mounted filesystems is the role of 'mount' with no arguments or 'findmnt', not 'mount -a'.
Opening /etc/fstab for privileged editing is done with commands like 'visudo' or a direct editor invocation, not 'mount -a'.
The 'mount -a' command reads /etc/fstab and attempts to mount all entries whose options include 'auto' (the default). Filesystems explicitly marked 'noauto' are skipped. This is the standard way to apply fstab changes without rebooting.
The 'noauto' option explicitly prevents 'mount -a' from mounting a filesystem, so not all fstab entries are mounted regardless of options.
Concept tested: Linux fstab auto mount option behavior
Source: https://man7.org/linux/man-pages/man8/mount.8.html
Topics
Community Discussion
No community discussion yet for this question.