Previous 1 3 4 5 6 7 Next 129 Replies Latest reply: Jun 2, 2013 3:21 PM by Christopher Murphy Go to original post
  • Christopher Murphy Level 3 (555 points)

    Download and install GPT fdisk from sourceforge.


    Each line followed by a return/enter:


    sudo gdisk /dev/disk0


    Confirm partition 4 starts with LBA 1071992832, and if so:


    2 3 4

    From here accept the default MBR hex code for each partition. Do not set the boot flag except for partition 4.




    w writes out the two partitions to disk. q will quit without making any changes. If you want your work proof read before entering w, copy past everything everything following sudo gdisk /dev/disk0 into the forum; just leave gdisk running in the meantime (hide the Terminal window if you want).

  • Christopher Murphy Level 3 (555 points)

    If you do want a proof reading, actually it's easier if right before the w command you enter:


    And just copy paste those results, keeping gdisk running at its own prompt.

  • Ricardo Ramalho Level 1 (0 points)



    I think this is it...


    mouse:~ rramalho$ sudo gdisk /dev/disk0


    GPT fdisk (gdisk) version 0.8.5


    Partition table scan:

      MBR: protective

      BSD: not present

      APM: not present

      GPT: present


    Found valid GPT with protective MBR; using GPT.


    Command (? for help): p

    Disk /dev/disk0: 1465149168 sectors, 698.6 GiB

    Logical sector size: 512 bytes

    Disk identifier (GUID): 00001162-5B29-0000-B27C-0000223B0000

    Partition table holds up to 128 entries

    First usable sector is 34, last usable sector is 1465149134

    Partitions will be aligned on 8-sector boundaries

    Total free space is 2893 sectors (1.4 MiB)


    Number  Start (sector)    End (sector)  Size       Code  Name

       1              40          409639   200.0 MiB   EF00  EFI system partition

       2          409640      1070722151   510.4 GiB   AF00  Customer

       3      1070722152      1071991687   619.9 MiB   AB00  Recovery HD

       4      1071992832      1465147391   187.5 GiB   AF00  BOOTCAMP


    Command (? for help): t

    Partition number (1-4): 4

    Current type is 'Apple HFS/HFS+'

    Hex code or GUID (L to show codes, Enter = AF00): 0700

    Changed type of partition to 'Microsoft basic data'


    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): ?

    b    use backup GPT header (rebuilding main)

    c    load backup partition table from disk (rebuilding main)

    d    use main GPT header (rebuilding backup)

    e    load main partition table from disk (rebuilding backup)

    f    load MBR and build fresh GPT from it

    g    convert GPT into MBR and exit

    h    make hybrid MBR

    i    show detailed information on a partition

    l    load partition data from a backup file

    m    return to main menu

    o    print protective MBR data

    p    print the partition table

    q    quit without saving changes

    t    transform BSD disklabel partition

    v    verify disk

    w    write table to disk and exit

    x    extra functionality (experts only)

    ?    print this menu


    Recovery/transformation command (? for help):


    May I just press W? :-/



  • Christopher Murphy Level 3 (555 points)


  • Ricardo Ramalho Level 1 (0 points)



    It's working again! Perfect perfect!!


    I dunno what happened but it's working again and I learned something new! Cool!



  • Christopher Murphy Level 3 (555 points)

    Very good.


    And very strange how the partition type GUID would flip from NTFS to HFS+ like that. It's absolutely completely non-random. Normally this would only happen in the course of formatting (erasing) a partition into a volume. Further, the hybrid MBR (I'm assuming there was one or Windows would not previously have been bootable) was blown away by a PMBR which is primarily the reason why Windows was not bootable (since the GPT is ignored by CSM-BIOS and Windows, it wouldn't have cared that the GUID was wrong - but it needed to be fixed because a Mac OS disk utility would have recognized that partition has HFS+ and might have severely damaged the NTFS volume within in a repair attempt).


    This is all very alarming to me.

  • Ricardo Ramalho Level 1 (0 points)

    Some bug in the mountain lion installer probably and a very big bug indeed...

  • Christopher Murphy Level 3 (555 points)

    We don't know it's the installer. It could be diskutil (the core of Disk Utility). We actually don't even know it's a bug in code. It could be a bug in the logic of the installer package script. And it's not happening to everyone, or even a majority. So even if there's a bug, there's also a trigger, and not everyone has that trigger.

  • tubtubde Level 1 (0 points)

    First, thanks Christopher Murphy. Your instructions helped me to resolve my Boot Camp boot issue.


    But here an awkward heads up for the problems I discovered:

    After installing Mountain Lion I couldn't boot into Windows 7 any more. So I tried to boot from the DVD which worked fine. After that it was possible to boot into Boot Camp when I have plugged in the external monitor.


    I selected my Boot Camp partition in the startup menu and when the monitor wasn't plugged in, it displayed only a black screen and the fans were going wild.


    Rewriting the MBR as you suggested did the trick! Thanks.

  • TheBoz2 Level 1 (0 points)

    So I am seeing the same thing.  I just this morning installed Lion from the App Store, and I not longer have access to my Windows 7 OS.


    Mac Book Pro - Uni Body

    200 Gig Drive

    50 Gig Apple

    150 Gig Windows

    Boot Camped Windows 7



    sudo gpt -r -vv show disk0


    gpt show: disk0: mediasize=200049647616; sectorsize=512; blocks=390721968
    gpt show: disk0: Suspicious MBR at sector 0
    gpt show: disk0: Pri GPT at sector 1
    gpt show: disk0: Sec GPT at sector 390721967
          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  103590064      2  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
      103999704    1269544      3  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
      105269248  285452288      4  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
      390721536        399         
      390721935         32         Sec GPT table
      390721967          1         Sec GPT header


    sudo fdisk /dev/disk0


    Disk: /dev/disk0     geometry: 24321/255/63 [390721968 sectors]
    Signature: 0xAA55
             Starting       Ending
     #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
     1: EE 1023 254  63 - 1023 254  63 [         1 -     409639]
     2: AF 1023 254  63 - 1023 254  63 [    409640 -  103590064] HFS+        
     3: AB 1023 254  63 - 1023 254  63 [ 103999704 -    1269544] Darwin Boot 
     4: 0C 1023 254  63 - 1023 254  63 [ 105269248 -  285452288] Win95 FAT32L


    diskutil list /dev/disk0


       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *200.0 GB   disk0
       1:                        EFI                         209.7 MB   disk0s1
       2:                  Apple_HFS MAC                     53.0 GB    disk0s2
       3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
       4:       Microsoft Basic Data                         146.2 GB   disk0s4


    Like a dumb *** I did not back up everything before I installed lion.  So there are files I would really like to recover from this drive.

  • kc5mhb Level 1 (0 points)

    Do you still see the bootcamp partition when you boot to lion?  If you can see the bootcamp, my suggestion would be Winclone to backup the partition and then iPartition as a recovery process.  It worked for me, but its cost me about $70 total for both products.  My guess is the Apple_Boot Recovery HD moved my bootcamp from position 3 to position 4.  This is what mine looks like after iPartition:


       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *2.5 TB     disk0
       1:                        EFI                         209.7 MB   disk0s1
       2:       Microsoft Basic Data BOOTCAMP                512.5 GB   disk0s2
       3:                  Apple_HFS Lion                    2.0 TB     disk0s3
       4:                 Apple_Boot Recovery HD             650.0 MB   disk0s4


    Look at my previous post for the rest of the terminal commands I ran.

  • TheBoz2 Level 1 (0 points)

    If I am using Disk Utility, I will see disk0s4.  I cannot Mount the drive, or repair it.  I am going to try the Microsoft Windows 7 CD and see if I can get it to do something with that.  My DVD drive crapped on my like a year ago, and I have just been using USB ever since, so toss one more log in the fire for me.


    Not my best day today.

  • TheBoz2 Level 1 (0 points)

    I am going to just remove the partition and restart the bootcamp process and see what happens.  I have a back up that is good enough for me.


    I have wasted an entire day on this, and apple support was no help at all.  This is the worst thing apple can do to people, I guess they are really trying to tell everyone that they hate microsoft.


    God **** you Apple.  The worst part is the Apple support guy was like it sounds like your windows install is messed up.  I was like everything was working just fine until I let Apple update my OS to ML.  It has been fail since then.


    So for anyone else be sure to back up your windows OS before you install ML it will trash your windows setup.


    Also as another FYI, in Boot Camp Assistant, it will allow me to remove my Windows 7 install.

  • paulfromkensington gardens Level 1 (0 points)

    I have another unhappy client, who had Win7/64 bootcamped, then Upgraded to Mountain Lion via Apple Store upgrade.. I've just spent a whole lot of time going thru all the GPT editting and tweaking, to no avail .

    I Can 'See"there is a BOOTCAMP Partition which is the correct size, but depending on what you're using, its MSDOS FAT or NTFS. It has an NTFS MBR, but is not mountable, not bootable.

    Thanks Apple .. .. now about to commence Bootcam remove and fresh install...

  • kc5mhb Level 1 (0 points)

    Look, I'm running a 2.5TB drive and the same thing happened to me.  See my previous posts as to what worked for me, I think it'll work for you.  I saw the iPartition tip on another site post of someone having the same issues.  If your data is that important ( mine was) it will pay for itself in the long run to at least get Winclone ($20 from twocanoes)  Yeah the iPartition was around $47 but again my data was worth it.  I tried to delete and recreate the BC partition and when I got to the windows install it said it couldn't install on any partitions.  That is why I purchased iPartition.   Mountain Lion installer did some nasty things to the partition table and messed up the BC partition, but until they figure it out and fix it, you do what you have to do.  My BC partition has all of my windows games that I've purchased in the past 3 years with all of my saves and rankings.  Losing that would not have been fun.


    By the way, the Mountain Lion Installer can be copied to an external drive for safe keeping.  Its located in the Apps folder but you cannot copy it directly.  Move it to the trash can then drag it out of the trash can to your external drive.

Previous 1 3 4 5 6 7 Next