Making the system dual boot for Linux and Windows XP
Since I was booting everytime from a floppy the reason being my /boot partition was not within first 1024 cylinders. I wanted to make my system dual boot.
One day my friend Ajay Gautam suggested that we would be able to dual boot even though /boot partition was not within 1024 cylinders because the latest versions of BIOS support this feature. Actually he was able to dual boot under similar circumstances but he was using LILO. He gave me idea of using GRUB.
Download GRUB if you don’t have it installed already. Before installing GRUB, you need to know how GRUB understands your hard drive and partition information. Counting of hard drives starts from 0, not from 1. In Linux, your first hard drive attached to the primary master controller is called "hda". In GRUB it becomes "hd0". Likewise, your first floppy drive in GRUB is "fd0". So the first, second and third partitions on the first hard disk (hda1, hda2 and hda3), become "hd0,0", "hd0,1" and "hd0,2" in GRUB. NOTE: the comma is an integral part of GRUB partition nomenclature.
As a root run:
# /sbin/grub-install /dev/hda
This will load GRUB into the master boot record of your disk. Now you need to edit /boot/grub/grub.conf to configure the GRUB boot menu.
"default=1" and "timeout=10" will cause Windows XP to boot in 10 seconds if you don't touch anything. "splashimage" is self-explanatory and not very important.
"title" denotes each boot setting and the text that follows is what will appear in your menu at startup. "root" specifies which partition contains your Linux kernel image (this may or may not be your actual root (/) partition). So, "root (hd0,0)" tells GRUB that the kernel is on the first partition of /dev/hda. You can see that GRUB has a funny numbering system, 0-3 for primary partitions and 4+ for logical partitions. The next line tells GRUB just where to find your kernel and where your actual root partition with your Linux system is. "initrd" tells where your init ramdisk image is located. Note that these few lines will probably be somewhat different if you don't have a separate /boot partition. Look at the GRUB info page if you need more help.
"rootnoverify" tells GRUB to boot from the Windows partition, but not to attempt to mount it, and "chainloader +1" tells GRUB to chain to Windows' bootloader which will start Windows.
My GRUB.CONF initially looked like this initially:
default=1
timeout=10
splashimage=(hd0,1)/boot/grub/splash.xpm.gz
title
RH7.2J
root
(hd0,1)
kernel
/boot/vmlinuz-2.4.7 ro root=/dev/hda2
title WinXP
rootnoverify
(hd0,0)
chainloader
+1
also i
think i gave grub-install /dev/hda at #prompt
and also at
grub> i gave root(hd0,1) and kernel
/boot/vmlinuz-2.4.7-10
root=/dev/hda2
so now when
i boot without floppy i get a blue screen
with
grub>prompt rather loading XP
Then when the system boots it loads the GRUB program and waits. But I was pissed off because I could not load my Windows XP .I had all my important files in the partition containing XP and when I tried to use the recovery CD to trouble shoot the problem the recovery CD did not work instead it “says recovery CD error” then came a message “Call Compaq for Help” .All the crazy things happening to me that day. I had people suggesting me to re-install my windows XP but I was sure that was not a good idea because I had a firm belief that my XP partition was there.
These commands
grub
root
(hd0,1)
setup
(hd0) did not fix it.
Scott
suggested: Here's something that I've sometimes found has fixed it--put a blank
floppy
in. Then,
in RH, don't go to grub, just do
grub-install
'(fd0)'
Then, the
root (hd0,1) and setup (hd0) this did not work either.
I had the following files in /boot/grub initially
Device.map,Ffs_stage1_5,Reiserfs_stage1_5,Stage2,E2fs_stage1_5,Splash.xpm.gz,Vstafs_stage1_5,
Fat_stage_1_5,Minix_stage1_5,Stage1.
If you don’t have the splash.xpm.gz it can be downloaded from www.gnu.org/grub or from scott’s webpages at http://home.nyc.rr.com/computertaijutsu/grub.html and The splash image (Gentoo's) is at
http://home.nyc.rr.com/computertaijutsu/splash.xpm.gz
I had to create a file called grub.conf and then my grub.conf initially was like this
default=1
timeout=10
splashimage=(hd0,1) /boot/grub/splash.xpm.gz
title RedHat 7.2
root (hd0,1)
kernel /boot/vmlinuz-2.4.7-10 ro root=/dev/hda2
initrd /initrd-2.4.7-10.img
boot
title windows XP
rootnoverify (hd0,0)
makeactive
chainloader+1
boot
Later I found that I forgot to give a space between chainloader and 1.Though actually I had a space in between but I don’t know when I changed that and was so tensed up that I overheard Scott’s suggestion of giving a space. However the other problem was that I had to add “makeactive“ and “boot” in the GRUB.CONF file.
The final version of my GRUB.CONF file looks like this:
default=1
timeout=10
splashimage=(hd0,1) /boot/grub/splash.xpm.gz
title RedHat 7.2
root (hd0,1)
kernel /boot/vmlinuz-2.4.7-10 ro root=/dev/hda2
initrd /boot/initrd-2.4.7-10.img
boot
title windows XP
rootnoverify (hd0,0)
makeactive
chainloader +1
boot
That’s it my system was a dual boot now. For more details visit www.