During the Tomb Sweeping Day the day before yesterday, I went to work overtime because the customer had a server that could not provide services. After troubleshooting, it was caused by a sudden power failure that could result in bad disk channels. Therefore, I used the e2fsck command to repair the disk. Command e2fsck-a for disk check and repair in linux: Check the partition. If any problem is found, it will be automatically repaired. -B: Set the superblock position. Www.2cto.com-B size: specify the size as the block size. -C: Check whether the partition has a bad track. -C file: Save the check result to file. -D: Output e2fsck debug results. -F: e2fsck only checks the wrong file system by default, and-f is mandatory. -F: Clear the buffer cache of the hard disk before checking to avoid errors. -L list: records bad track blocks added to the list. -D: print the debug result of e2fsck. -F: force check. -N: Enable the file system with (read-only)-p: Disable the interactive mode. If any problem occurs, it is automatically fixed, equivalent to-. -V: displays detailed reports. -Y: enable the user interaction mode. Use example www.2cto.com to check/dev/mapper/VolGroup00-LogVol02 for problems and fix them automatically if any: e2fsck-a/dev/mapper/VolGroup00-LogVol02 before executing e2fsck or fsck umount partition, otherwise, the file system may be damaged. When the partition is busy, you need to kill all the processes involved in the partition. A quick way is to execute fuser-k/home. If you need to check and fix the root directory (/), you need to enter singal user mode for execution. Finally, do not forget to mount the partition. Author and artist