<---- template headericclude ----->
HOWTO Reinstall XP Without Destroying Fedora When the XP CD Balks
FedoraForum.org - Fedora Support Forums and Community
Page 1 of 8 123 ... LastLast
Results 1 to 15 of 114
  1. #1
    Join Date
    Jun 2006
    Posts
    7,544
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    HOWTO Reinstall XP Without Destroying Fedora When the XP CD Balks

    UPDATE 4/27/2011: Since writing this HOWTO several years ago, I've learned how easy it is to backup and restore an entire Fedora system in various ways. It now seems to me that the simplest way to deal with this issue (until XP goes away) is to backup the Fedora system, delete its partitions, re-install XP, and restore the Fedora system from the backup. I am not motivated to test the idea, but I feel certain it would work. Anyway, the original ideas (for the record)...

    In a system that dual boots XP and Linux, the XP CD sometimes will not boot when the reinstallation of XP is attempted. XP Setup may halt immediately after displaying "Setup is inspecting your computer's hardware configuration...". This doesn't always happen when Linux partitions are present in the system. But when it does happen, Linux partitions always seem to be present. And removing the Linux partitions universally "cures" the problem. The usual remedies for this well-known but poorly-understood situation include completely wiping all data from the hard drive, destroying the master boot record, or deleting the Linux partitions. Those procedures do work to allow the XP CD to boot again, but what can be done about this problem when destroying a Fedora system is undesirable?

    I conducted many tests of various ideas. Below are at least a few of the ideas that worked for me in the limited scenarios in which I was able to make my XP CD balk. I am omitting from here what did not work and what I could not test. The tests that I conducted were always done with Fedora 7 installed with its boot partition as /dev/sda1 on the first drive in the BIOS boot order. XP was either in a partition also on sda or on a separate drive. That is the only way that I can make my XP CD balk. This can happen in the real world when people use a partition manager to create space for Fedora "in front of" an existing XP partition. From reading many posts on this subject, I know that there are other partition layouts in which this problem can happen. But I cannot test every partition scenario that can make an XP CD balk. Therefore these solutions may not work for you.

    IMPORTANT: Some of the methods described below require somewhat advanced tweaking abilities and an understanding of both GRUB and NTLoader. The level of detail in the instructions will not suit a complete newbie. Proceed with caution and at your own risk. No promises. No guarantees. I cannot be expected to assist in repairing a system busted by anything here.

    WARNING: Some of the procedures described below involve utilities and commands that have the potential to ruin your operating systems and hard drive data. Do not use them unless you thoroughly understand what you are doing or can accept the risk of completely destroying your systems and data.


    The Things I Tested for the Balking XP CD


    Code:
          The XP CD Setup program halts after
          inspecting the hardware configuration
          and a Linux system is present.
                         |
                         |
                         |
                 Is the Linux system
                 to  be  preserved?
                 /                 \
               No                  Yes
               /                     \
    Delete all of the          Are XP and Linux 
    Linux partitions.          on the same drive?
    Reinstall XP. See          /                \
    Note 1.                  Yes                 No 
                             /                    \
                 Can  another  drive         Make the XP drive first
                 without Linux partitions    in the BIOS boot order.
                 be  made  first  in         Reinstall XP. Restore
                 the BIOS boot order?        the BIOS boot order.
                 /                 \         
               Yes                  No
               /                     \
    Make any drive without     Is /dev/sda1 the
    Linux partitions first     Linux boot partition?
    in the BIOS boot order.    /                \
    Reinstall XP. Restore     No                Yes
    the BIOS boot order.     /                    \
    See Note 2.            ???               Delete the boot partition.
                       Not tested.           Reinstall XP. Restore the
                                             boot partition. See Note 3.
    Note 1: Delete all of the Linux partitions. If nothing on the drive needs to be preserved, you may clear the drive by any means including DBAN and destroying the master boot record with zeroes using dd. If only the Linux partitions are to be removed leaving other partitions, use a partition manager such as the GParted LiveCD or fdisk in linux rescue. If LVM physical volumes need to be removed, use fdisk in linux rescue.

    Note 2: Make any drive without Linux partitions first in the BIOS boot order. The drive that you make first in the BIOS boot order can be any other drive in the system or even a temporarily installed drive. XP Setup requires that the drive that is first in the BIOS boot order have a compatible active primary partition (NTFS or FAT) for the XP boot loader files. It cannot use a logical partition for this. If a compatible active primary partition is not present when Setup starts, it will stop and require you to make one using its "disk druid". It can be as small as 8MB. If there is no room for a new partition, XP Setup can delete an existing partition to make room, but it cannot resize partitions. When a compatible active primary partition is either found or created on the drive that is now first in the BIOS boot order, XP Setup will copy ntldr, ntdetect.com and boot.ini to the root directory of it. XP Setup will also write new boot code in the master boot record. After reinstalling XP but before you remove the temporary drive or restore the drive boot order, you must copy ntldr, ntdetect.com, and boot.ini to the XP partition. You must also edit the boot.ini file and change the drive number (rdisk value) so that XP will boot when the temporary drive is removed or the drive boot order is restored. All of that file copying and editing work can be done in the newly installed XP system. Then the normal drive order can be restored and the computer rebooted. If you botched any of that file copying and editing work causing XP not to boot, you can access those files from Fedora to fix things.

    Note 3: Delete the Fedora boot partition (do not confuse with /boot directory). That allowed the XP CD to boot normally in my tests when the boot partition was /dev/sda1. After XP is reinstalled, the Fedora boot partition can be restored. Moving the boot partition to another drive with a partition manager also worked, but just moving it elsewhere on the same drive did not. I finally found that deleting the Fedora boot partition followed by restoring it after XP was reinstalled was easier than moving the boot partition with a partition manager. The method that I tested is described below. The ext3 Fedora boot partition was /dev/sda1, the NTFS XP partition was /dev/sda2, and the ext3 Fedora root partition was /dev/sda3. I cannot know how this method will work in other scenarios and situations that I did not test. I leave it to you to know whether or not this method is appropriate for you to try. Your partition scenario may require some adjustments to what I did.

    1. Delete the Fedora boot partition using fdisk in linux rescue. IMPORTANT: Write down the Start and End cylinders of the partition as reported by fdisk before deleting the partition.

      Note 3.1: I made an Acronis backup image of the boot partition but didn't need it. I recommend making a backup of your boot partition with imaging software or with dd before deleting it.

    2. Reinstall XP in its same partition.

    3. When XP boots, edit boot.ini to change the partition number so XP will boot when the Fedora boot partition is restored to its original place "in front of" the XP partition. If you botch this causing XP not to boot later when the boot partition is restored, you can access boot.ini from Fedora to fix it.

    4. Reboot into linux rescue.

    5. Restore the Fedora boot partition using fdisk "add a new partition" and using the same first and last cylinders.

      Note 3.2: If the partitions are now renumbered, you will have to use whichever primary partition number is now available (see how to deal with this in the next step). But you must use the same first and last cylinders for the boot partition files to be restored.

    6. Still in fdisk, I used the extra functionality menu of fdisk and "fix partition order" to return my partitions to "disk order". After fixing the partition order, the boot partition was sda1 again. The other partitions were back to their original numbers. WARNING: If you started out with your fdisk partition table entries "not in disk order", using fdisk "fix partition order" now to correct the boot partition after installing XP could "misnumber" the other partitions causing some additional tweaking to be needed.

      Note 3.3: An alternative to fixing the order of the partitions is to leave them that way and instead edit /boot/grub/grub.conf and /etc/fstab for the shifted partitions. I tested this and it works. But I had to edit boot.ini again to change the partition for XP to boot.

    7. Save the fdisk partition table changes with "write table to disk and exit".

    8. Exit linux rescue but reboot right back into linux rescue for the system to use the new partition table.

      Note 3.4: After a reboot back into linux rescue, the files and folders were back in the boot partition since it was restored using the original first and last cylinders. As long as the new partition is created using the same cylinders which were not damaged or changed in the meantime, the boot partition files sort of "auto-restore". I could see them with ls /boot. I confirmed their partition location with the GRUB shell command find /grub/stage1. I did not have to use my Acronis backup image of the partition, but it is still a good idea to make a backup.

    9. Reinstall GRUB in the master boot record if it was there before reinstalling XP.

    10. Exit linux rescue and reboot the computer.
    Last edited by stoat; 30th July 2008 at 12:16 AM.

  2. #2
    Join Date
    Jul 2007
    Location
    Indiana USA
    Posts
    1,715
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    very nicely laid out and well researched, your effort is well appreciated.
    The answer to all of lifes questions are buried somewhere in the Google search engine.

    Code:
    [Stephen@localhost ~]$ whatis this?
    this?: nothing appropriate

  3. #3
    Seve's Avatar
    Seve is offline Retired Community Manager
    Join Date
    Oct 2004
    Location
    The GTA, Ontario, Canada
    Age
    65
    Posts
    12,371
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello stoat:
    Nice work

    Thanks

    Seve
    Registered Linux User: #384977
    .................................................. ............
    See the Links below for more Help and those much wanted extras ... :)


  4. #4
    leigh123linux Guest
    Quote Originally Posted by Seve
    Hello stoat:
    Nice work

    Thanks

    Seve
    Hi Seve,

    Why don't you give it a sticky

    Leigh

  5. #5
    Seve's Avatar
    Seve is offline Retired Community Manager
    Join Date
    Oct 2004
    Location
    The GTA, Ontario, Canada
    Age
    65
    Posts
    12,371
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello Leigh:
    Once I figure out what constitutes a sticky I will get back to you

    Seve
    Registered Linux User: #384977
    .................................................. ............
    See the Links below for more Help and those much wanted extras ... :)


  6. #6
    leigh123linux Guest
    Quote Originally Posted by Seve
    Hello Leigh:
    Once I figure out what constitutes a sticky I will get back to you

    Seve
    A sticky keeps the post at the top of the list in this section ( makes it easier to find )

  7. #7
    Join Date
    Jul 2004
    Location
    Colton, NY; Junction of Heaven & Earth (also Routes 56 & 68).
    Age
    78
    Posts
    24,889
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    (Seve, it's under Thread Tools - "Stick Thread") - I did it, btw.
    Linux & Beer - That TOTALLY Computes!
    Registered Linux User #362651


    Don't use any of my solutions on working computers or near small children.

  8. #8
    Seve's Avatar
    Seve is offline Retired Community Manager
    Join Date
    Oct 2004
    Location
    The GTA, Ontario, Canada
    Age
    65
    Posts
    12,371
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello:
    Thanks Bob

    Leigh:
    I probably should have phrased it differently, as I was just was wondering ( to myself) what "merits" a sticky.

    Seve
    Registered Linux User: #384977
    .................................................. ............
    See the Links below for more Help and those much wanted extras ... :)


  9. #9
    Join Date
    Jul 2004
    Location
    Colton, NY; Junction of Heaven & Earth (also Routes 56 & 68).
    Age
    78
    Posts
    24,889
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A 'sticky' is a thread that would be useful to most people searching the particular Forum and one that's not likely to be out-dated in the next version. It should also be a good tutorial and pretty complete so that it covers most situations. This one fits the bill perfectly.
    Linux & Beer - That TOTALLY Computes!
    Registered Linux User #362651


    Don't use any of my solutions on working computers or near small children.

  10. #10
    Join Date
    Oct 2006
    Location
    Melbourne
    Age
    52
    Posts
    603
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks stoat for your detailed 'how to'! I have been trying to solve this problem for over one year now. I gave up eventually and decided it was best to create a local repository with all extra programs and their dependencies in case i had to reinstall fedora due to this win xp reinstall scenario. At one stage i thought by making the /boot partition a'logical' type would solve the problem. No luck!

    I also tried copying the boot partition using 'Acronis Disc Director Suite' to an external USB hard drive making sure the partition that i copy is of the same type eg primary to primary when i copy it back. I had no success with this one after many attempts.I'm not sure creating an image of the /boot will work and i would suggest the other option that you have to be the way to go.

    If you could clarify a few points for me please:

    Creating the /boot partition with the original first and last cylinders will allow 'linux rescue' to reinstall the missing files.

    What about if i just reformat the /boot partition and then reinstall win xp. This way it is not necessary to delete the /boot partition so the partition table should be OK. I know from experience that reformatting the /boot will allow me to reinstall win xp. Now if simply reformatting the /boot partition avoids the possibility of partition table errors then i just need to recreate or 'auto-restore' the /boot files? If you could list the EXACT process here i'm sure a lot of people would really appreciate it.

    1. Boot cd/dvd
    2. Type at the prompt: linux rescue
    3. What happens next?

    Installation notes that might be helpful when duel booting Windows Vista, XP and Linux:

    http://forums.fedoraforum.org/forum/...943#post873943

    johnny
    Last edited by jonathonp; 1st October 2007 at 11:36 AM.

  11. #11
    Join Date
    Jun 2006
    Posts
    7,544
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by johnnylinux

    What about if i just reformat the /boot partition and then reinstall win xp. This way it is not necessary to delete the /boot partition so the partition table should be OK. I know from experience that reformatting the /boot will allow me to reinstall win xp. Now if simply reformatting the /boot partition avoids the possibility of partition table errors then i just need to recreate or 'auto-restore' the /boot files?
    The magical "auto-restore" thing I described is meant to apply only to using fdisk to delete the Fedora boot partition and using it again later to create a new partition in the same cylinders without anything occurring to harm the data sitting there while you install XP in the meantime. If you do it that way, the boot partition is magically restored. But if you reformat the boot partition, the data there is gone.

    I repeated the experiment on my A31 Thinkpad (sda1=boot, sda2=root, sda3=FAT32, sda4=XP). Deleting the Fedora boot partition was again all that I had to do to get the XP CD to boot and install XP. However, cottsay reported that just deleting the boot partition did not make the XP CD boot in his/her situation. cottsay found that creating an NTFS partition in the place where the boot partition had been resulted in the XP CD booting. But that also will destroy the data there. cottsay did not try restoring the boot partition because no backup was made. cottsay only wanted the XP CD to boot again.

    In those two situations (your reformatting the Fedora boot partition and cottsay's creating a new partition in its place) the XP CD may work again, but you must restore the boot partition from a dd backup or a disk image. I tested restoring it from a dd backup. It worked with Fedora booting normally and is only a little more trouble than the magical "auto-restore" trick.

    Example of me creating the backup before deleting my sda1 Fedora boot partition:
    Code:
    dd if=/dev/sda1 of=/mnt/fat32/boot.bin
    Example of me restoring from the backup after installing XP and recreating the same sda1 partition:
    Code:
    dd if=/mnt/fat32/boot.bin of=/dev/sda1
    Last edited by stoat; 8th October 2008 at 02:29 PM.

  12. #12
    Join Date
    Oct 2006
    Location
    Melbourne
    Age
    52
    Posts
    603
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your help and putting me on to 'Acronis true image'. Acronis True Image is an excellent tool and works well. The 'Backup' wizard enables you to select your archive to create an image of the partition or file and copy to your source which in my case was an external USB hard drive . The 'Recovery' wizard allows you to restore the image to the partition. As a result it is just a matter of reformatting the /boot partition, reinstall win XP and restoring the 'acronis image' with the 'acronis rescue media' if you like. This works well if you have multiple Linux systems.

    i would prefer though to use the 'dd - convert and copy a file' command as you suggested since the dd command tool enables one to create an exact image of a drive or partition and is open source. The command has many other options as well and is quiet an amazing tool. Here is very good link for the dd command.

    http://www.linuxquestions.org/questi...d.php?t=362506

    It's a good idea to read carefully as this command has many options and has the potential to trash your system.

    By the way the windows XP reinstall scenario doesn't occur with windows XP 64 bit edition and windows vista. It only occurs with the windows XP 32 bit edition.

  13. #13
    Join Date
    Jan 2006
    Location
    UK
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi there.

    Thanks very much indeed for the info. I'm in this position, but am a tad confused.

    My scenario is thus...

    I have a box with two IDE drives - hda and hdb.

    I originally installed Windows on hda, and then Linux on hdb.

    Grub handled everything just fine, and allowed me to dual-boot between the two.

    Grub is installed on the MBR of hda.

    Here's the problem...

    For reasons entirely of my own doing, Windows does not exist anymore and needs to be re-installed onto hda.

    I'm fairly sure this will cause problems, and I will no longer be able to boot into Linux.

    Now, according to the above, I should make the Windows drive first in the BIOS boot order, reinstall Windows, then restore the BIOS boot order.

    But hda is already first in the BIOS boot order, because the MBR of hda already contains stage1 of grub.

    This then directs to stage2 - the Linux /boot partition on hdb - which presents the usual grub splash screen, allowing you to boot into either Windows or Linux.

    I'm thinking the solution might be this...

    1. Save the MBR with "dd if=/dev/hda of=MBRhda.bin bs=512 count=1"

    2. Install Windows onto hda.

    3. Boot into a Linux rescue / live cd.

    4. Restore the MBR with "dd if=MBRhda.bin of=/dev/hda bs=512 count=1"

    Does this seem a resonable solution?

    Thanks very much.

  14. #14
    Join Date
    Jun 2006
    Posts
    7,544
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by whiphubley

    I'm fairly sure this will cause problems, and I will no longer be able to boot into Linux.
    Hello whiphubley,

    Your words make it sound like you haven't yet tried to reinstall Windows. I would try it first. You may not encounter the problem of your XP CD not booting. As I noted in the first post, it doesn't always happen.

    And you are right about problems with your dual boot setup after reinstalling XP. XP Setup will rewrite the boot code in the master boot record of your hard drive causing only XP to boot. But that is a different and unrelated issue from the subject of this thread. For that I recommend that you just proceed with reinstalling XP and let it rewrite the MBR boot code. Then simply reinstall GRUB in the master boot record using your Fedora installation disk and linux rescue. That subject is well documented.
    Last edited by stoat; 3rd November 2007 at 01:32 PM.

  15. #15
    dancingdog777 Guest
    There is another way Stoat. Install XP to run IN Linux using Win4Lin.

    Thing I don't understand though, is it necessary to still run an anti virus program even though it's within Linux (Fedora in our case)?
    Last edited by dancingdog777; 3rd December 2007 at 10:38 PM.

Page 1 of 8 123 ... LastLast

Similar Threads

  1. Fedora (and Linux) Destroying it self
    By shadowen in forum Alpha, Beta & Snapshots Discussions (Fedora 11 Only)
    Replies: 6
    Last Post: 11th May 2009, 03:11 PM
  2. howto reinstall grub ( after delete vista )
    By carlainz in forum Using Fedora
    Replies: 1
    Last Post: 6th August 2007, 11:26 AM
  3. Howto reinstall Grub(boot loader)
    By khunmyo in forum Installation, Upgrades and Live Media
    Replies: 5
    Last Post: 10th March 2007, 10:00 AM
  4. HowTo Reinstall Windows after loading FC5
    By pparks1 in forum Guides & Solutions (Not For Questions)
    Replies: 6
    Last Post: 22nd February 2007, 11:48 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
[[template footer(Guest)]]