Solved CentOS 6.7 + bhyve + lvm

Hello.
grub-bhyve does not automatically boot CentOS 6.7 with LVM. I tried to use -d /grub, I tried make duplicate /boot/grub/grub.conf to /boot/grub/grub.cfg. Did not help.
What else can I try?
 
CentOS 6.7 uses grub v1 which has a different config file format than grub v2. You'll have to look at the generated config file on the hard drive and extract the parameters, which can then be passed to grub-bhyve. e.g. on a Centos 6.7 install, (hd0,msdos1)/grub/grub.conf has the config lines:
Code:
title CentOS 6 (2.6.32-573.el6.x86_64)
  root (hd0,0)
  kernel /vmlinuz-2.6.32-573.el6.x86_64 ro root=/dev/mapper/VolGroup-lv_r
oot rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD  KEYTABLE=us rd_LVM_LV=VolGroup/lv_swa
p SYSFONT=latarcyrheb-sun16 console=ttyS0 crashkernel=auto rd_LVM_LV=VolGroup/l
v_root rd_NO_DM
  initrd /initramfs-2.6.32-573.el6.x86_64.img

The parameters to the kernel correspond to the linux in grubv2, with the initrd command remaining the same. The grub-bhyve commands would look like
Code:
linux  /vmlinuz-2.6.32-573.el6.x86_64 ro \
root=/dev/mapper/VolGroup-lv_root \
rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD  KEYTABLE=us \
rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-sun16 \
console=ttyS0 crashkernel=auto rd_LVM_LV=VolGroup/lv_root rd_NO_DM
initrd /initramfs-2.6.32-573.el6.x86_64.img
boot
 
grehan@, thank you! Thus it works:

Code:
title CentOS (2.6.32-573.18.1.el6.x86_64)
        root (hd0,0)
        linux /vmlinuz-2.6.32-573.el6.x86_64 ro \
        root=/dev/mapper/VolGroup-lv_root \
        LANG=ru_RU.UTF-8 rd_NO_LUKS rd_NO_MD  KEYTABLE=us \
        rd_LVM_LV=VolGroup/lv_swap \
        console=ttyS0 crashkernel=auto rd_LVM_LV=VolGroup/lv_root rd_NO_DM
        initrd /initramfs-2.6.32-573.el6.x86_64.img
        boot

P.S. config file should be names as grub.cfg, not grub.conf (by default).
 
Back
Top