Grub menu path for booting Ubuntu Warty
James Wilkinson
ubuntu at westexe.demon.co.uk
Thu Apr 14 12:45:38 UTC 2005
Ninad Bapat wrote:
> Recently I installed Ubuntu on my new PC.
> I also installed FC3 which modified all my grub settings
> I can boot XP and FC3 but not Ubuntu.
> What is the path to the boot image which i should modify in grub.
> or what should be done so that I can triple boot with XP/FC3/Ubuntu
You now have one and a half installations of grub on your machine.
Grub exists partly on the boot record, and partly on the partition which
contains /boot. You now have both halves of the Fedora install, but the
Fedora boot record part over-wrote the Ubuntu boot record part.
Now, you can put boot records at the beginning of a partition. But only
the one on the Master Boot Record, at the beginning of a hard disk (and
not associated with a partition), will be read by default when the
system boots.
Since you've got the Fedora grub in the MBR, I'd recommend leaving it
there for a while. That way you should at least keep XP and Fedora
working.
You've got two conceptual ways to go from here. You can merge both
Ubuntu and Fedora grub menus into a single grub menu. Or you can "chain"
Ubuntu's grub from Fedora's.
Both Ubuntu and Fedora will need regular updating. Fedora's tools (apt,
yum, or up2date) "know" how to update a Fedora grub, and Ubuntu's tools
(apt and friends) can update an Ubuntu grub. But they can't
automatically update the other grub, on a different partition that the
automatic tools don't know about.
So it's probably cleaner to chain Ubuntu's grub from Fedora's.
At this point we need to move into looking at commands (from a terminal,
for instance). I'm assuming that you've got XP installed on /dev/hda1,
Ubuntu on /dev/hda5, and Fedora on /dev/hda6: change these commands as
necessary.
In Fedora, as root, type
mount /dev/hda5 /misc
This will make the Ubuntu install available under /misc. So, for
example, Ubuntu /boot/grub/ will be available as /misc/boot/grub.
Type
chroot /misc grub-install /dev/hda5.
Chroot /misc means that the next command will use the Ubuntu install on
/misc as a / . This means you're running Ubuntu commands from your
Ubuntu install, and getting the Ubuntu file tree. grub-install /dev/hda5
will install grub on /dev/hda5's boot record.
Edit /boot/grub/grub.conf (still in Fedora, as root).
Add the following "stanza":
title Ubuntu
rootnoverify (hd0,4)
chainloader +1
This could go at the bottom of the file, or between any of the other
"stanzas" (they all start with "title ").
You'll probably need to change the "(hd0,4)". "hd0" is your first hard
disk, as seen by the BIOS. If you only have one hard disk, then that's
fine. "hd1" is the second hard disk, and so on. The second number (",4")
is the partition number minus one (which is because grub starts counting
from 0, for various reasons). So /dev/hdb6 would become (hd1,5) and
hda20 would be (hd0,19).
Another example: a quote from my Fedora /boot/grub/grub.conf:
title Fedora Core (2.6.11ac6-kendrick-1)
root (hd0,5)
kernel /boot/vmlinuz-2.6.11ac6-kendrick-1 ro root=LABEL=/
initrd /boot/initrd-2.6.11ac6-kendrick-1.img
title Ubuntu
rootnoverify (hd1,5)
chainloader +1
title Windows 2000
rootnoverify (hd0,0)
chainloader +1
The alternative would be to look into Ubuntu's equivalent file,
/boot/grub/menu.lst . (Add the /misc to the front if you've got that
mounted from Fedora. Copy a suitable stanza into the Fedora grub.conf,
and copy the appropriate files to where Fedora can find them (from
/misc/boot to /boot). Repeat each time you install a new Ubuntu kernel.
There's a lot of complexity there, I know. I'm currently moving from
Fedora Core 3 to Ubuntu, so I'm going through a lot of the same
processes. Ask (on the list) if you want any more details or anything
isn't clear.
Hope this helps,
James.
--
E-mail address: james | The Inquirer was set up by Mike Magee (ticker: DODGY),
@westexe.demon.co.uk | who co-founded well-known IT site The Register seven
| years ago after countless years editing and managing
| all manner of things which could be Aardvark Today and
| Fish Farming Monthly but weren't. -- The Inquirer
More information about the ubuntu-users
mailing list