YouTip LogoYouTip

Linux Comm E2Fsck

# Linux e2fsck Command [![Image 3: Linux Command Manual](#) Linux Command Manual](#) The Linux e2fsck command is used to check if a partition using the Linux ext2 file system is working properly. ### Syntax e2fsck [-l|-L bad_blocks_file] device **Parameter Description**: * device : The hard disk partition to be checked, for example: /dev/sda1 * -a : Check the partition and automatically repair any problems found. Equivalent to the -p function. * -b : Set the location where the superblock is stored. * -B : Set the size of the block unit. * -c : Check if the partition has bad blocks. * -C file : Save the check results to a file for viewing. * -d : Print the debug results of e2fsck. * -f : Force check. * -F : Clear the device's buffer cache before starting the check to avoid errors. * -l bad_blocks_file : Add the bad block data to the bad_blocks_file. * -L bad_blocks_file : Set the bad block data to be stored in bad_blocks_file. If the file does not exist, it will be created automatically. * -n : Open the file system in mode. * -p : Check the partition and automatically repair any problems found. * -v : Verbose display mode. * -V : Display the current version of e2fsck. * -y : Pre-set all questions during the check to be answered with . ### Example Check if /dev/hda5 is normal, automatically repair any abnormalities, and set all questions to be answered with : e2fsck -a -y /dev/hda5 **Note**: In most cases when using e2fsck to check a hard disk partition, it is usually under special circumstances. Therefore, it is best to unmount the partition first, and then run e2fsck to perform the check. If you must check the root directory (/), please enter single-user mode before executing. [![Image 4: Linux Command Manual](#) Linux Command Manual](#)
← Jsref TolocalelowercaseJsref Startswith β†’