I have this backup.qcow2 image which was working fine in my kvm/qemu virtual machine before.
When I attach it to another virtual machine, Windows recognizes the disk but fails to read partitions. The disk appears in the state initial in Disk Management.
The file format is qcow2 Version 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
Note the format compat: 0.10. I'm not sure if it matters in this case.
I run other images which work fine, but have the compat:1.1 setting, which is Version 3 of qcow2.
The vm config part of the disk:
<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>
Hexeditor on that image reveals qcow2 header, some NTFS markers and relevant user data is visible, so I presume the image has valid data.
Inspecting the image tells me:
#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
and
#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
I'm not sure of the guest partitioning but I assume it was GPT and NTFS filesystem.
I converted the image into raw format, but it finishes in one second and I can see only 00 bytes
qemu-img convert -f qcow2 -O raw backup.qcow2 backup.raw
How do I approach this case? It may be just a misconfiguration in the host vm.
Or do I need a valid partition table first, before I can access any data. How would I restore that?
Host-System: Linux (Fedora 28), Virtual Machine Manager Guest-System: Windows 7, Windows 2016
Update
# 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