Command: e2fsck
Permission: Super User
Usage: e2fsck [-pacnydfvFV] [-B superblock] [-B blocksize] [-l |-L bad_blocks_file] [-C fd] device
Note: Check whether the partition of the Linux ext2 file system works normally.
Parameters:
Device: hard drive partition to be checked, for example:/dev/sda1
-A: checks the partition and automatically fixes the problem if any. It is equivalent to the-p function.
-B: Set the location for storing superblocks.
-B: Set the block size.
-C: Check whether the partition has a bad track.
-C file: Save the check result to file for viewing.
-D: print the debug result of e2fsck.
-F: force check
-F: Clear the device buffer cache before starting the check to avoid errors.
-L bad_blocks_file: add the blocks with bad tracks to bad_blocks_file.
-L bad_blocks_file: Set the block data of the bad track to be stored in bad_blocks_file. If this file is not found, it is automatically generated.
-N: Enable the file system in the [Read-Only] mode.
-P: Check the partition and automatically fix the problem if any.
-V: Detailed Display Mode
-V: displays the current e2fsck version.
-Y: pre-set answers to all questions during the check [Yes]
Example:
Check whether/dev/hda5 is normal. If any exception occurs, it is automatically repaired. If any question or answer is set, all answers are [Yes]:
E2fsck-a-y/dev/hda5
Note:
Most of the cases where e2fsck is used to check the hard disk partition are usually special. Therefore, you 'd better first check the partition umount and then run e2fsck. If you want to check, enter singal user mode and run the command again.