qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Ico <qemu@zevv.nl>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] guest ATA errors on 'recently loopback built disk image'
Date: Tue, 1 Jun 2010 16:43:26 +0200	[thread overview]
Message-ID: <20100601144326.GH15922@pruts.nl> (raw)


(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

             reply	other threads:[~2010-06-01 14:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-01 14:43 Ico [this message]
2010-06-01 15:39 ` [Qemu-devel] guest ATA errors on 'recently loopback built disk image' Ico

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100601144326.GH15922@pruts.nl \
    --to=qemu@zevv.nl \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).