某客户XenServer环境意外断电后,其中一台CentOS7虚机无法正常启动,开机进入救援模式并出现类似如下错误:
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.

经我司工程师排查,通过journalctl命令,查看日志,判断为dm-0设备存在数据损坏无法挂载的情况:

使用如下命令进行修复:
xfs_repair -v -L /dev/dm-0
#特别注意:-L是修复xfs文件系统的最后手段,慎重选择,它会清空日志,有可能会丢失用户数据和文件。

修复完成后,对故障虚拟机进行重启,重启后顺利进入操作系统。
