nerdexam
CompTIA

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.

System Management

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)
  • A
    6% (3)
  • C
    4% (2)
  • D
    88% (45)
  • E
    2% (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.

AIt ensures that all file systems listed with the option noauto in /etc/fstab are mounted.

This inverts the logic - 'mount -a' skips entries marked 'noauto', it does not mount them.

BIt shows all mounted file systems that have been automatically mounted.

Displaying mounted filesystems is the role of 'mount' with no arguments or 'findmnt', not 'mount -a'.

CIt opens an editor with root privileges and loads /etc/fstab for editing.

Opening /etc/fstab for privileged editing is done with commands like 'visudo' or a direct editor invocation, not 'mount -a'.

DIt ensures that all file systems listed with the option auto in /etc/fstab are mounted.Correct

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.

EIt ensures that all file systems listed in /etc/fstab are mounted regardless of their options.

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

#mount command#/etc/fstab#auto mount#filesystem mounting

Community Discussion

No community discussion yet for this question.

Full XK0-004 Practice