Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

So here's the thing. I have two partition in my netbook (plus swap):

/dev/sda4 with Ubuntu 10.4 /dev/sda5 with Centos 5.5

I use Ubuntu obviously. Centos is there because I need to run some test on that distro. The problem is Centos uses Grub and Ubuntu uses Grub2.

This is /boot/grub/menu.lst from Centos:

default=0
timeout=5
splashimage=(hd0,4)/boot/grub/splash.xpm.gz

    title CentOS (2.6.18-194.17.4.el5xen)
            root (hd0,4)
            kernel /boot/xen.gz-2.6.18-194.17.4.el5
            module /boot/vmlinuz-2.6.18-194.17.4.el5xen ro root=LABEL=/1 rhgb quiet
            module /boot/initrd-2.6.18-194.17.4.el5xen.img
    title CentOS (2.6.18-194.el5xen)
            root (hd0,4)
            kernel /boot/xen.gz-2.6.18-194.el5
            module /boot/vmlinuz-2.6.18-194.el5xen ro root=LABEL=/1 rhgb quiet
            module /boot/initrd-2.6.18-194.el5xen.img

The /boot/grub/grub.cfg from Ubuntu:

menuentry "CentOS release 5.5 (Final) (on /dev/sda5)" {
        insmod ext2
        set root='(hd0,5)'
        search --no-floppy --fs-uuid --set 66daaf1a-53b0-4e12-96f3-db01d52e12d1
        linux /boot/vmlinuz-2.6.18-194.17.4.el5xen root=/dev/sda5
}
menuentry "CentOS release 5.5 (Final) (on /dev/sda5)" {
        insmod ext2
        set root='(hd0,5)'
        search --no-floppy --fs-uuid --set 66daaf1a-53b0-4e12-96f3-db01d52e12d1
        linux /boot/vmlinuz-2.6.18-194.el5xen root=/dev/sda5
}

This was generated running update-grub2 and grub-install under Ubuntu. It's not working. It gives me something like bad magic number.

How can I convert the grub1 entry in a grub2 shape?

share|improve this question

3 Answers 3

up vote 2 down vote accepted

Ok so since I was unable to find specific information on a proper conversion of grub1 for Centos5.5 that's what I did.

menuentry "CentOS release 5.5 (Final) (on /dev/sda5)" {
        insmod ext2
        set root='(hd0,5)'
        search --no-floppy --fs-uuid --set 66daaf1a-53b0-4e12-96f3-db01d52e12d1
        drivemap -s (hd0) ${root}
        chainloader +1
}

Basically I chainloaded grub1 loader inside grub2 loader.

share|improve this answer

in this forum there are all information you need to know about grub

share|improve this answer

You can also try to use grub-menulst2cfg.

http://manpages.ubuntu.com/manpages/precise/man1/grub-menulst2cfg.1.html

share|improve this answer
    
Welcome to AskUbuntu! While this theoretically answers the question, it's better to summarize or include key parts of the information from the link here. –  papukaija Jun 20 '13 at 11:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.