[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: grub2 + LVM + Xen DomU

From: Chris Murphy
Subject: Re: grub2 + LVM + Xen DomU
Date: Thu, 23 May 2013 16:11:13 -0400

On May 23, 2013, at 8:38 AM, nesredin mohammedjemal Mahmud <address@hidden> wrote:

thank you Chris. Now I can see where the base problem is.
I am using logical volumes that is why also its giving me hard time to install the grub.

I have two Logical volumes: /dev/ubuntu/root and  /dev/ubuntu/hvm.
my objective is to install the bootaloader on hvm logical volume, then xen hvmloader will take care of it.

# mkfs.ext3 /dev/ubuntu/hvm
# mount /dev/ubuntu/hvm /mnt/target
# mount -o loop myimage.ext3 /mnt/target-ext3
# cp -a /mnt/target-ext3/* /mnt/target
# grub-install --recheck --root-directory=/mnt/hvm /dev/ubuntu/hvm
Invalid device `/dev/ubuntu/hvm'.
Usage: /usr/sbin/grub-setup [OPTION...] DEVICE
Try `/usr/sbin/grub-setup --help' or `/usr/sbin/grub-setup --usage' for more

In fact, it has created me the grub directory in my logical volume; however, i guess there is problem with booatloader and partition table that I could not figure it out.
# ls /mnt/target/
boot  lost+found

grub-install is probably looking for an MBR so it knows where to install its various parts. But there is no MBR on the LV.

What I think you need to figure out for hvmloader, which I don't understand at all, is that it uses a host LV as a block device for the VM. That is, it's an LVM device for the host, but it's like a hard drive for the guest. If that's correct, then inside of the guest you need to partition it with fdisk or parted. Even if it's just one partition. 

The fact you're referring to the device as /dev/ubuntu/root and /dev/ubuntu/hvm sounds to me like you're running grub-install from the host, not from inside the VM. From within the VM, you probably need to partition the block device as if it were a regular hard drive, and then grub-install run on that block device from within the VM will work. And then the VM BIOS with hvmloader will work. But I'm guessing.

So unless someone on this list steps up with more xen specific knowledge about hvmloader, I think you need to ask the question on a xen specific list.

Chris Murphy

reply via email to

[Prev in Thread] Current Thread [Next in Thread]