How to format XP ? (without deleting Boot Camp partition)

Discussion in 'Windows Virtual Machine' started by Roger Thornhill, Aug 17, 2010.

  1. Roger Thornhill

    Roger Thornhill Bit poster

    Messages:
    5
    Hi,

    I have XP installed on a Boot Camp partition (Mac OS 10.5.8) and I'm using Parallels Desktop 5.
    Now I'd like to format my XP partition and reinstall XP.

    As far as I know, it requires booting from the Windows XP CD, but the drive never gives me the option to boot from the CD - and in the Parallels Boot Order options, I can't set the boot sequence to start from CD-ROM, the options are grey and not clickable.

    I also checked this article: http://kb.parallels.com/en/5138 that says I should do it with the Boot Camp Assistant, but according to the Boot Camp manual (p. 22), the Boot Camp Assistant would delete the whole Windows partition and restore the disk to a single-partition Mac OS X volume (and I don't want to delete my Boot Camp partition, I just want to format XP on it).

    So is it possible to format XP without deleting my Boot Camp partition (because creating a Boot Camp partition with all the needed drivers is quite annoying), and also without having to reinstall Parallels afterwards?

    Thanks for any help!
     
  2. joevt

    joevt Forum Maven

    Messages:
    1,207
    You can't change the boot order while the virtual machine is running. First shutdown Windows XP in your virtual machine to stop the virtual machine. Then you can modify the configuration.

    It is only necessary to run Boot Camp Assistant if the hard disk you want to install Windows on has not been partitioned by Boot Camp Assistant before.

    If you're installing to a Boot Camp partition that already exists, then you should boot the Mac using the Windows XP CD. Insert the CD, restart the Mac and hold the C key to boot the CD. If that doesn't work then restart the Mac and hold down the option key until you see the Mac boot menu, then select the CD.

    The instructions in the article you linked is just another way to boot the Windows installer. Clicking the "Start the installation of Windows" button will stop Boot Camp Assistant from doing the rest of it's business and will just boot the CD for you without requiring you to hold down a key during startup.

    The Windows installer should give you the choice to erase/format the existing Windows partition. Don't accidentally erase your Mac OS X partition. Once you install Windows, you'll need to install the Boot Camp drivers from your Mac OS X DVD.
     
  3. Roger Thornhill

    Roger Thornhill Bit poster

    Messages:
    5
    Joevt, thanks a lot for your detailed answer!

    I'm sorry I couldn't reply earlier, as I was really busy trying again and again to install XP on my Bootcamp partition. With no success.

    Here's what I did:

    - I changed the boot order in Parallels just as you said.

    - Then, I inserted the CD, restarted the Mac (holding the C key).

    - XP's installer then starts installing files, and asks me on which partition I'd like to install XP.
    I've been given three options here: install on a chosen partition, install on an unpartitioned space, delete the partition.
    Actually, I just wanted to format XP, I didn't want to delete the whole Bootcamp partition, but I didn't get this option.

    - So I chosed "delete the partition", let the XP installer format it again, and finally install XP in that new partition.

    - During install, the Mac reboots (to the Mac partition), so it doesn't resume the install process as it's supposed to do.

    - I then opened Parallels to see if I can resume it from there, but it doesn't work either - I guess it can't access the XP CD, as it always get loaded on the Mac partition first.

    Now, the Bootcamp partition I used to have on my Desktop doesn't show up anymore, but the 50 GB space has been allocated to it, so right now, I can't access these 50 GB.

    Apparently I did something wrong, but I don't know what.

    Any ideas?
     
  4. joevt

    joevt Forum Maven

    Messages:
    1,207
    You should not have deleted the partition. The GPT and MBR partition tables may be out of sync now. Generally, you should not do any adding or resizing of partitions in Windows when the disk is a hybrid GPT/MBR disk.

    Make sure your partitions are still in sync by using these commands in the terminals to check the contents of the partition tables:
    Code:
    diskutil list
    sudo gpt -r show -l /dev/disk0
    sudo fdisk /dev/rdisk0
    
    (You should have installed on a chosen partition and selected the partition that you want to install XP on which be the partition that you installed XP on before.)

    After XP installs files, it will restart the PC to boot the partition it installed the files on. On a Mac, you need to Insert the Windows CD, reboot the Mac, hold option key down during startup until you see the Mac's boot menu, select Windows on your hard drive, and continue with the Windows installation.
     
  5. Roger Thornhill

    Roger Thornhill Bit poster

    Messages:
    5
    Thanks a lot for your help!
    (and sorry again it always take me a couple days before I can answer!)

    Hm, I guess my disks are not in sync anymore...

    After typing 'sudo gpt -r show -l /dev/disk0' I get :

    gpt show: /dev/disk0: Suspicious MBR at sector 0
    gpt show: error: bogus map
    gpt show: unable to open device '/dev/disk0': Unknown error: 0

    How to fix this?

    joevt, one last question - you wrote:
    If I get it right, that means I would have simply install XP on its previous partition - but I wanted to know how to format my partition prior to reinstalling XP on it (because I had a quite annoying trojan horse on it, and reinstalling XP over the infected system, without proper formatting, might have been not enough I thought).
    I'm sorry, I'm really new to this...
     
  6. Roger Thornhill

    Roger Thornhill Bit poster

    Messages:
    5
    Does no one knows what I can do if my partitions are not in sync anymore?
    (The "Suspicious MBR at sector 0" and "gpt show: error: bogus map" does means the partitions are not in sync anymore, right?)
    I would appreciate any help.
     
  7. joevt

    joevt Forum Maven

    Messages:
    1,207
    I think I replied but the message was lost...

    Suspicious MBR at sector 0 is normal for hybrid GPT/MBR disks.

    bogus map is not normal.

    Show the output of the diskutil command and the fdisk command. Surround the output with [code] and [/code] to preserve the text spacing.

    Also download gdisk and install it. Then run the command:
    Code:
    sudo gdisk -l /dev/disk0
    and post the output here.

    The output of all those commands may help to figure out what's wrong with your partitions and how to fix them.

    I think the Windows installer should have a format option. If not, you could use Disk Utility on the Mac to format any partition.
     
  8. Roger Thornhill

    Roger Thornhill Bit poster

    Messages:
    5
    I'm back... ;-)

    This is the output of the diskutil command :

    Code:
    pauls-macbook-pro:~ Paul$ diskutil list
    /dev/disk0
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *232.9 Gi   disk0
       1:                        EFI                         200.0 Mi   disk0s1
       2:                  Apple_HFS Macintosh HD            181.9 Gi   disk0s2
       3:       Microsoft Basic Data                         50.7 Gi    disk0s3
    pauls-macbook-pro:~ Paul$ sudo gpt -r show -l /dev/disk0
    Password:
    gpt show: /dev/disk0: Suspicious MBR at sector 0
    gpt show: error: bogus map
    gpt show: unable to open device '/dev/disk0': Unknown error: 0
    pauls-macbook-pro:~ Paul$ sudo fdisk /dev/rdisk0
    Disk: /dev/rdisk0	geometry: 30401/255/63 [488397168 sectors]
    Signature: 0xAA55
             Starting       Ending
     #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
    ------------------------------------------------------------------------
     1: EE    0   0   2 -   25 127  14 [         1 -     409639] <Unknown ID>
     2: AF   25 127  15 - 1023 195  20 [    409640 -  381419520] HFS+        
    *3: 07 1023   0   1 - 1023 254  63 [ 381832920 -  106543080] HPFS/QNX/AUX
     4: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
    

    And this is the output of the GPT fdisk command :

    Code:
    pauls-macbook-pro:~ Paul$ sudo gdisk -l /dev/disk0
    Password:
    GPT fdisk (gdisk) version 0.6.10
    
    Partition table scan:
      MBR: hybrid
      BSD: not present
      APM: not present
      GPT: present
    
    Found valid GPT with hybrid MBR; using GPT.
    Disk /dev/disk0: 488397168 sectors, 232.9 GiB
    Logical sector size: 512 bytes
    Disk identifier (GUID): A02574E1-D2A2-4DB6-8745-17031AAC5C20
    Partition table holds up to 128 entries
    First usable sector is 34, last usable sector is 488397134
    Partitions will be aligned on 8-sector boundaries
    Total free space is 264493 sectors (129.1 MiB)
    
    Number  Start (sector)    End (sector)  Size       Code  Name
       1              40          409639   200.0 MiB   EF00  EFI System Partition
       2          409640       381829159   181.9 GiB   AF00  Customer
       3       382093312       488396799   50.7 GiB    0700  Untitled
    
    Thanks a lot!
     
  9. joevt

    joevt Forum Maven

    Messages:
    1,207
    This is what happened:
    First you had:
    Code:
    Number  Start (sector)     Size          End    Size       Code  Name
       1              40                  409639   200.0 MiB   EF00  EFI System Partition
       2          409640   381419520   381829159   181.9 GiB   AF00  Customer
               381829160      264152   382093311   129.0 MiB
       3       382093312   106303488   488396799   50.7 GiB    0700  Untitled
    
     #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
    ------------------------------------------------------------------------
     1: EE    0   0   2 -   25 127  14 [         1      409639] <Unknown ID>
     2: AF   25 127  15 - 1023 195  20 [    409640   381419520] HFS+        
    *3: 07 1023   0   1 - 1023 254  63 [ 382093312   106303488] HPFS/QNX/AUX
    
    Then in the XP installer you deleted partition 3 (a big no-no) and created a new one. The new partition took over the 128 MB space that was reserved in the GPT by the HFS+ boot partition (Mac OS X) because Windows only knows about stuff that's reserved in the MBR. The new partition 3 in the MBR was not added to the GPT so now partition 3 in the GPT (the Boot Camp partition) is no longer correct so you can't see it in the Finder anymore because the Finder only uses the information in the GPT.

    I don't think you need the 128 MB reserved space to boot Mac OS X, so you don't need to restore it. I have read that it is required if you want to install Mac OS X to it, but you already have Mac OS X installed.

    Try the following:
    0) sudo gdisk /dev/disk0
    1) type ? for a list of commands, p to print the partition table
    2) type d to delete a partition, type 3 for partition 3, p to print
    3) type n to add a partition, type 3 for partition 3, 381832920 for first sector, 488375999 for last sector, 0700 for partition type, p to print
    4) type w to write the partition table and quit
    5) restart the computer and see if the partition is visible in the Finder
    6) check if gpt -r show -l /dev/disk0 works now
    7) restart the computer and see if you can boot into Windows XP

    If you want to restore the 128 MB reserved space, then you could boot the Mac OS X installer disk, use Disk Utility to reduce the Mac OS X partition by 128 MB, then use fdisk to sync MBR partition 2 to the corresponding GPT partition.
     

Share This Page