CentOS虛擬機斷電或強制關機,再開機出現問題:Entering emergency mode. Exit the shell to continue.
查看日志
journalctl -n 50
錯誤原因:
failed to mount /sysroot.
Dependency failed for Initrd root File System.
Dependency failed for Reload configuration from the Real Root.
解決問題:
輸入命令:xfs_repair -v -L /dev/dm-0
-L 選項指定強制日志清零,強制xfs_repair將日志歸零,即使它包含臟數據(元數據更改)。
重啟 reboot
不行也可以試試
xfs_repair /dev/mapper/centos-root -L
reboot