Hi,

i am trying to create a bootable vm using grub2. Here are the steps i tried:

1. creating a logical volume using lvcreate
2. creating a partition-table with one ext partition inside the logical volume: #parted -s /dev/${VGNAME}/${LVNAME} unit GB mklabel msdos mkpart primary ext2 0 ${LVSIZE}
4. kpartx -a /dev/${VGNAME}/${LVNAME}

kpartx generates an extra device-node for the partition. I used this one to create a ext4 fs on it, mounted it and deboostraped a basic debian system to it. Here is where the problem starts. I don't know how to install grub2 to the lvm device-node from the host. As a host system i used archlinux. I tried a lot ways to get grub to work.
For example i created a device.map like this:
(hd0) /dev/mapper/vg-debianvm
(hd0,1) /dev/mapper/vg-debianvm1
and used it in combination with grub-install wich failed.

My question is, whats the right way to install grub2 to the lvm device? Or is there a way to install grub2 to a logical volume without a partition-table (/dev/vg/debianvm)? Do i have to chroot to the system to install grub or is there a way to install it from the host?

_______________________________________________
Help-grub mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-grub

Reply via email to