Results 1 to 8 of 8

Thread: Chainloading Ubuntu

  1. #1
    Join Date
    Apr 2008
    Beans
    17

    Chainloading Ubuntu

    Hi,
    I am trying to chainload Ubuntu from Fedora. My hard disk is set up like this:
    sda1 Ubuntu partition
    sda2 swap
    sda3 /boot partition (created by Fedora, I believe)
    sda4 Fedora partition
    sda5 swap

    When I boot the computer, Fedora's grub menu is displayed. The corresponding grub.conf (on sda3) is below:

    Code:
    # grub.conf generated by anaconda
    #
    # Note that you do not have to rerun grub after making changes to this file
    # NOTICE:  You have a /boot partition.  This means that
    #          all kernel and initrd paths are relative to /boot/, eg.
    #          root (hd0,2)
    #          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
    #          initrd /initrd-version.img
    #boot=/dev/sda
    default=0
    timeout=5
    splashimage=(hd0,2)/grub/splash.xpm.gz
    hiddenmenu
    
    title Fedora (2.6.24.4-64.fc8)
    	root (hd0,2)
    	kernel /vmlinuz-2.6.24.4-64.fc8 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
    	initrd /initrd-2.6.24.4-64.fc8.img
    
    title Fedora (2.6.24.4)
    	root (hd0,2)
    	kernel /vmlinuz-2.6.24.4 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
    	initrd /initrd-2.6.24.4.img
    
    title Fedora (2.6.24.3-50.fc8)
    	root (hd0,2)
    	kernel /vmlinuz-2.6.24.3-50.fc8 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
    	initrd /initrd-2.6.24.3-50.fc8.img
    
    ...more fedora kernels...
    
    title		Ubuntu 7.10, kernel 2.6.22-14-generic
    root		(hd0,0)
    kernel		/boot/vmlinuz-2.6.22-14-generic root=UUID=ceb85098-0c06-4b1c-9bda-0b78efd50459 ro quiet splash
    initrd		/boot/initrd.img-2.6.22-14-generic
    quiet
    
    title           Ubuntu 8.04, kernel 2.6.24-16-generic
    root            (hd0,0)
    kernel          /boot/vmlinuz-2.6.24-16-generic root=UUID=ceb85098-0c06-4b1c-9bda-0b78efd50459 ro quiet splash
    initrd          /boot/initrd.img-2.6.24-16-generic
    quiet
    
    
    title Ubuntu
    rootnoverify (hd0,0)
    chainloader +1
    boot
    So as it stands, I can boot Ubuntu by picking one of the two non-chainloading Ubuntu options, which I copied and pasted from _Ubuntu's_ grub.conf. But I would like to be able to chainload Ubuntu, since this way I won't have to manually edit Fedora's grub.conf every time there's a new kernel for Ubuntu, for instance. Unfortunately, if I try to do this by picking the last option above (the Ubuntu chainloading one), I get:
    Code:
    Error 13: Invalid or unsupported executable format.
    My question is then simply how do I get this to work? Do I need to do something special to make the computer recognize Ubuntu's grub?

  2. #2
    Join Date
    Feb 2007
    Location
    Maryland, USA
    Beans
    3,396
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Chainloading Ubuntu

    In order to chainload a partition, it has to have a bootloader installed. You need to install grub to the Ubuntu partition. From a Live CD or other linux system boot, do sudo grub to get a grub command line. Make sure the (hd0,0) partition is not mounted. On the grub command line enter:
    Code:
    root (hd0,0)
    setup (hd0,0)
    quit
    This is the one time where you tell grub to put the bootloader into a partition, rather than the MBR, with the setup (hd0,0) command. After that it should chainload.
    Last edited by dstew; April 26th, 2008 at 10:57 PM.

  3. #3
    Join Date
    Apr 2008
    Beans
    17

    Re: Chainloading Ubuntu

    Well, this is progress, at any rate. Now when I choose the Ubuntu chainload, I get a grub command line prompt. How do I tell it to use the Ubuntu menu.lst?

  4. #4
    Join Date
    Feb 2007
    Location
    Maryland, USA
    Beans
    3,396
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Chainloading Ubuntu

    How do I tell it to use the Ubuntu menu.lst?
    Maybe there is not menu.lst file there. Look in the /boot/grub directory of the Ubuntu partition. Do you see a menu.lst file? If not, you can create one using the update-grub command. Once you have the grub command prompt, you can boot the Ubuntu partition by entering the root, kernel, initrd and boot commands. Then on the Ubuntu command line, run sudo update-grub. That gets you a new menu.lst file. You must edit the new menu.lst file to set the #kopt and #groot options, then run update-grub again. Now you should have a working menu.

  5. #5
    Join Date
    Apr 2008
    Beans
    17

    Re: Chainloading Ubuntu

    Thanks dstew for the advice. I'm sorry to say that I'm still not quite there yet. There was already a menu.lst in existence but just to be safe I ran update-grub again, with the proper groot and kopt paramters. Unfortunately, I still get the grub command prompt when I choose the Ubuntu chainload. Now if I type
    Code:
    configfile /boot/grub/menu.lst
    at the command prompt I get the Ubuntu grub menu. So again we're back to telling grub to use the menu.lst file. As things stand I can do this myself manually, but I'd rather not have to. Is there some kind of initialization script where I could put "configfile /boot/grub/menu.lst", or is there somewhere I can set it as a default option? Why doesn't grub seem to want to recognize the menu.lst? I did a little searching but didn't really find anything...

  6. #6
    Join Date
    Dec 2005
    Location
    N.C.
    Beans
    4,796
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Chainloading Ubuntu

    Have you tried?:
    Code:
    title Ubuntu
    configfile (hd0,0)/boot/grub/menu.lst

  7. #7
    Join Date
    Apr 2008
    Beans
    17

    Re: Chainloading Ubuntu

    Yes, that did it. Thanks a lot!

  8. #8
    Join Date
    Aug 2005
    Beans
    Hidden!

    Re: Chainloading Ubuntu

    Quote Originally Posted by confused57 View Post
    Have you tried?:
    Code:
    title Ubuntu
    configfile (hd0,0)/boot/grub/menu.lst
    I'm curious. Could someone explain what this command did please?

Bookmarks

Posting Permissions

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