Tuesday, September 9, 2008

Triple Booting your System with GRUB

Well as usual I was doing some things on my PC and got this sudden brain blast to install Ubuntu on my secondary 40Gb HDD. So I downloaded Ubuntu x86_64 using my all time favorite CentOS and burned a CD from the ISO image file using K3B. After that I just booted my computer using my new Ubuntu CD and installed a fresh coy on 40Gb HDD. As being a new comer my self to the world of Linux I found out that after installing the GRUB on to the MBR of my secondary 40Gb HDD I've to boot from that HDD to get the Ubuntu GRUB menu. It was OK, but there was major problem I couldn't find my CentOS distribution in the Ubuntu GRUB menu. Ubuntu installation system didn't have detected my other Linux distro so to boot in to that I've change my boot hard disk from my BIOS and as I know that's not a very good idea to change the BIOS very frequently.

So I've to find a solution pronto, I turned to my good friend in the internet Mr.Google I toled him what I want to find but he also didn't have a satisfying answer for me. Then I turned to my forum people they were very helpful and guided me through. And here is what I've cooked up.

# 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,6)
# kernel /vmlinuz-version ro root=/dev/VL1/LogVol00
# initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=10
splashimage=(hd0,6)/grub/splash.xpm.gz
# hiddenmenu
password --md5 dsadqe2121wsdsd2.
title CentOS (2.6.18-92.1.10.el5)
root (hd0,6)
kernel /vmlinuz-2.6.18-92.1.10.el5 ro root=/dev/VL1/LogVol00 rhgb quiet
initrd /initrd-2.6.18-92.1.10.el5.img
title CentOS (2.6.18-92.el5)
root (hd0,6)
kernel /vmlinuz-2.6.18-92.el5 ro root=/dev/VL1/LogVol00 rhgb quiet
initrd /initrd-2.6.18-92.el5.img
title Ubuntu
rootnoverify (hd1,0)
chainloader +1
title WindowsXP SP2
rootnoverify (hd0,0)
chainloader +1

But this to work you've install your secondary Linux distribution in to the exact partition you've listed here. And this will load the secondary GRUB on your HDD that belongs to the new installation. This worked for me 'cos there are very little reconfiguration or editing of the grub.conf or menu.lst.

How to enter this code in to your GRUB
Log in as root and open up a terminal. If you're a CentOS user type,

#nano /etc/grub.conf
or
#gedit /etc/grub.conf

if you're a Ubuntu user type like this,

~$ sudo gedit /etc/grub/menu.lst

and press enter.

Now you'll see a text file that looks just like the code that I've written here and scroll down to end of the file and type like this.

title Ubuntu
rootnoverify (hd1,0)
chainloader +1

hd1 means the HDD wich you've installed the Linux distro this could be 1, 2, 3 .... etc it depends on you and 0 is the partion where the GRUB have been installed this also could be 1, 2, 3 .... etc and remember in Linux partions and HDD number list starts from number"0"so befor you edit the boot loaders config file please verify wich number belong to wich partition or HDD.

OK, thats it try this and see wether this works and leave your comments.

0 comments:

Post a Comment