Grub 2 issues

Steve Phariss sphariss at gmail.com
Wed Feb 17 22:42:57 MST 2010


I have installed Ubuntu 9.10 which loads grub 2 by default.  My system is
basically running fine with Windows 7, XP, and Ubuntu 9.10 (with several
kernel updates) all showing in the grub boot menu.  The problem is with
Centos 5.4 which is the last OS I loaded.  It does not show up in the grub
boot menu.

the centos partition is bootable (tested by actually booting from that drive
via bios)

I have added the needed code to 40_custom (and also changing the priority by
renaming to 15_custom):

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the ‘exec tail’ line above.
menuentry “CentOS 5.4″ {
        recordfail=1
        if [ -n ${have_grubenv} ]; then save_env recordfail; fi
    insmod ext3
    set root=(hd3,1)
    search --no-floppy --fs-uuid --set 1d755bf6-b132-44c8-80f6-75f5d8cf5d76
    linux /vmlinuz-2.6.18-164.el5xen
root=UUID=1d755bf6-b132-44c8-80f6-75f5d8cf5d76 rhgb ro quiet
    initrd /initrd-2.6.18-164.el5xen.img
}

blkid shows the correct UUID: (/dev/sdd1 is the boot partition for centos)

/dev/sdd1: LABEL="/boot" UUID="1d755bf6-b132-44c8-80f6-75f5d8cf5d76"
SEC_TYPE="ext2" TYPE="ext3"
/dev/sdd2: UUID="y3FJeW-Dvic-kPaD-h0cw-70y3-HK3Q-kkQKN8" TYPE="LVM2_member"

update-grub appears to find Centos :

Generating grub.cfg ...
Found Debian background: Windbuchencom.tga
Found linux image: /boot/vmlinuz-2.6.31-19-generic
Found initrd image: /boot/initrd.img-2.6.31-19-generic
Found linux image: /boot/vmlinuz-2.6.31-17-generic
Found initrd image: /boot/initrd.img-2.6.31-17-generic
Found linux image: /boot/vmlinuz-2.6.31-16-generic
Found initrd image: /boot/initrd.img-2.6.31-16-generic
Found linux image: /boot/vmlinuz-2.6.31-15-generic
Found initrd image: /boot/initrd.img-2.6.31-15-generic
Found linux image: /boot/vmlinuz-2.6.31-14-generic
Found initrd image: /boot/initrd.img-2.6.31-14-generic
Found memtest86+ image: /memtest86+.bin
Found Windows 7 (loader) on /dev/sda1
Found Microsoft Windows XP Professional on /dev/sdc1
Found CentOS release 5.4 (Final) on /dev/mapper/VolGroup00-LogVol02
(interesting that it is finding the LVM instead of /boot)
done

And lastly, /boot/grub/grub.cfg has found and added Centos to the menu.
(excerpt from file showing relevant section, I tried to run it as 15_custom
as well... neither worked):

### BEGIN /etc/grub.d/15_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the ‘exec tail’ line above.
menuentry “CentOS 5.4″ {
        recordfail=1
        if [ -n ${have_grubenv} ]; then save_env recordfail; fi
    insmod ext3
    set root=(hd3,1)
    search --no-floppy --fs-uuid --set 1d755bf6-b132-44c8-80f6-75f5d8cf5d76
    linux /vmlinuz-2.6.18-164.el5xen
root=UUID=1d755bf6-b132-44c8-80f6-75f5d8cf5d76 rhgb ro quiet
    initrd /initrd-2.6.18-164.el5xen.img
}
### END /etc/grub.d/15_custom ###
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.PLUG.phoenix.az.us/pipermail/plug-discuss/attachments/20100217/43856987/attachment.htm 


More information about the PLUG-discuss mailing list