How to restore a Windows 7 Bootcamp partition

12,649

In the end, the fix seems to be relatively simple: after the robocopy is done, just run the command "bootrec /RebuildBcd". The partition became bootable and readable in OS X, and selecting the Bootcamp partition from the bootloader (holding down Option when rebooting the computer) works right away -- no confusing menu with multiple "Windows 7 (Recovered)" options. Finally, I was able to fix the multiple desktop.ini files opening in Notepads simply by deleting the files themselves (they were living in C:\ProgramData\Microsoft\Windows\Start Menu). Windows also prompted me to empty my Recycle Bin because it said it was corrupted -- and that was fine with me.

I actually have a lot of ghosted files with the name pattern "._filename" on my machine -- this could be an artifact of having used Carbon Copy Cloner to mirror all the files on my old Bootcamp NTFS partition to a FAT32 partition on my external USB drive. I'm treating them as an annoyance for now, nothing more.

For the sake of completeness, here's all the steps I used to get my Bootcamp partition back (to the best of my memory -- I may have the wrong names for some things):

  1. Install OS X on internal HDD. Boot from it.

  2. Insert the Windows 7 DVD.

  3. Run Bootcamp Assistant and select the option to Install Windows. Partition the drive with the UI it presents. Wait for machine to reboot from DVD. (I think only the assistant can fix up the "hybrid" GPT/MBR properly.)

  4. From the top-level screen of the Windows 7 installer, first select the option to Install, but only to reformat the partition the Bootcamp assistant created from FAT32 to NTFS. (I think I had to go "Advanced Options" or something, when viewing the list of drives.) Then exit the install screen back to the top-level screen.

  5. From the top-level screen, select Repair your computer.

  6. A dialog will pop up and immediately pop up another window with a progress bar. When it is finished, it will prompt to "repair" the drive. Click No. Instead, proceed to the Next screen using the button.

  7. A new dialog will appear with several different options. Select the option to open a Command Prompt window.

  8. Use robocopy (with /mir and options like /nfl for speed) to copy files from the external drive to the (now-NTFS formatted) internal Bootcamp partition.

  9. Run bootrec /RebuildBcd. Do not use the /FixMbr or /FixBoot options! They will ruin everything!! Likely it will only find your Bootcamp partition (which is probably C:\). Choose "Yes".

  10. Reboot into your new Bootcamp partition.

Phew!!!

Share:
12,649

Related videos on Youtube

Shaggy Frog
Author by

Shaggy Frog

Updated on September 18, 2022

Comments

  • Shaggy Frog
    Shaggy Frog over 1 year

    My iMac was one of those suffering from a faulty Seagate HDD, and it failed a few weeks ago. In anticipation of getting it repaired at the Apple Store, I was able to clone the OS X partition easily using Carbon Copy Cloner, but was having a lot of pain cloning the Windows partition. In the end, I was merely able to copy all of the files off the drive onto an external drive with a FAT32 partition. Now that the hard drive has been swapped, I now want to restore my installation of Windows 7.

    The first thing I tried was to boot from the Windows 7 DVD, reformatting the (new, internal) Bootcamp partition and use robocopy (in a Command Window) to copy the files from the (external) USB drive to the internal drive. But this doesn't work, as I can't boot off the resulting drive. If I then boot from the Windows 7 DVD again and run the disk repair tool (or whatever it's called), it will "repair" my disk. This results in (A) having 3 different "Windows 7 (recovered)" options listed when I try to boot of the drive, the first two being non-functional but the third working, (B) the partition no longer readable by OS X (doesn't appear on Desktop, and shows up as a ghosted entry like "disk0s4"), (C) when the Windows partition eventually boots, it has four different "desktop.ini" files open in four different Notepads.

    Obviously I would like to have my Windows installation back, but not if it means (A) not being able to boot into Windows without manually selected the magical third option (B) not being able to read from the partition in OS X (C) always having tons of crap files open every time I log into my account.

    Is there any way to get my Windows 7 Bootcamp partition back, given all I have is a backup drive containing the files (not a block-cloned copy)?

    (I'm also happy to boot from a gparted/clonezilla Live USB install if those tools are appropriate.)

    • Karan
      Karan about 11 years
      The ghost entries from Win7's boot menu are easily removed, but I'm not sure how the unreadable partition problem can be fixed. It'll take more time of course, but I'd recommend you simply reinstall Win7 properly as before, then your apps and finally just copy back your data from the backup.
  • Shaggy Frog
    Shaggy Frog about 11 years
    Thanks for taking the time to write up your answer. Looks like bootmgr /RebuildBcd was the secret sauce in the end!