We all must, in some moment, have faced the problem of grub in our machine. Especially, when we try duel booting (i.e using windows and linux in same machine). Most of us have faced this problem, we lost our linux when we upgrade or reinstall windows (we do that lot of times) and some time even when we hibernate our windows. And we have no other way to recover the lost grub to boot linux, other than by upgrading the previous linux (probably the simplest way) or by re-installing the grub (a bit complex for the naive users). But there are other ways that can ease our life. First, by using third party boot manager software and other is to use window’s own boot manager. The second step is unknown to many of us but is a classic method popular among the users.
Well i am trying to tell you this classic method which might help you to boot dual OS in you machine with out any third party software and only using window’s own boot loader.
Before telling this method I must tell you that this by all means may not work for everybody. And like to add that I have found this method in internet and have tried this successfully on my machine with windows and fedora core 6. According to the users, this method should work on the other distros of linux like redhat, ubuntu, suse etc. I think the process should work for all of these with some adjustment.
The first step: Preparation
First of all, you must have a working floppy disk and drive in your system. Then Linux installation disk, rescue disk. Windows installation CD or preinstalled would be great.
Now let’s begin, I have windows xp in my first partition that is usually C:\ . Now let’s install Fedora Core 6 on the second hard drive or other partitions. During installation, use automatic partitioning tool. If you have experience then you can manually configure your Linux partitions (manually would be better because that way, you will know your boot partition).
While installing boot records or installing grub, don’t put grub on your Master Disk MBR but instead put it on the first sector on your second drive. Or if you know which is your Linux boot partition or \ partition you can install it there too. When you get to the Boot Loader Configuration screen make sure you check the Configure advanced boot loader options. The next screen will give the option where to put Grub Boot Loader. It should say like hda or hdb. hda is usually first drive that is XP Drive so Put it on hdb. Just finish up your installation and reboot your system.
Second step: Execution
After rebooting system you must notice that, system boots windows directly without noticing traces of Linux. This is because system doesn’t know from where to load Linux which is the job of grub or LILO to tell system.
Now use your installation CD to boot to Fedora installation wizard. And choose the rescue option from the menu. You might have to choose the language and other option before you get to rescue option or you might face this option beforehand. This depends on the CD you have used. In my case, I got language first then rescue screen select, hit enter key until you get sh-300# prompt.
At the prompt type in chroot /mnt/sysimage
Type df then determine which hard disk you have installed the grub that boot partition is. This will show you your hard disk partition information. In my case the partition is hdb5, Then Run the command
Sh-300#dd if=/dev/hdb5 of=boot.lnx bs=512 count=1
Be careful when you type in the hard disk address. If your installed drive is logical drive then the count start with 5 and if t is primary then it start with 1. Refer to other place for the addressing of the partitions. After this you should see
1+0 records in
1+0 records out
Type ls and you should see a file named boot.lnx
Put a blank floppy disk in a: drive
Type mcopy boot.lnx a:
It should have copied the file to a: drive
Third step: finalization
Now reboot to Windows copy boot.lnx to your root directory i.e. c: in my case. Right click on boot.ini file select properties and uncheck read only click ok. Double click your boot.ini file and add one line at the end it should read
C:\boot.lnx=”Fedora Core 6″. Then save it. When you reboot your XP boot manager will come up and you can chose Fedora it jumps to the Grub Boot manager on your second drive.
My boot.ini file looks like this
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(0)(1)\windows
[operating systems]
multi(0)disk(0)rdisk(0)partition(0)(1)\windows=”Microsoft Windows XP Pro SP2″
/fastdetect /NoExecute=OptIn
c:\boot.lnx=”Fedora Core 6 “
At the end if you have already installed grub in mbr, then you can erase it by using fdisk /mbr command in command after booting from windows start up disk. Or by running windows repair and typing these command,
FIXBOOT C:
FIXMBR
BOOTCFG /rebuild
If you don’t want to and still desired to stick with old grub windows, you can either upgrade your Linux with same cd and not choosing any new package and changing your boot loader address to mbr. OR installing grub manually (for this refer to other articles).
UPDATE
If you find all above editing boot.ini file troublesome you can also search for boot.ini file editor and use it.
For windows vista, we have a BCD file which stores the boot information in rather complex way so editing is troublesome. But we can do our job rather easily as thanks to the software like BCD editor, all above trouble can be dealt with in fly.
Just go to http://neosmart.net/dl.php?id=1 for the more information of BCD editors.
Reference:
http://www.geocities.com/epark/linux/grub-w2k-HOWTO.html
http://www.tldp.org/HOWTO/Linux+NT-Loader.html
And other forums found in internet
2 comments so far
Leave a reply