某客戶XenServer環(huán)境意外斷電后,其中一臺(tái)CentOS7虛機(jī)無(wú)法正常啟動(dòng),開(kāi)機(jī)進(jìn)入救援模式并出現(xiàn)類似如下錯(cuò)誤:
Generating "/run/initramfs/rdsosreport.txt
Entering emergency mode. Exit the shell to continue.
Type "journalctl" to view system logs.
You might want to save '/run/initramfs/rdsosreport.txt" to a USB stick or /boot
after mounting them and attach it to a bug report.

經(jīng)我司工程師排查,通過(guò)journalctl命令,查看日志,判斷為dm-0設(shè)備存在數(shù)據(jù)損壞無(wú)法掛載的情況:

使用如下命令進(jìn)行修復(fù):
xfs_repair -v -L /dev/dm-0
#特別注意:-L是修復(fù)xfs文件系統(tǒng)的最后手段,慎重選擇,它會(huì)清空日志,有可能會(huì)丟失用戶數(shù)據(jù)和文件。

修復(fù)完成后,對(duì)故障虛擬機(jī)進(jìn)行重啟,重啟后順利進(jìn)入操作系統(tǒng)。
