Linux Administration
medium

Questão de Linux Administration #019e3987

Enunciado da Questão
Linux Administration
#mount
#fstab
#auto
#noauto
#filesystem-mounting
Médio

What does the command mount -a do?

A

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

B

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

C

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

D

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

Correta
E

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

Explicação Oficial / Explicações da Comunidade

The mount -a command is used to mount all filesystems listed in /etc/fstab that have the auto option set. The -a flag tells mount to read /etc/fstab and mount all entries that are not explicitly marked with noauto. Filesystems with the noauto option are ignored by mount -a and must be mounted manually.

How it Works

  • /etc/fstab contains entries for filesystems with mount points, options, and other parameters.
  • Each entry can include the auto or noauto option in the options field (fourth column).
  • mount -a processes all entries where the options field does not contain noauto. By default, if neither auto nor noauto is specified, the filesystem is considered auto.
  • The command is commonly used during system boot to mount all necessary filesystems, or by an administrator after editing /etc/fstab to apply changes without rebooting.

Why the Correct Value is Right

The correct answer states that mount -a ensures all filesystems listed with the auto option in /etc/fstab are mounted. This is accurate because mount -a respects the auto/noauto option and only mounts those marked auto (or unmarked, which defaults to auto).

Why the Incorrect Values are Wrong

  • The claim that mount -a mounts all filesystems with the noauto option is false; noauto explicitly excludes them from automatic mounting.
  • The statement that mount -a shows all automatically mounted filesystems is incorrect; mount -a performs mounting, not listing. To view mounted filesystems, use mount without arguments or df -h.
  • The idea that mount -a opens an editor with root privileges to edit /etc/fstab is wrong; that would be sudo vi /etc/fstab or similar.
  • The assertion that mount -a mounts all filesystems regardless of options is false because it respects the noauto option and will skip those entries.