我有这个backup.qcow2映像,它以前在我的kvm/qemu虚拟机中工作得很好。
当我将它附加到另一个虚拟机上时,Windows会识别磁盘,但无法读取分区。磁盘以“磁盘管理”中的“初始”状态出现。
文件格式为qcow2版本2:
# qemu-img info backup.qcow2
file format: qcow2
virtual size: 246G (263704281088 bytes)
disk size: 137G
cluster_size: 65536
Format specific information:
compat: 0.10
refcount bits: 16注意格式缩写: 0.10。我不确定这在这件案子中是否重要。
我运行的其他映像工作良好,但具有compat:1.1设置,这是qcow2的第3版。
磁盘的vm配置部分:
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/opt/libvirt/backup.qcow2'/>
<target dev='vdc' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
</disk>该图像上的六编辑器显示qcow2头,一些NTFS标记和相关的用户数据是可见的,因此我假设图像具有有效的数据。
检查图像告诉我:
#qemu-img check backup.qcow2
**ERROR refcount block 69 is outside image**
Leaked cluster 3 refcount=1 reference=0
...
1 errors were found on the image.
Data may be corrupted, or further writes to the image may corrupt it.
1966018 leaked clusters were found on the image.
This means waste of disk space, but no harm to data.
Image end offset: 147866845184和
#virt-rescue --ro -a backup.qcow2
...
><rescue> fdisk -l /dev/sda
Disk /dev/sda: 245.6 GiB, 263704281088 bytes, 515047424 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
><rescue> gdisk -l /dev/sda
GPT fdisk (gdisk) version 1.0.4
Partition table scan:
MBR: not present
BSD: not present
APM: not present
GPT: not present我不确定客户机分区,但我假设是GPT和NTFS文件系统。
我将图像转换为原始格式,但它在一秒钟内就完成了,我只能看到100个字节。
qemu-img convert -f qcow2 -O raw backup.qcow2 backup.raw我该怎么处理这个案子?它可能只是主机vm中的一个错误配置。
或者,在访问任何数据之前,首先需要一个有效的分区表。我该怎么恢复呢?
主机-系统: Linux (Fedora 28),虚拟机管理器客服-系统: Windows 7,Windows 2016
# dnf history info 92
Packages Altered:
Upgraded ethtool-2:4.17-1.fc28.x86_64 @updates
Upgrade 2:5.0-1.fc28.x86_64 @updates
Upgraded fuse-common-3.4.2-2.fc28.x86_64 @updates
Upgrade 3.4.2-6.fc28.x86_64 @updates
Erase kernel-4.20.16-100.fc28.x86_64 @updates
Install kernel-5.0.16-100.fc28.x86_64 @updates
Erase kernel-core-4.20.16-100.fc28.x86_64 @updates
Install kernel-core-5.0.16-100.fc28.x86_64 @updates
Upgraded kernel-headers-5.0.9-100.fc28.x86_64 @updates
Upgrade 5.0.16-100.fc28.x86_64 @updates
Erase kernel-modules-4.20.16-100.fc28.x86_64 @updates
Install kernel-modules-5.0.16-100.fc28.x86_64 @updates
Erase kernel-modules-extra-4.20.16-100.fc28.x86_64 @updates
Install kernel-modules-extra-5.0.16-100.fc28.x86_64 @updates
Upgraded libqb-1.0.3-4.fc28.x86_64 @fedora
Upgrade 1.0.5-1.fc28.x86_64 @updates
Upgraded libxcrypt-4.4.4-2.fc28.x86_64 @updates
Upgrade 4.4.6-1.fc28.x86_64 @updates
Upgraded libxcrypt-devel-4.4.4-2.fc28.x86_64 @updates
Upgrade 4.4.6-1.fc28.x86_64 @updates
Upgraded libzstd-1.3.8-1.fc28.x86_64 @updates
Upgrade 1.4.0-1.fc28.x86_64 @updates
Upgraded mediawriter-4.1.2-1.fc28.x86_64 @updates
Upgrade 4.1.4-1.fc28.x86_64 @updates
Upgraded microcode_ctl-2:2.1-26.fc28.x86_64 @updates
Upgrade 2:2.1-29.fc28.x86_64 @updates发布于 2019-05-26 09:44:57
我怀疑以下几点:
可以是b (8位)、h (16位)、w (32位)或g (64位)。在x86上,可以使用i格式指定h或w,以分别选择16或32位代码指令大小。
尝试使源和目标完全相同。
https://serverfault.com/questions/968800
复制相似问题