Tuesday, December 22, 2009

How to Install Windows XP without Deleting Linux Partition



[Click to enlarge the image]

You try to start installation of Windows XP from a bootable CD/DVDROM. It displays a message saying “Setup is inspecting your computer's hardware configuration” and after a while screen goes black. It seems like as if the installation procedure hanged up.

It happens when you have a Linux partition (mostly ext3) in your disk (HDD). Easiest way is to avoid Windows XP. For example, Windows Vista and Seven doesn’t have this requirement that hard-disk should not contain a Linux partition. You can install them flawlessly.

If it is strictly required that you should install Windows XP, if you don’t need Linux anymore you can delete those Linux partitions from disk management (Right click My Computer -> click Manage -> click Disk Management and you go there).


[Click to enlarge the image]

But if you require to install Windows XP and to keep the Linux unaffected at the same time this is what this page is mainly about.

If you can access Windows in your computer then try first solution. But if you cannot access Windows or want to fix it up using Linux even if you cannot boot into Linux for bootloader problem try second solution.

You need a gnu utility called testdisk to do this. Thanks GNU for their nicest work. Download testdisk from here.
      http://www.cgsecurity.org/wiki/TestDisk_Download

First Solution
  • For Windows you should click Windows on the download page and then complete the download.

    Unzip the downloaded file.

    Go the testdisk directory. Enter into win directory.

    Double click testdisk_win.exe.


    [Click to enlarge the image]
  •  
  • If you have more than one hard-disk select the hard-disk containing Operating Systems first.


    [Click to enlarge the image]
  •  
  • Now select “proceed” and then pres enter. [pressing left or right arrow key selects an option].


    [Click to enlarge the image]
  •  
  • Select Intel (if you are using other system you know it) and then press enter.


    [Click to enlarge the image]
  •  
  • Select analyse and hit enter.


    [Click to enlarge the image]
  • Let’s first keep a back of the existing partition table.
    Select Backup and then press enter.


    [Click to enlarge the image]
  • Press ‘n’ if you were not using Windows Vista/Seven to create partitions and hit enter.

    Select quick search and then press enter. Testdisk will now be searching for lost partitions. Don’t worry about that.


    [Click to enlarge the image]
    And finally it you will be complete and a list of partitions will be displayed.
     

    [Click to enlarge the image]
  • We are temporarily going to delete Linux entries from partition table. Select every Linux partition and press left/right arrow key to change their status. Make them D as shown in image above. Please be careful in this step.

    And then press enter. Updated list of partitions will be displayed.


    [Click to enlarge the image]
  • Now select write as shown in image and then press enter.
  • It will ask for confirmation. Press ‘y’ and then enter.

    After restart you will be able to install Windows XP.
  • After installation run testdisk again. Follow the steps same like first solution but select quick search this time and hit enter key.
  • Press l to load back up in partition list window. Following screen will be displayed.


    [Click to enlarge the image]
  • Select load and hit enter.
  • Partition list will be displayed again. Hit enter. Now select write. And then y and then enter again. Now your linux partitions are back. To fix linux bootloader now follow this link.
          http://sa-os.blogspot.com/2009/11/linux-gone-after-installing-windows.html


Second Solution
If you have Linux in your disk but cannot boot into then check this link out to recover your linux bootloader.
      http://sa-os.blogspot.com/2009/11/linux-gone-after-installing-windows.html

After booting into your Linux system. Download the linux version of testdisk (rpm for Fedora Core, Suse, RHEL, CentOS and .tar.bz2 for other versions) you will have to type testdisk in a terminal after loggin in as root or doing an su.

Now follow the steps described in first solution starting from running testdisk.

N.B: Be careful about losing data giving wrong commands or committing mistakes. We suggest you to keep backup of your essential data.

If you face a problem still write in comments.

[Copy-right material. Contents of this post shouldn’t be copied to any other website for any kind of profit without permission. Contact unix9n at gmail dot com]

No comments:

Post a Comment