Change Frequency of Filesystem Check on ext2 Filesystem | Linux Exam LFCS

How to Change the Frequency of Filesystem Check on an ext2 Filesystem

Question

Which utility would be used to change how often a filesystem check is performed on an ext2 filesystem without losing any data stored on that filesystem?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D. E.

C

The correct utility to change how often a filesystem check is performed on an ext2 filesystem without losing any data stored on that filesystem is tune2fs.

Explanation:

tune2fs is a command-line utility that can be used to modify various parameters and settings of the ext2, ext3, and ext4 filesystems. One of the settings that can be modified using tune2fs is the frequency of filesystem checks.

When an ext2 filesystem is created, it is set up with a default frequency for filesystem checks. The default frequency is usually set to every 30 or 40 mounts, or every 180 days, whichever comes first. However, this frequency can be changed using the tune2fs utility.

To change the frequency of filesystem checks using tune2fs, you would use the -c or -i option followed by the new value. The -c option is used to specify the maximum number of mounts after which a filesystem check should be performed. The -i option is used to specify the maximum number of days after which a filesystem check should be performed.

For example, to set the maximum number of mounts to 50 before a filesystem check is performed, you would use the following command:

bash
sudo tune2fs -c 50 /dev/sda1

Similarly, to set the maximum number of days to 365 before a filesystem check is performed, you would use the following command:

bash
sudo tune2fs -i 365 /dev/sda1

Note that you need to specify the device file of the filesystem you want to modify after the options. In the above examples, we assumed the filesystem is located on /dev/sda1, but this may vary depending on your system's configuration.

It is important to note that changing the frequency of filesystem checks using tune2fs does not require the filesystem to be unmounted or formatted, so you can modify this setting without losing any data stored on the filesystem.

Therefore, option C, tune2fs, is the correct utility to change the frequency of filesystem checks on an ext2 filesystem without losing any data stored on that filesystem.