Comment 3 for bug 1123220

Revision history for this message
Scott Moser (smoser) wrote :

This is really interesting.
Its easily reproducible with:
 wget wget http://cloud-images.ubuntu.com/quantal/current/quantal-server-cloudimg-amd64-disk1.img -O disk.img
 qemu-img resize disk.img 20G
 kvm -serial none -drive file=disk.img,if=virtio -curses -m 256

The problem is "fixed", if you remove '-serial none' from the kvm cmdline, and thus get the default serial device that kvm appends.

The original test.xml can be fixed in a similar manner by simply adding:
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>

It can also be fixed by mounting the image and removing 'console=ttyS0' from the kernel command lines in /boot/grub/grub.cfg.

Its hard to see, because observing it makes it work. But, I suspect that the root of the problem is that cloud-initramfs-growpart is writing to stdout, which is redirected to /dev/console, and /dev/console writes are going to the non-existant device 'ttyS0' (as told to by the command line).

Those writes are failing, and something is then leaving the disk in a bad state.