Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.)

share|improve this question
    
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. –  Karan May 1 '13 at 20:58
add comment

2 Answers

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|improve this answer
add comment

I'd start from scratch with a new Boot Camp setup in OS X and a fresh Windows installation. You can then restore your data files from the backup you made.

In addition to the minor irritations you've noted, there's a slim possibility that Windows has adjusted your hybrid MBR (a necessary part of a Boot Camp installation) in a way that could be extremely dangerous. I could diagnose this better if I could see the partitioning data on both the GPT and the MBR sides of your disk. You can get this from gdisk by typing p to view the main GPT partitions and then typing x followed by o to view the MBR partitions. (You'd then type q to quit from the program.) If you follow my earlier advice and do a fresh re-install of Windows by first setting up a new Boot Camp environment in OS X, there's no point to bothering with this, since the Boot Camp setup will replace the old hybrid MBR with a new one. If you decide you must keep your current Windows installation, though, verifying that the GPT and MBR setups are synchronized is worthwhile; even if the risk of a problem is low, the consequences if there is a problem are great. Also, do not run the gptsync program from rEFIt; if the type of problem I'm thinking of exists, doing so will make matters worse.

share|improve this answer
    
Thanks for taking the time to write up your answer. Looks like bootmgr /RebuildBcd was the secret sauce in the end! –  Shaggy Frog May 2 '13 at 5:58
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.