setup-storage + grub2

Waldemar Brodkorb fai at waldemar-brodkorb.de
Tue Apr 13 20:41:19 CEST 2010


Hi Michael,
Michael Tautschnig wrote,

> > Hi,
> > Adrian von Bidder wrote,
> > 
> > > Issues confirmed, and I've reported these twice on this list already.
> > > 
> > > I just switched to LILO, works for me.
> > 
> > I think the patch in the experimental tree does not work as
> > expected. To boot from LVM boot volume I changed the script to
> > following:
> > 
> > error=0 ; trap "error=$((error|1))" ERR
> > 
> > $ROOTCMD grub-mkimage --output=/boot/grub/core.img biosdisk part_msdos ext2 lvm 
> 
> From some earlier post I gathered that biosdisk part_msdos ext2 were
> auto-detected anyway and not necessary. Could somebody check whether they are
> necessary are not?

I checked again, they are really necessary. At least for
Ubuntu/Lucid with with grub 1.98. Without them I only get the grub
rescue console.
 
> > $ROOTCMD update-grub
> > $ROOTCMD grub-install --modules="biosdisk part_msdos ext2 lvm" --no-floppy "(hd0)"
> > $ROOTCMD grub-setup "(hd0)"
> > 
> > exit $error
> > 
> > Having support for raid and serial and lvm seems to be to big for 
> > core.img. 
> 
> I'm ok with dropping serial; is dropping raid necessary as well? Does it in fact
> mean that one cannot combine raid and lvm?

Dropping serial is required, raid can be included without breaking
LVM boot.
 
> > @Michael: I think we need some tweaking here. device2grub does not
> > work correctly for LVM boot support for me. The method in svn trunk
> > does work correctly for simple boot via primary partition.
> > 
> 
> Could somebody send me their /boot/grub/device.map with LVM? As far as I
> understand device2grub just parses this file, so probably it just requires a bit
> of tweaking.

device.map looks like usual:
(hd0)   /dev/sda

..
for device in $BOOT_DEVICE; do
  grub_dev=$(device2grub $device)
  if [ -z "$grub_dev" ] ; then
    grub_dev=$(echo $device | sed 's#^/dev/##')
  fi

BOOT_DEVICE is in case of LVM usage: /dev/mapper/VolGroup00-rootlv.
Which does not match with this regular expression used in
device2grub:
$device=~ m#^(/dev/(?:[shv]d\D|i2o/hd\D|ida/c\d*d\d*|cciss/c\d*d\d*))p*(\d*)$# 

And if $grub_dev is empty, then "mapper/VolGroup00-rootlv" is also
wrong. We would need to add some code to parse pvdisplay to get the
real device node used by the VolumeGroup, where the RootLV is
created on. 

Just as a site note, I think it does not match Xen para virt block
devices. (.f.e xvda)
 
> I'd be more than happy to make the grub2 stuff of experimental (and actually
> also mainline FAI) finally work; it's just that I don't have any system running
> grub2 and got not hosts to do any testing. I'm therefor relying on your help.
> 
> Best,
> Michael

have fun,
        Waldemar



More information about the linux-fai mailing list