YouTip LogoYouTip

Linux Comm Fsck Ext2

# Linux fsck.ext2 Command [![Image 3: Linux Command Manual](#) Linux Command Manual](#) The Linux fsck.ext2 command is used to check file systems and attempt to repair errors. When an ext2 file system encounters an error, the fsck.ext2 command can be used to attempt to repair it. ### Syntax fsck.ext2 [-l/L ] **Parameters**: * -a Automatically repair the file system without asking any questions. * -b Specify the starting address of the first block of the partition, i.e., the Super Block. * -B Set the block size for each block in the partition. * -c Check if there are any bad blocks within the specified file system. * -C Specify the file descriptor for output. The fsck.ext2 command will pass all its execution progress to this reverse output, which is convenient for debugging or monitoring program execution. * -d Display the command execution process in detail, which is convenient for debugging or analyzing program execution. * -f Force a complete check of the file system, even if it appears fine after a superficial check. * -F Clear the buffer cache on the device before checking the file system. * -I Set the number of blocks for the inode buffer of the file system to be checked. * -l Mark the blocks listed in the file as bad blocks and mark them to prevent applications from using them. * -L This parameter has a similar effect to the "-l" parameter, but before referencing the bad blocks file to mark bad blocks, it will first clear all previously marked bad blocks, i.e., completely reset them instead of just adding new bad block markers. * -n Set the file system to be checked to read-only and disable interactive mode, answering no to all questions. * -p This parameter has the same effect as the "-a" parameter. * -P Set the maximum inode size that the fsck.ext2 command can process. * -r This parameter is ignored and only exists for compatibility issues. * -s Swap the content of each pair of bytes when checking the file system. * -S This parameter has a similar effect to the "-s" parameter, but it swaps the content of each pair of bytes regardless of whether the file system is already in standard byte order. * -t Display timing information for the fsck.ext2 command. * -v Display the command execution process in detail. * -V Display version information. * -y Disable interactive mode and answer yes to all questions. [![Image 4: Linux Command Manual](#) Linux Command Manual](#)
← Linux Comm FdiskLinux Comm Mkfs Minix β†’