A system administrator notices that an important server is experiencing intermittent problems with data integrity, and suspects filesystem corruption on one of its disks. After running fsck on the unmounted filesystem and fixing several errors, the administrator needs to ensure that the filesystem will be checked and repaired if necessary during the next system boot. Which of the following commands should the administrator use to schedule a filesystem check on boot?
The correct answer is tune2fs -c 1 /dev/sda1 because the command sets the maximum mount count (-c) to 1 for the filesystem on /dev/sda1, ensuring that fsck will be run the next time the filesystem is mounted. This is typically during the boot process. The option -C 0 sets the current mount count to 0, which is incorrect in this context because it does not schedule a check on the next boot. The -i flag is used for setting the interval between checks based on time, not on the number of mounts. The e2fsck -p /dev/sda1 executes a filesystem check, but does not schedule it for the next boot.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does the 'tune2fs' command do?
Open an interactive chat with Bash
What is the significance of the maximum mount count in file systems?
Open an interactive chat with Bash
Can you explain what 'fsck' and 'e2fsck' do in this context?