Syncing GPT with MBR?

Discussion in 'General Help' started by snowkid2themax, Jun 8, 2013.

Tags:
  1. snowkid2themax

    snowkid2themax

    Joined:
    Jan 12, 2011
    Messages:
    4
    Jun 8, 2013 at 6:06 PM #1
    snowkid2themax

    snowkid2themax

    Joined:
    Jan 12, 2011
    Messages:
    4
    Short Story:

    After resizing partitions on my I've ended up with a GPT table that is out of sync with the MBR. Is there any way to sync the GPT with the MBR and not the other way around (like gptsync)? I've looked into gdisk and the f recovery command, but it seems to suggest deleting partitions
    (I'd like to keep the data on both partitions in-tact if at all possible)


    Long Story:

    I originally had my hard drive partitioned with Windows 7 partition owning 250GB while OS X owned the rest. However, as I got more into PC gaming I decided to resize the partitions to grant Windows 7 more space. Considering that I didn't own an external hard drive large enough to back up my windows partition, I decided to truncate my OS X partition with GParted and grow my Windows partition within Windows 7 itself (because GParted gave me a warning that moving the partition within Linux would cause boot errors). I was able to expand the Windows 7 partition within windows and everything seemed to be hunky dory (I even added a considerable amount of data to this newly expanded partition). Upon rebooting a few days later, I found that the Windows 7 partition no longer booted. I realize now that modifying the partition within windows was probably a big mistake as windows only read the MBR (and thus the GPT partition table was left unchanged). Now the GPT displays this:
    Code (Text):

     #      Start LBA      End LBA  Type
     1             40       409639  EFI System (FAT)
     2         409640   1049763839  Mac OS X HFS+
     3     1436043264   1953523711  Basic Data
     
    While the MBR displays this:
    Code (Text):

     # A    Start LBA      End LBA  Type
     1              1       409639  ee  EFI Protective
     2         409640   1049763839  af  Mac OS X HFS+
     3 *   1049763840   1953523711  07  NTFS/HPFS
     
    The GPT thinks that there is a bunch of unallocated space, when in reality Windows 7 is already using this "unallocated" space. Is there any safe way to sync the GPT table with the MBR table?
     
  2. RehabMan

    RehabMan Moderator

    Joined:
    May 3, 2012
    Messages:
    123,732
    Mobo:
    Intel DH67BL
    CPU:
    Core i7-2600K
    Graphics:
    Intel HD 3000
    Mac:
    MacBook Air
    Mobile Phone:
    iOS
    Jun 9, 2013 at 4:00 PM #2
    RehabMan

    RehabMan Moderator

    Joined:
    May 3, 2012
    Messages:
    123,732
    Mobo:
    Intel DH67BL
    CPU:
    Core i7-2600K
    Graphics:
    Intel HD 3000
    Mac:
    MacBook Air
    Mobile Phone:
    iOS
    You can probably convert the partitions to "pure" GPT with gdisk using your MBR, since the MBR is the correct one at this point. You will have to read about the commands in gdisk to see how to do that. I've never run into the need to do what you now need to do, so I cannot tell you exactly how, but gdisk is very powerful and most certainly can do what you need.

    That said, you should make a backup now. NTFS from Windows, and HFS+ from from OS X. Because you never know what damage you may cause trying to fix this situation.

    With hybrid MBR/GPT, you should always do your edits with a utility that is hybrid aware (OS X Disk Utility) or do the edits on GPT, and use gptsync to re-create MBR from GPT. And almost always when moving things around like that you will end up having to do some repair of Windows \BOOT\BCD file using BCDEDIT to make Windows bootable. Best to plan up-front and not resize.
     

Share This Page