centos7 lost system boot after abnormal power failure and restart.

Cause: The computer room of the company was unexpectedly powered off, and the server shut down abnormally due to a power outage. When I arrived at the company to start the server the next day, I could not enter the system normally.
Error 1: i8042: No controller found
Error 2: Failed to mount /sysroot
insert image description here
insert image description here
Troubleshooting ideas: From the error report, it can be seen that the system should not be able to enter the boot interface, but it can enter the safe mode, indicating that the system should be fine, and the problem should lie in On the system boot, I did not find an effective solution through the Baidu i8042 error. I decided to start with the log and check the system startup log through the [journalctl] command, and finally found the error "Failed to mount /sysroot". After a meal on Baidu, I finally determined the cause It is due to the loss of the boot partition of the system due to an abnormal power failure, which eventually leads to the failure to enter the system normally.
Special Note: A colleague said that this problem was also recovered by redoing the raid on this server before. Redo the raid but do not format the disk.
Solution:

ls -l /dev/mapper/centos-root

insert image description here

xfs_repair -v /dev/dm-0
reboot

After the command is executed, the output of done means that the system boot partition is repaired, and the system can be entered normally after restarting.

Such as: xfs_repair -v /dev/dm-0 command is invalid, you can add parameters L
-L parameter (-L: force clear log, including metadata changes) this parameter may lose file system metadata, use with caution, it is recommended before use Backup metadata first.

Guess you like

Origin blog.csdn.net/weixin_49566876/article/details/130081498