PDA

View Full Version : Multiple distros using Grub from Fedora


cabber
29th March 2006, 09:46 PM
I have Fedora installled on a sepearate(sda) drive and tried to install Ubuntu on another disk (sdb). The grub installed from Ubuntu and didn't show Fedora as a selection. I had to reinstall the grub back to Fedora. Long story. Anyway, I have ubuntu on one drive (that I cannot access) and Fedora booting from the grub. How do I add the Ubuntu slection to the grub? Thanks.

fpoole
29th March 2006, 10:26 PM
You can add a new OS entry to grub.conf (I really don't know a lot about this, and it requires some knowledge about the filenames for the kernel image and whatall from the other drive) for Ubuntu. The other thing is that you specify "root hd(1,0)" or whatever for the Ubuntu entry. Or you can install a bootloader onto the Ubuntu partition, rather than MBR, and select the drive from the POST in your BIOS. That's what I did for Nexenta on one of my drives. :)

bob
30th March 2006, 01:15 AM

I don't know if this will help, depending on what bootloader Ubuntu uses, but I am booting PCLinuxOs on a separate drive from Fedora and use this as my grub.conf:

# 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,0)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/hdb
default=0
timeout=8
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.16-1.2080_FC5)
root (hd0,0)
kernel /vmlinuz-2.6.16-1.2080_FC5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.16-1.2080_FC5.img

title Fedora Core (2.6.16-1.2074_FC5)
root (hd0,0)
kernel /vmlinuz-2.6.16-1.2074_FC5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.16-1.2074_FC5.img

title PCLinuxOS
rootnoverify (hd1)
chainloader +1


In this case, Grub passes the boot over to Lilo, which then boots PCLinuxOS. Unfortunately, due to the LVM on the Fedora drive, Lilo hasn't been able to pass it back, but that's another story...

cabber
30th March 2006, 03:31 AM
Thanks for the replies. I think I'm looking for a bit more detail as I do not want to screw it up

bob
30th March 2006, 03:37 AM
You can't really screw it up, since it isn't working now. So, grab some info from the Ubuntu forum about the particular wording that it's grub.conf uses and which ubuntu kernel you are currently using. Since both use grub, it should be similar language to enable the boot - just think about what the partition is on hdb that contains the boot for Ubuntu. If you log in as root (su -) to a terminal and type "fdisk -l" you'll see the configuration of both drives and the * will designate which partition contains the boot.

LLS
30th March 2006, 03:52 PM
edit/copy/paste the result of
/sbin/sfdisk -l

JN4OldSchool
30th March 2006, 04:01 PM
in layman terms, you need to go into the /boot/grub/menu.lst file in Ubuntu and either copy via clipboard or write everything on the main "title" entry down on paper. This will need to be pasted into the /boot/grub/menu.lst file in FC, provided you are using the FC grub in the MBR. There are a few ways to do this, the easiest way I have found is to use a live CD distro as the go between. I use mepis-lite myself as it boots fast and has neat desktop icons for your partitions. Boot up the live CD, navigate to the partition containg Ubuntu, go to the grub file and menu.lst and copy the entry to clipboard. Then just navigate to the partition containing FC and paste it into that menu.lst. pull out the live CD and reboot and your grub menu should now list Ubuntu. Alternativly, you could reinstall FC making sure to add the Ubuntu entry in the anaconda grub install screen this time, or use a third party grub and make sure both entrys are included. Mepis allows you to do this also. My first method is best though and everyone should have a live CD floating around as a rescue/utility tool for such purposes.

edit: hmmm, couple more things I should clarify. If you use a live CD you should log in a root so you have permission to write changes to these files. Be sure to save your changes in the /boot/grub/menu.lst file up in the menu bar by selecting file:save. You will also want to either increase the "timeout" in this file from 5 to something longer or just take it out alltogether by just cutting it. That way you have time to chose which distro you want to boot to. You can also get rid of the FC splashscreen by taking out the "splashimage" line which will leave you with a black screen. You can also install your own splashscreen by redirecting this line to your image, but the image has to be 640x480 and 14 bit color. Have fun playing around here, the worst that could happen is you totally botch things up and have to reinstall both OSs. No big deal.