Ubuntu KVM 严重崩溃,现已损坏。有什么办法可以挽救吗?

Ubuntu KVM 严重崩溃,现已损坏。有什么办法可以挽救吗?

我在 Fedora 30 上的 KVM VM 中运行 Ubuntu 18.04。

在某些时候,主机遇到了 Spice 问题。主机的内核说:

Oct 20 14:16:46 host.name kernel: traps: SPICE Worker[22505] trap int3
ip:7f43f3c9e095 sp:7f43e8ffe1f0 error:0 in 
libglib-2.0.so.0.6000.7[7f43f3c63000+82000]

在客户系统日志中/var/log/libvirt/qemu/muh-ubuntu.log我们发现:

(process:22445): Spice-ERROR **: 14:16:46.760: 
red-parse-qxl.c:349:red_get_clip_rects: assertion 
`(uint64_t) num_rects * sizeof(QXLRect) == size' failed
2019-10-20 12:16:47.427+0000: shutting down, reason=crashed

整个主机 GUI 冻结了,然后 VM 像一只生病的白鲸一样翻倒了。

现在虚拟机映像似乎受到了严重影响(惊讶!)。当我启动它时,我只得到“错误:尝试读取或写入磁盘“hd0”之外的内容。按任意键继续...”,但键盘输入甚至没有被接受。

它是否被破坏了或者有没有什么办法可以挽救?(比如,访问 VM 映像中的文件系统?)

答案1

好吧,我已经能够访问图像的文件系统并使用 复制文件。此实用程序随Fedoraqemu-nbd软件包提供。qemu-img

具体来说:

modprobe nbd
qemu-nbd -c /dev/nbd0 /var/lib/libvirt/muh-ubuntu.qcow2
# The unique partition of the Ubuntu installation appears under /dev/nbd0p1
fsck /dev/nbd0p1

没有发现错误?很好。

然后:

mkdir ~/ubuntufs
mount /dev/nbd0p1 /root/ubuntufs/

如果幸运的话,可以访问图像的文件系统~/ubuntufs并从中复制文件。

这也允许检查虚拟机的内核日志的最后一条消息:

Oct 20 14:15:33 studio kernel: [35329.053397] f 4026531994#146742: failed to wait on release 154 after spincount 301
Oct 20 14:15:34 studio kernel: [35329.375923] f 4026531994#146742: failed to wait on release 154 after spincount 301
Oct 20 14:15:34 studio kernel: [35329.700598] f 4026531994#146742: failed to wait on release 154 after spincount 301
Oct 20 14:15:34 studio kernel: [35330.092221] f 4026531996#146744: failed to wait on release 156 after spincount 301
Oct 20 14:15:35 studio kernel: [35330.418666] f 4026531996#146744: failed to wait on release 156 after spincount 301
Oct 20 14:15:35 studio kernel: [35330.744602] f 4026531996#146744: failed to wait on release 156 after spincount 301
Oct 20 14:15:35 studio kernel: [35331.141117] f 4026531998#146746: failed to wait on release 158 after spincount 301
Oct 20 14:15:36 studio kernel: [35331.468580] f 4026531998#146746: failed to wait on release 158 after spincount 301
Oct 20 14:15:36 studio kernel: [35331.795974] f 4026531998#146746: failed to wait on release 158 after spincount 301
Oct 20 14:15:36 studio kernel: [35332.187849] f 4026532000#146748: failed to wait on release 160 after spincount 301
Oct 20 14:15:37 studio kernel: [35332.518850] f 4026532000#146748: failed to wait on release 160 after spincount 301
Oct 20 14:15:37 studio kernel: [35332.844414] f 4026532000#146748: failed to wait on release 160 after spincount 301

附录

我尝试再次启动虚拟机,这次成功了。这真的很奇怪。它自己修复了吗?

相关内容