how to add grub 2 distros to grub legacy menu.lst


Results 1 to 4 of 4

Thread: how to add grub 2 distros to grub legacy menu.lst

  1. #1
    Join Date
    Aug 2002
    Location
    Toms River, NJ
    Posts
    1

    how to add grub 2 distros to grub legacy menu.lst

    Linux mint and ubuntu use grub 2 and install grub 2 in the MBR and wipe out
    grub legacy menu.lst in the MBR.
    I know you can install grub 2 in the partition you install mint and ubuntu but how can
    you add grub 2 distros to the MBR menu.lst, grub 2 doesn't have a menu.lst.

    jozien

  2. #2
    Join Date
    Oct 2000
    Location
    Sweden
    Posts
    494
    You can simply add an entry in your menu.lst for the new distros.
    All you need is kernel, initrd & root-partition, here's a sample:
    Code:
    title           Debian GNU/Linux a5, kernel 2.6.26-2-686
    root            (hd0,1)
    kernel          /vmlinuz-2.6.26-2-686 root=LABEL=Deb ro vga=791
    initrd          /initrd.img-2.6.26-2-686
    
    title           Linux Mint 
    root            (hd0,1)
    kernel          /vmlinuz-2.6.39-2-amd64 root=/dev/sda5 ro 
    initrd          /initrd.img-2.6.39-2-amd64
    This works if you have a separate boot-partition and copy kernel and initrd to it. If not, simply point to correct partition:
    Code:
    title           Linux Mint 
    root  (hd0,4)
    kernel          /vmlinuz-2.6.39-2-amd64 root=/dev/sda5 ro 
    initrd          /initrd.img-2.6.39-2-amd64
    In pingvino veritas!

  3. #3
    Join Date
    Jun 2004
    Location
    Newcastle upon Tyne
    Posts
    2,978
    I have locked the other thread on the same topic.

    It is illegal to post multi-thread in any forum so please respect.
    Linux user started Jun 2004 - No. 361921
    Using a Linux live CD to clone XP
    To install Linux and keep Windows MBR untouched
    Adding extra Linux & Doing it in a lazy way
    A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
    Just cloning tips Just booting tips A collection of booting tips

    Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"

  4. #4
    Join Date
    Jun 2004
    Location
    Newcastle upon Tyne
    Posts
    2,978
    My answer the OP question:

    Grub2 uses /boot/grub/grub.cfg instead of /boot/grub/menu.lst by Grub1 or Grub legacy.

    The addition is no different to Grub legacy except you have to follow Grub2 syntax.

    I have modified X's example as follow (red bits are for Grub2)
    Code:
    menuentry 'Debian GNU/Linux a5, kernel 2.6.26-2-686' {
    root            (hd0,2)
    linux         /vmlinuz-2.6.26-2-686 root=LABEL=Deb ro vga=791
    initrd          /initrd.img-2.6.26-2-686
    }
    
    menuentry 'Linux Mint'{
    root            (hd0,2)
    linux          /vmlinuz-2.6.39-2-amd64 root=/dev/sda5 ro 
    initrd          /initrd.img-2.6.39-2-amd64
    }
    Grub2 counts partition number from 1 (Grub legacy counts from zero) but both still count disk number from zero.
    Grub2 "menuentry"=Legacy title"
    Grub2 "linux" = Legacy "kernel"

    The "root" and "initrd" statements of Grub1 can be used in Grub2.

    There are other bits and pieces of Grub2 that you can add to improve performance but the above will boot successfully. Adjust the statements to suit your case. The menu.lst has not been removed and can be used if you install legacy back. All Linux can be booted equally with either Grub1 or Grub2 but the latter can handle systems at the end of a large hard disk (say 2TB) as well as able to boot hard disk with a gpt (instead of the normal Msdos) partition table.
    Last edited by saikee; 01-08-2012 at 05:15 PM.
    Linux user started Jun 2004 - No. 361921
    Using a Linux live CD to clone XP
    To install Linux and keep Windows MBR untouched
    Adding extra Linux & Doing it in a lazy way
    A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
    Just cloning tips Just booting tips A collection of booting tips

    Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •