Linux Administration
medium
Questão de Linux Administration #019e3987
Enunciado da Questão
Linux Administration
#tune2fs
#ext3
#filesystem-check
#interval
#superblock
Médio
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
Correta
D
tune2fs -n 200 /dev/sda1
E
tune2fs --days 200 /dev/sda1
Explicação Oficial / Explicações da Comunidade
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
-iflag stands for "interval" and modifies theintervalfield in the superblock, which stores the maximum time between checks. - The
-cflag sets the maximum mount count between checks (e.g.,-c 200means a check is forced after 200 mounts). - The
-dflag is not a validtune2fsoption;-dis used bydebugfsordumpe2fsfor debugging. - The
-nflag is used to open the filesystem read-only for querying, not for setting parameters. - The
--daysflag does not exist intune2fs; the correct syntax uses-iwith a numeric value.
Why Other Options Are Incorrect
tune2fs -d 200 /dev/sda1: The-doption is not recognized bytune2fs; 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-noption causestune2fsto open the filesystem read-only and print current parameters; it does not change any settings.tune2fs --days 200 /dev/sda1: The--dayslong option does not exist; the correct long option for interval is--intervalor simply-i.