From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=52569 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJSgl-0000MQ-9Y for qemu-devel@nongnu.org; Tue, 01 Jun 2010 10:43:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OJSgk-0008QU-5N for qemu-devel@nongnu.org; Tue, 01 Jun 2010 10:43:31 -0400 Received: from mail.pruts.nl ([82.94.235.107]:36145 helo=steel.pruts.nl) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OJSgk-0008Q2-0m for qemu-devel@nongnu.org; Tue, 01 Jun 2010 10:43:30 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by steel.pruts.nl (Postfix) with ESMTP id F3EE4E20B7 for ; Tue, 1 Jun 2010 16:43:28 +0200 (CEST) Received: from steel.pruts.nl ([127.0.0.1]) by localhost (steel.local [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WZ4LpPq7h-gh for ; Tue, 1 Jun 2010 16:43:26 +0200 (CEST) Date: Tue, 1 Jun 2010 16:43:26 +0200 From: Ico Message-ID: <20100601144326.GH15922@pruts.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] guest ATA errors on 'recently loopback built disk image' List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org (I hope this is the right place to go to with my question, if not please refer me to the proper mailing list) short version: kvm reports ATA errors on images which are newly built on a loopback disk image. If the image is copied to another file and booted, no problems occur long version: I'm building a linux guest image to run with kvm. The image is built using qemu-img, creating partitions and a filesystem, doing a loopback mount, copying the contents, installing extlinux bootloader and unmounting. The image contains a minimal ubuntu 10.04 'lucid' OS. When booting the image, the guest OS continuously reports all kinds of ATA errors directly after mounting the root filesystem, something like [ 2.307542] ata1.01: failed command: WRITE DMA [ 2.308278] ata1.01: cmd ca/00:02:02:00:00/00:00:00:00:00/f0 tag 0 dma 1024 out [ 2.308279] res 41/04:02:02:00:00/00:00:00:00:00/f0 Emask 0x1 (device error) [ 2.310704] ata1.01: status: { DRDY ERR } [ 2.311378] ata1.01: error: { ABRT } [ 2.314049] ata1.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0 [ 2.314845] ata1.01: BMDMA stat 0x5 [ 2.315536] ata1.01: failed command: WRITE DMA and these go on and on. Eventually the OS boots half ok, with the root filesystem mounted read only because of the errors. BUT if i first copy the newly built image to a new filename, and boot from that, the guest boots just fine, no errors, no problems. My guess is that 'something' still has its hands on the disk image, causing errors in kvm, but I'm not able to figure out what is happening here. The loopback device is unmounted and properly freed according to losetup, lsof/fuser report no processes having the image open, but still something causes this strange behaviour. The image is built thus: rm -f ${ROOT_IMG} qemu-img create ${ROOT_IMG} 500M /sbin/mkfs.ext3 -q -F ${ROOT_IMG} /sbin/tune2fs -i0 -c0 ${ROOT_IMG} mkdir -p mnt mount -o loop ${ROOT_IMG} mnt rsync -a root/ mnt/ cp src/extlinux.conf src/menu.c32 mnt/ extlinux -i mnt/ umount -d mnt and booted like kvm -m 512 root.img resulting in a lot of errors in the guest. If I do cp root.img root2.img kvm -m 512 root2.img the guest boots just fine, no errors at all So, what am I missing here ? Thank you very much, Ico host: i386, Debian, something between testing and unstable. kernel.org stock kernel, version 2.6.30 kvm version: QEMU PC emulator version 0.12.4 (qemu-kvm-0.12.4), Copyright (c) 2003-2008 Fabrice Bellard -- :wq ^X^Cy^K^X^C^C^C^C