XK0-005 · 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 reads the /etc/fstab file and attempts to mount all filesystems listed within it that are configured with the auto mount option.
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
(38 responses)- B3% (1)
- C3% (1)
- D87% (33)
- E8% (3)
Why each option
The `mount -a` command reads the `/etc/fstab` file and attempts to mount all filesystems listed within it that are configured with the `auto` mount option.
The `noauto` option in `/etc/fstab` explicitly prevents a filesystem from being mounted automatically, including when `mount -a` is executed.
To show all mounted filesystems, the `mount` command is used without any arguments, or `findmnt` or `df`. `mount -a` performs an action (mounting), it does not just display information.
`mount -a` does not open an editor; it's a command for managing filesystem mounts, not for editing configuration files.
The `mount -a` command is designed to read the `/etc/fstab` file and automatically mount all filesystems that have the `auto` option specified in their entry, which signifies that they should be mounted at boot or when `mount -a` is run.
`mount -a` does not mount filesystems regardless of their options; it specifically respects the `noauto` option and will skip such entries.
Concept tested: `mount -a` and `/etc/fstab` options
Source: https://man7.org/linux/man-pages/man8/mount.8.html
Topics
Community Discussion
No community discussion yet for this question.