MacOS – Problem after cloning a Mac with dual boot

bootbootcampmacosssdwindows

I bought an SSD to upgrade my MacBookPro (late 2011) and have cloned the HDD with CloneZilla. I have dual boot with OS X Yosemite and Windows 7 Pro.

However, now on the SSD, I can't boot into the windows partition. It doesn't show when I hold the option key, and if I try to restart with the windows partition as the target disk, nothing loads.

I have created a Windows startup repair disk using the HDD Windows partition, but it says that the version is not compatible.

Here are the outputs from a few commands which may be useful:

$ diskutil list
/dev/disk0
   #:                       TYPE NAME                    SIZE   IDENTIFIER
   0:      GUID_partition_scheme                        *500.1 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                  Apple_HFS Macintosh HD            400.0 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
   4:       Microsoft Basic Data Windows HD              99.2 GB    disk0s4

also

sudo fdisk /dev/disk0
Disk: /dev/disk0    geometry: 60801/255/63 [976773168 sectors]
Signature: 0xAA55
     Starting       Ending
 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
------------------------------------------------------------------------
 1: EE    0   0   1 - 1023 254  63 [         1 -  976773167] <Unknown ID>
 2: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
 3: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
*4: 07    0   0   0 -    0   0   0 [         0 -          0] HPFS/QNX/AUX

and

sudo gpt -r -vv show disk0
gpt show: disk0: mediasize=500107862016; sectorsize=512; blocks=976773168
gpt show: disk0: Suspicious MBR at sector 0
gpt show: disk0: Malformed MBR at sector 0
gpt show: disk0: Pri GPT at sector 1
gpt show: disk0: Sec GPT at sector 976773167
      start       size  index  contents
          0          1         MBR
          1          1         Pri GPT header
          2         32         Pri GPT table
         34          6         
         40     409600      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
     409640  781249984      2  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
  781659624    1269536      3  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
  782929160        760         
  782929920  193843200      4  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
  976773120         15         
  976773135         32         Sec GPT table
  976773167          1         Sec GPT header

Can this be fixed so I can boot into the Windows partition?

Best Answer

Your MBR table is messed up. One way to fix this would be to download and use the gdisk command.

In a Terminal application window, enter the command sudo gdisk /dev/disk0. If prompted, enter your login password. Next, enter the following commands. (If the line is blank, hit the return key to use the default.)

r
h
2 3 4
y

n

n

y
o
w
y

An example of what to expect is shown below. Some values, that may be different from what you will see, have been replaced with X's.

GPT fdisk (gdisk) version 1.0.0

Warning: Devices opened with shared lock will not have their
partition table automatically reloaded!
Partition table scan:
  MBR: hybrid
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with hybrid MBR; using GPT.

Command (? for help): r

Recovery/transformation command (? for help): h

WARNING! Hybrid MBRs are flaky and dangerous! If you decide not to use one,
just hit the Enter key at the below prompt and your MBR partition table will
be untouched.

Type from one to three GPT partition numbers, separated by spaces, to be
added to the hybrid MBR, in sequence: 2 3 4
Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? (Y/N): y

Creating entry for GPT partition #2 (MBR partition #2)
Enter an MBR hex code (default AF): 
Set the bootable flag? (Y/N): n

Creating entry for GPT partition #3 (MBR partition #3)
Enter an MBR hex code (default AB): 
Set the bootable flag? (Y/N): n

Creating entry for GPT partition #4 (MBR partition #4)
Enter an MBR hex code (default 07): 
Set the bootable flag? (Y/N): y

Recovery/transformation command (? for help): o

Disk size is 976773168 sectors (XXX.X GiB)
MBR disk identifier: 0xXXXXXXXX
MBR partitions:

Number  Boot  Start Sector   End Sector   Status      Code
   1                     1       409639   primary     0xEE
   2                409640    781659623   primary     0xAF
   3             781659624    782929159   primary     0xAB
   4      *      782929920    976773119   primary     0x07

Recovery/transformation command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/disk0.
Warning: Devices opened with shared lock will not have their
partition table automatically reloaded!
Warning: The kernel may continue to use old or deleted partitions.
You should reboot or remove the drive.
The operation has completed successfully.

If after entering the o command, the values displayed do not match what is shown above, then a mistake has been made. In this case, enter an q instead of w to quit without making any changes.

If successful, then the output of sudo fdisk /dev/disk0 should be similar to what is shown below.

Disk: /dev/disk0    geometry: 60801/255/63 [976773168 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 254  63 [    409640 -  781249984] HFS+        
 3: AB 1023 254  63 - 1023 254  63 [ 781659624 -    1269536] Darwin Boot 
*4: 07 1023 254  63 - 1023 254  63 [ 782929920 -  193843200] HPFS/QNX/AUX

Note: You may need to restart your Mac after using the gdisk command.