From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39686) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aieB2-0005KG-Mc for qemu-devel@nongnu.org; Wed, 23 Mar 2016 04:30:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aieAx-0003aH-Ms for qemu-devel@nongnu.org; Wed, 23 Mar 2016 04:30:04 -0400 Received: from proxmox.maurer-it.com ([94.136.31.133]:49277) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aieAv-0003Zd-Sf for qemu-devel@nongnu.org; Wed, 23 Mar 2016 04:29:58 -0400 Received: from proxmox.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox.maurer-it.com (Proxmox) with ESMTP id 018E2AD08FD for ; Wed, 23 Mar 2016 09:20:09 +0100 (CET) From: Dominik Csapak Message-ID: <56F251B6.1030707@proxmox.com> Date: Wed, 23 Mar 2016 09:20:06 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] qemu-img convert corruption (raw to raw) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu devel Hi, since i got no answer on the qemu-discuss mailing list, i post it here maybe someone can help me or point me in the right direction (copy-pasted from my previous mail) Hi, I have a strange issue with qemu-img convert which corrupts my images, and found nothing relevant online. Maybe someone here can help me. My problem: I have a Windows 10 VM with a hd image file of type RAW with cache mode writeback. I boot it up, write a bunch of data (a few gigabytes with crystal disk mark) and shutdown. As soon as the qemu/kvm process is gone i do a "qemu-img convert -p -f raw -O raw vmdisk.raw vmdisk2.raw" When it finishes i do a compare: "cmp vmdisk.raw vmidsk2.raw" The output is: "vmdisk.raw vmdisk2.raw differ: byte yyyyy, line zzzzz" this it tells me that the files are different. this manifests by the fact that sometimes in windows on the new disk i get filesystem errors or damaged files. (depending on where the writes were) now the strange part: it does not happen with linux guests it does not happen when i do a "echo 3 > /proc/sys/vm/drop_caches" before the qemu-img command it does not happen when i have the "-t none" or "-t writethrough" flags on my qemu-img command it DOES happen when i do a sync before the qemu-img command the "-T" parameter makes no difference it does also not happen when i cp the file also when i wait a few minutes before the qemu-img command it works correctly now the real questions: is writeback with windows not recommended (i would assume after a guest shutdown it would be safe) what do the -t and -T flags on qemu-img convert and why does it bypass the host page cache (apparently?) why does it work when i specify no caching on the target (this baffles me, since it would seem that the source cache is the culprit, not the target) i apologize for the long message and hope someone can explain this to me with kind regards Dominik Csapak