nerdexam
CompTIA

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).

Devices, Linux Filesystems, Filesystem Hierarchy Standard

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)
  • A
    4% (1)
  • B
    8% (2)
  • D
    88% (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).

AIt mounts all available filesystems onto the current directory.

mount -a does not mount filesystems onto the current directory; it uses the mount points defined in /etc/fstab.

BIt shows all mounted filesystems.

Displaying mounted filesystems is done with 'mount' (no arguments) or 'findmnt', not 'mount -a'.

CIt mounts all user mountable filesystems for the current user.

There is no concept of 'user mountable' filtering in 'mount -a'; the command operates on /etc/fstab entries regardless of the user option.

DIt mounts all filesystems listed in /etc/fstab which have the option auto set.Correct

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.

EIt mounts all filesystems listed in /etc/fstab which have the option noauto set.

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

#mount#fstab#auto option#filesystem mounting

Community Discussion

No community discussion yet for this question.

Full LX0-103 Practice