[fedora-virt] virtio grub support in chroot environment...

Gianluca Cecchi gianluca.cecchi at gmail.com
Fri Nov 5 11:09:37 UTC 2010


Hello,
I have a rh el 5.5 host as hypervisor.
I have a guest configured as "rh el 5.4 or later" kvm x86_64 and with
vda as hd0.
Inside this guest I booted with live iso and created partition vda1.
Then I copied inside an rh el 5.5 physical machine data.
Now I start the guest with a f14 rescue iso and try to setup grub to
accomodate start of this p2v obtained environment
Already done in the past with disks configured as hda or sda in guests.
It seems I have a problem now with vda and I would like to ask
suggestions.. probably I'm missing something simple..

my vda disk has also a vda2 partition setup for swap.
/boot is a subdir of / (so inside vda1)

I already setup the new initrd inside the guest, based on a plain
installed  vda based rh el 5.5 guest already present...

the problem is with boot loader install into mbr.

after booting guest with f14 x86_64 iso
mkdir /p
mount /dev/vda1 /p
mknod of vda, vda1 and vda2 under /dev of guest (so under /p/dev) based on
brw-r----- 1 root disk 253, 0 Nov  5 11:22 /dev/vda
brw-r----- 1 root disk 253, 1 Sep 27 16:25 /dev/vda1
brw-r----- 1 root disk 253, 2 Sep 27 16:25 /dev/vda2

change of grub.conf and device.map files under /p/boot/grub directory

grub.conf
#boot=/dev/vda
title ....
   root (hd0,0)
   kernel /boot/vmlinuz...
   initrd /boot/initrd...

device.map
(hd0)      /dev/vda

chroot /p

grub --device-map=/boot/grub/device.map
grub> root (hd0,0)

Error 21: Selected disk does not exist

The same without --device-map option
If I use grub-install it successfully completes, but actually my guest
then doesn' t start...

Is there any bug or am I missing something stupid????
Any difference between using this strategy with an sda device and with
a sda one?
On the original host I had a SAN with some volumes and with
/dev/cciss/c0d0 as the hd0..
I think I already clean old information....

BTW:
On host side I have
kvm-83-164.el5_5.21
kmod-kvm-83-164.el5_5.21
kvm-qemu-img-83-164.el5_5.21
etherboot-zroms-5.4.4-13.el5
etherboot-zroms-kvm-5.4.4-13.el5
libvirt-0.6.3-33.el5_5.3
virt-viewer-0.0.2-3.el5
libvirt-python-0.6.3-33.el5_5.3
virt-manager-0.6.1-12.el5
rhn-virtualization-host-5.3.0-17.el5sat
python-virtinst-0.400.3-9.el5

My original physical host, from which I copied the contents to my
guest was a rh el 5.5 x86_64 up2date as of kernel 2.6.18-194.8.1.el5
The env from which I run the iso cd and from which I run the chroot
command is f14 x86_64 netinst

Thanks in advance,
Gianluca


More information about the virt mailing list