No one here needs to be reminded how virus prone windows environment is, and in case if you face a situation where you have corrupted your C: partition, then first solution that comes to mind is format active partition and reinstalling the windows.
But if you had already installed Linux after installing windows. and wish to reinstall XP then you are in a hang, as windows XP installation CD will not boot up properly with Linux installed on same system.
I have faced this situation many times; the XP installation will just hang after displaying
“Detecting your hardware configuration”…
A work around to this problem dose exists.
Now I will just jot out the materials and steps required to reinstall XP in a hard disk with a Linux already installed.
- First you installed windows XP.
- Then installed Linux flavor like Fedora or Ubuntu.
- XP corrupted due to virus or any other reason.
- Now you have problem reinstalling XP, yet you don’t want to format your any of the Linux partition.
- Smartdrv.exe (you can find this in the windows 98 installation CD or download it from internet). This is a driver that will enable fast copying of data in 16 bit mode.
- Windows XP installation CD (which you want to install).
- Windows 98 bootable CD (needed to boot the computer).
Procedure to follow
- Backup all your data, [ NOTE : this is the most important step].
- Backup your boot loader configuration, ex: “menu.lst” in case of GRUB.
- Find out how to recover a boot loader for your flavor of Linux, this example considers Fedora & Ubuntu installed along with a corrupt XP [NOTE: step 2 & 3 are second most important steps].
- Boot your Linux, you can also use Ubuntu live CD’s (last time I used Ubuntu 8.10).
- Format the corrupted/virus effected partition with fat32 file system. You can do this easily using Parted or Gparted which is a GUI front end to Parted.
- Insert the windows XP installation CD into the computer, and copy the “I386” folder to your newly formatted partition.
- Copy the smartdrv.exe to the same partition.
- Now insert the windows 98 installation CD and reboot the PC with this CD.
- Go to the newly formatted partition and run the “smartdrv.exe” on the command line.
- Change directory to “I386” directory.
- Now run the “winnt.exe” from command line.
- An installation of windows XP will begin in 16 bit mode.
- You will be asked to choose some settings, most of which are already in correct form.
- Start the installation.
- After the installation is over in 16 bit mode (which is essentially copying of files), you will be asked to reboot the computer again.
- Reboot the pc this time without the windows 98 CD.
- Windows XP installation in 32 bit mode will begin (as normal way that we experience when installing from CD).
- Reboot your PC to a fresh installed XP.
- Now to get your GRUB boot loader back you can use the Ubuntu live CD or Fedora installation DVD to upgrade the currently installed fedora (which ever your Linux version be, there is usually some method to recover a boot loader in the installation media).