These days i've been hearing a lot about "How can install dual OS in my system ? ".The answer is simple ... jus take the installation cd/dvd and install it one by one ! lol ! That might sound pretty simple and dumb ... but the real pain in ass is yet to come !
Configuring the BOOT LOADER is one of the most important job to be done .First of all lemme tell ya wat exactly a "boot loader" is.
Boot loader is something which gives over the control to the kernel of a
specific OS.
So after your computer starts , after the "POST"(Power On Self Test) , the first thing that operates is your boot loader.
GRUB(GRand Unified Bootloader) is the boot loader used in most of the linux systems. There also other boot loaders available like
LILO.
Anyhow i'm not interested in telling about their history and stuffs, Lemme jump straight to the point now...
Since i've already said what a boot loader is all about, lemme now tell something about the MBR.
MBR stands for the Master Boot Record.As the name suggests, this is a part of the hard disk(always located in cylinder 0, head 0
and sector1 of your hard disk)
which contains the booting information.
Now lets come to a practical scenario, where "roy" has installed "Fedora 7 linux" in his harddisk 1st and installed "Windows XP" next.He boots his pc and is extremely shocked to find out that no matter how hard he tries, he can not see any option to boot into linux !
Right, lets solve it now ! first lets analyze , why did it happen ? Well the answer to this is simple . Windows XP doesnt have a multi boot bootloader (For those who dint know, know it now ) ! It only has a couple of files such as NTLDR (New Technology Loader) to take care of booting its own OS.
But what about his linux ???? is it gone ?? Nah Dude ... Chill !!
Here's where GRUB comes in for rescue ! It's an awesome bootloader which loads of customizable options, recovery console, which can boot jus about any OS !
Now lets fix poor roy's problem.Here's wat you do ...
Step 1) Insert your linux rescue cd and boot in rescue mode
Step 2) Your linux distro will mount your system image automatically in some location (differs from distro to distro). If you are using Fedora, your image will be be mounted on
/mnt/sysimage
Step 3) change your root directory over to it . Just enter :
chroot /mnt/sysimage
Step 4) assuming your linux installation is in the firstsata/scsi drive, reinstall grub as follows:
grub-install /dev/sda
Note: for IDE drives the physical name will be /dev/hda . If your linux is in your second hard drive, it'll be /dev/hdb and so on...and for RAID users, it gets a bit complex, refer the man page for more details .
Step 5)After your boot loading information is mapped properly , you'll get a confirmation and then you can reboot !
Step 6) Woala .... !!! I can boot two OS'es now !!!!
But for solving more complex problems, you must have an in depth knowledge about GRUB. I can't tell u everything about it , but i'll sure list out the most important concepts.
Firstly GRUB and all its configuration files resides on /etc/grub .
The kernel and initrd (initial ram disk) stays in /boot directory. Your might also also have a separate boot partition, which you can check out by a simple "fdisk -l" command .
To control GRUB's function you have to edit its's config file, which resides in /etc/grub.conf
A typical configuration file looks like this:
-------------------------------------------------------------------------------------
# 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,1)
# kernel /vmlinuz-version ro root=/dev/hda3
# initrd /initrd-version.img
#boot=/dev/hda2
default=0
timeout=10
splashimage=(hd0,1)/grub/splash.xpm.gz
title Red Hat Linux (2.4.7-10)
root (hd0,1)
kernel /vmlinuz-2.4.7-10 ro root=/dev/hda3 hdc=ide-scsi
initrd /initrd-2.4.7-10.img
title Windows 2000
rootnoverify (hd0,0)
chainloader +1
------------------------------------------------------------------------------------
A few points about the configuration file now...
This statement lets you define which OS to load by default, after the time out.
This statement tells how long to wait for the user's choice ("press a key ..." and something like that..)
- splashimage=(hd0,1)/grub/splash.xpm.gz
Here your can give the path to the GRUB's splash image . Note dat it must have an extension of xpm.gz ! the image must be edited to fit some constrain (8bit depth,14 colours
and 640x480 size ).You can use the "convert" tool for converting your image.
- title Red Hat Linux (2.4.7-10)
You can specify the title here
This statement says where the root partition actually resides and mounts it accordingly. the (hd0,1) is your (harddisk,partition number).Please note that the partition actually starts from 0 here.So in case if you wanna know your partitionn number by "fdisk -l" , the partition number to be entered here is one less than the partition you actually saw in the "fdisk -l" output.
- kernel /vmlinuz-2.4.7-10 ro root=/dev/hda3 hdc=ide-scsi
initrd /initrd-2.4.7-10.img
These statements tells the path of kernel and initrd(which acts like a temporary storage for loading the kernel.)
This is similar to the "root(hd0,0)" but the only difference being that , this time it commands not to attempt to mount the partition. Which is kinda required for booting the windows systems.
This means "start loading right from the 1st sectorin the specified partition". This is the way windows get loaded as NTLDR always starts from the 1st sector of the partition.
u can add comments in teh config file by puttin # in front of a line.
I guess i've added enough info for now, if u think i missed anything important, do lemme knw ! adios ... n happy booting .. ;D