Check the unmounted ext4 partition /dev/sdb1.
Do not skip the check even if the superblock reports the filesystem clean; allow interactive repair decisions.
Which command is appropriate?
e2fsck -f checks ext2/3/4 even when the filesystem is marked clean. The target should normally be unmounted.
Detailed explanation
e2fsck -f /dev/sdb1Correct. e2fsck -f /dev/sdb1 forces an ext4 filesystem check.
Correct. e2fsck -f /dev/sdb1 forces an ext4 filesystem check.
tune2fs -l /dev/sdb1Incorrect. tune2fs -l only displays ext filesystem parameters.
Incorrect. tune2fs -l only displays ext filesystem parameters.
xfs_repair -n /dev/sdb1Incorrect. xfs_repair is for XFS, not ext4.
Incorrect. xfs_repair is for XFS, not ext4.
df -h /dev/sdb1Incorrect. df reports capacity and does not check filesystem consistency.
Incorrect. df reports capacity and does not check filesystem consistency.
Try it yourself
An example you can run in a temporary verification environment.
e2fsck -fn /tmp/ext4-test.imgExpected result
一時ext4イメージを変更せず強制検査した結果Key points
- e2fsck is for ext filesystems
- -f forces a check
- Run it unmounted
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.