<div class="gmail_quote">On Wed, Jan 21, 2009 at 3:45 PM, Richard W.M. Jones <span dir="ltr"><<a href="mailto:rjones@redhat.com">rjones@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">On Wed, Jan 21, 2009 at 03:06:43PM +0100, Emre Erenoglu wrote:<br>
> On Wed, Jan 21, 2009 at 2:48 PM, Mark McLoughlin <<a href="mailto:markmc@redhat.com">markmc@redhat.com</a>> wrote:<br>
><br>
> > (This is all getting offtopic for fedora-xen, we should really move to<br>
> > fedora-virt)<br>
> ><br>
> > On Wed, 2009-01-21 at 14:28 +0100, Jan ONDREJ (SAL) wrote:<br>
> > >  virtio_net works well, but I have trouble to boot from virtio_blk.<br>
> > ><br>
> > > I can add second disk as virto block device, but I can't boot from<br>
> > > first disk.<br>
> ><br>
> > When switching from IDE to virtio, you need to first build a new initrd<br>
> > in the guest with e.g.:<br>
> ><br>
> >  $> mkinitrd --with virtio_pci --with virtio_blk -f<br>
> > /boot/initrd-$(kernelversion) $(kernelversion)<br>
> ><br>
> > You only need to do this once. After that, if a new kernel is installed<br>
> > while you're booted off a virtio disk, then mkinitrd will include the<br>
> > modules automatically.<br>
><br>
><br>
> You will also need to specify /dev/vdX on the kernel  root= line and make<br>
> sure your init script inside your initrd triggers the virtio drivers at boot<br>
> so that the /dev/vdX are created.<br>
<br>
</div></div>Yes I have to agree with Emre here - I don't think it's as simple as<br>
just rebuilding mkinitrd.  I got that far but gave up later on.</blockquote><div><br></div></div>Well what I did was that I created a special initramfs, with virtio-net and virtio-blk drivers, as well as all of their dependencies (virtio-pci, virti-baloon and possibly one more), edited the init script going inside the initrd image so that it triggers the virtio drivers, then booted up on that ROOT filesystem using the kernel command line.<br>
<br>on system side, it's better to edit fstab but root is anyway mounted.<br><br>You may need to boot to shell at your initrd to see what's going on, or probe by hand to see the devices are created etc.<br><br>You also need to use the correct guest configuration file so that virtio-type devices are created instead of emulated ones.<br>
<br>-- <br>Emre<br>