Linux Administration
medium

Pregunta de Linux Administration #019e3987

Enunciado de la Pregunta
Linux Administration
#tune2fs
#ext3
#filesystem-check
#interval
#superblock
Medio

Which of the following commands changes the number of days before the ext3 filesystem on /dev/sda1 has to run through a full filesystem check while booting?

A

tune2fs -d 200 /dev/sda1

B

tune2fs -c 200 /dev/sda1

C

tune2fs -i 200 /dev/sda1

Correcto
D

tune2fs -n 200 /dev/sda1

E

tune2fs --days 200 /dev/sda1

Explicación Oficial / Explicaciones de la Comunidad

The tune2fs command is used to adjust tunable filesystem parameters on ext2/ext3/ext4 filesystems. The -i option sets the maximum time interval between filesystem checks. The value is specified in days unless a suffix is given (e.g., w for weeks, m for months). Therefore, tune2fs -i 200 /dev/sda1 sets the check interval to 200 days, meaning the filesystem will be forced to run a full check at boot if 200 days have passed since the last check.

How it Works

  • The -i flag stands for "interval" and modifies the interval field in the superblock, which stores the maximum time between checks.
  • The -c flag sets the maximum mount count between checks (e.g., -c 200 means a check is forced after 200 mounts).
  • The -d flag is not a valid tune2fs option; -d is used by debugfs or dumpe2fs for debugging.
  • The -n flag is used to open the filesystem read-only for querying, not for setting parameters.
  • The --days flag does not exist in tune2fs; the correct syntax uses -i with a numeric value.

Why Other Options Are Incorrect

  • tune2fs -d 200 /dev/sda1: The -d option is not recognized by tune2fs; it would produce an error.
  • tune2fs -c 200 /dev/sda1: This sets the mount count limit, not the time interval. It would force a check after 200 mounts, regardless of time.
  • tune2fs -n 200 /dev/sda1: The -n option causes tune2fs to open the filesystem read-only and print current parameters; it does not change any settings.
  • tune2fs --days 200 /dev/sda1: The --days long option does not exist; the correct long option for interval is --interval or simply -i.