Oct 5, 2010

Installing Windows XP in Linux installed disk

The best way to install linux and windows in a same disk is, first install windosws in a seperate partition and then install the Linux OS. This way is the most shortest  way to make a dual boot machine.
But in some cases we may need to install a windows OS where a linux OS is running. If there is no free space to install windows it makes this tark much harder. In a case of that we muts use a tool like GParted to edit an excisting partition and make free space to windows. After editing the partition we must update the grub, which is the boot loader of the linux OS.
Then we can install the windows partition. But keep in mind, the windows partition needs extra 8Mb space also. So when you are making the partitions make sure to keep some free space. This instillation will deactivate the Linux partition when it installing its boot loader.
Now you will load only the windows OS. YOu may not see the linux partitions in when you are in windows, and also do not change or delete any of these partition.
Then reboot the system and insert linux cd, the bootable cd which you use to install the Linux OS. Boot the system by recovery option and login to your local machine. In fedora it may cay to use chroot /mnt/sysimage. Then change the user to root by typing su. Then check the disk partitions by typing "fdisk -l" command. It will list down the partitions and "*" will show what is the bootable partition. Now you should activate the linux partition by the help of fdisk command. Now we must get a backup of the boot details by doing "dd" like this;
dd if=/dev/sda1 of=/fedora.bin bs=512 count=1
For "if", you must give the partition where the linux partitions are located in. Then mount the windows partition and mv the fedora.bin file to the root "c:\ drive" of the windows partition. Then edit the boot.ini file in the root of windows to;
c:\fedora.bin="Linux Fedora"
And make sure you change the time of the boot menu display. Then reboot the system. Now you can see there are two boot options in the windows bootloder. Select one of it and use it.
If the linux options gives errors you can use grub as the bootloder which is the default bootloder of the fedora. To do that you should again reboot and boot the system with the linux cd in recovery mode. Then update the grub by typing these commands;
root (hd0,0)
setup (hd0)
In this "hd0" means the hard disk which the linux is installed and the (partition number-1) is 0. Likewise you should setup the root (hd#,#) to Linux and reboot the machine. Then after reboot again it will not show the windows and directly boot the Linux. So login as root and add these to the menu.lst file like this.
title Windows
    rootnoverify (hd0,1)
    chainloader +1

As previous you should say where the windows boot files are located in.
Now after restarting the machine you may able to use both operating systems.

No comments:

Post a Comment

Your comments are always welcome ...