qcow2 corruption?

John Morrissey
2009-01-08T19:24:23Z

I'm encountering what seems like disk corruption when using qcow2 images,
created with 'kvm-img create -f qcow2 image.qcow2 15G'.

A simple test case is to use the Debian installer (I'm using the lenny rc1
images from http://www.debian.org/devel/debian-installer/) to install a new
domain. The qcow2 file on disk grows due to the mkfs(8) activity, then the
installer faults while trying to mount the root filesystem (Invalid
argument). 'fdisk -l' shows that the partition table just created by the
installer is gone.

In a few cases, I've managed to finish an installation, but the resulting
filesystem is strangely corrupt:

# file /usr/bin/w.procps
/usr/bin/w.procps: gzip compressed data, was "aptitude.8", from Unix, last modified: Wed Mar 14 14:11:18 2007, max compression

I've tried with the Debian packaging of KVM 79 and 82; both exhibit the same
behavior (disclaimer: Debian has about a dozen patches in their kvm
packaging, but they all seem to be changes to the build/install process or
security-related). Host running KVM is up-to-date Debian lenny
(64-bit/amd64) running kernel 2.6.26 (Debian linux-image-2.6.26-1-amd64
2.6.26-12).