For the unmounted ext4 partition /dev/sdb1, require an e2fsck check after 30 mounts.
Change the maximum mount count, not the current count.
Which command is appropriate?
tune2fs -c COUNT sets the maximum mount count before an e2fsck check. -C changes the current count and -i sets a time interval.
Detailed explanation
tune2fs -C 30 /dev/sdb1Incorrect. -C changes the current mount count.
Incorrect. -C changes the current mount count.
tune2fs -i 30 /dev/sdb1Incorrect. -i sets a time-based check interval.
Incorrect. -i sets a time-based check interval.
tune2fs -c 30 /dev/sdb1Correct. tune2fs -c 30 /dev/sdb1 sets the maximum mount count.
Correct. tune2fs -c 30 /dev/sdb1 sets the maximum mount count.
e2fsck -c 30 /dev/sdb1Incorrect. e2fsck -c is not the tune2fs mount-count setting.
Incorrect. e2fsck -c is not the tune2fs mount-count setting.
Try it yourself
An example you can run in a temporary verification environment.
tune2fs -c 30 /tmp/ext4-test.img && tune2fs -l /tmp/ext4-test.img | grep 'Maximum mount count'Expected result
Maximum mount count: 30(一時イメージだけを変更)Key points
- -c sets the maximum count
- -C sets the current count
- -i sets a time interval
Notes
- Environment: e2fsprogs 1.47
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.