1 2 3 Previous Next 1,377 Replies Latest reply: Jul 13, 2014 9:50 PM by kemaltalen
Scotch_Brawth Level 3 Level 3 (815 points)

I'm running OS X 10.8 and Windows 7 x64 Pro.

 

After properly setting up Boot Camp to dual-boot Windows on my Mac mini, I decided to test whether or not it was true that creating another partition (a data partition for OS X) would interfere with Boot Camp.  Wikipedia claims it does interfere but without citing a source, whilst the Boot Camp documentation itself only specifies that the disk must be a single partition _prior_ to setup - there's no mention of whether the disk must be _kept_ that way afterwards.

 

I opened Disk Utility, reduced the size of my OS X parition from 420GB to 80GB, and created a new partition in the unallocated space.  Here's how it looks now:

/___sbsstatic___/migration-images/190/19047693-1.png

When I attempted to proceed with the process, I did receive a warning that doing this (and I quote), "may" cause problems with Boot Camp.  Seeing as it was inconclusive, I thought I'd give it a shot - nothing ventured…

 

Of course, it borked Boot Camp, otherwise I wouldn't be posting here.  Whilst OS X boots just fine, the Boot Camp partition now no longer shows up in the Startup Manager, though it does in the Startup Disk prefPane.  If I do attempt to boot into Boot Camp, I receive the following message on a black screen:

No bootable device --- insert boot disk and press any key

The advice given to someone who had this same problem was, "fix your damaged Boot Camp volume."  But I'm at a loss as to how to do that.

 

So, anyone know how to proceed now so that I can keep my partitions as is, whilst fully restoring normal Boot Camp functionality?


Mac mini (Mid 2011), Mac OS X (10.7.4)
  • 1. Re: Repairing Boot Camp after creating new partition
    Csound1 Level 8 Level 8 (35,465 points)

    Restore your disk to a single OSX partition and use Boot Camp to create a partition for Win7 or 8, XP is not supported on Mountain Lion, or Lion.

  • 2. Re: Repairing Boot Camp after creating new partition
    Christopher Murphy Level 3 Level 3 (525 points)

    Yes I know how to fix this without starting over from scratch, but it requires committment to the command line and most people turn into wimps and bail out. So unless you commit to the process I'm not going to put in the investment. In the meantime you can provide the output from the following to comfirm/deny what I think is the likely problem and solution:

     

    sudo gpt -r -vv show disk0

    sudo fdisk /dev/disk0

     

    These are read only commands, no modification to the disk is made.

  • 3. Re: Repairing Boot Camp after creating new partition
    dalstott Level 4 Level 4 (2,530 points)

    The easiest solution would be to recover the Boot Camp partition with your Winclone image backup.

    If you haven't done this then consider doing it after things are working correctly. It can save a lot of inconvenience, pain, and suffering.

     

    http://twocanoes.com/winclone.php

  • 4. Re: Repairing Boot Camp after creating new partition
    Christopher Murphy Level 3 Level 3 (525 points)

    Winclone can't help in this case. Even if it backs up, and can restore both the MBR and GPT, he's already altered the GPT by resizing/splitting a Mac OS partition. What's happened is Disk Utility shouldn't merely warn, it should have disallowed this because while it looks like he has only three partitions, he actually has five:

     

    EFI System, Mac HD, Recovery HD, Internal Storage, Bootcamp. Two of those are hidden. Five partitions. MBR can only hold four. So with GUI tools, he's actually hosed. He'll have to use something like gdisk to create a new hybrid MBR, stuffing GPT partitions 1-4 into MBR partition 1. And then he can put Bootcamp, GPT partition 5, into MBR partition 2 and mark it bootable. Then his computer will boot both systems again.

     

    But that's my speculation until I see both partition maps.

  • 5. Re: Repairing Boot Camp after creating new partition
    Scotch_Brawth Level 3 Level 3 (815 points)

    Hi,

     

    @Christopher Murphy:

     

    Okay, you seem confident.  Let's give this a shot.  I use the command-line myself for the odd thing, so I'll try not to bail.

     

    Results of the "sudo gpt -r -vv show disk0" command:

    gpt show: disk0: mediasize=500107862016; sectorsize=512; blocks=976773168

    gpt show: disk0: PMBR 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         PMBR

              1          1         Pri GPT header

              2         32         Pri GPT table

             34          6        

             40     409600      1  GPT part - REDACTED UUID

         409640  156303528      2  GPT part - REDACTED UUID

      156713168    1269536      3  GPT part - REDACTED UUID

      157982704  659841040      4  GPT part - REDACTED UUID

      817823744     262144        

      818085888  158687232      5  GPT part - REDACTED UUID

      976773120         15        

      976773135         32         Sec GPT table

      976773167          1         Sec GPT header

    Results of the "sudo fdisk /dev/disk0" command:

    Disk: /dev/disk0          geometry: 60801/255/63 [976773168 sectors]

             Starting       EndingSignature: 0xAA55

    #: id  cyl  hd sec -  cyl  hd sec [     start -       size]

    ------------------------------------------------------------------------

    1: EE 1023 254  63 - 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: 00    0   0   0 -    0   0   0 [         0 -          0] unused  

    Does this indicate a fix is possible?

  • 6. Re: Repairing Boot Camp after creating new partition
    Christopher Murphy Level 3 Level 3 (525 points)

    The GUIDs you redacted are not private data, they are partition type GUIDs, However based on the partition start, sizes, and sequence, I'm reasonably certain the GPT is intact. The MBR has been totally obliterated, however. In my opinion this constitutes severe data loss, and I think I'll report this in the Apple dev bug reporter. It should be disallowed, or at least not be so vague as to what will happen and give you the option of effectively losing access to your Windows partition.

     

    Yes a repair is possible. Yes it's easy. If you can format those results with a monospaced font, you can do this.

     

    1. Download the Mac OS X binary of gdisk, a.k.a. GPT fdisk and install it.

    2. Tell me how you formatted your partition results with monospaced font so I can more clearly write out the command line sequence for you to follow to create a new hybrid MBR to fix this problem.

    3. Tell me the build number of Mac OS X from the About this Mac Window.

  • 7. Re: Repairing Boot Camp after creating new partition
    Scotch_Brawth Level 3 Level 3 (815 points)

    The GUIDs you redacted are not private data, they are partition type GUIDs,

    Ah, I mistook them for UUIDs.  Thanks for pointing that out.  Interesting link

    However based on the partition start, sizes, and sequence, I'm reasonably certain the GPT is intact. The MBR has been totally obliterated, however. In my opinion this constitutes severe data loss, and I think I'll report this in the Apple dev bug reporter. It should be disallowed, or at least not be so vague as to what will happen and give you the option of effectively losing access to your Windows partition.

    At the very least, I can use this thread to back up the citation-less assertion on Wikipedia.

    Yes a repair is possible. Yes it's easy.

    Praise Jebus.

    If you can format those results with a monospaced font, you can do this.

     

    1. Download the Mac OS X binary of gdisk, a.k.a. GPT fdisk and install it.

    Shall be done.

    2. Tell me how you formatted your partition results with monospaced font so I can more clearly write out the command line sequence for you to follow to create a new hybrid MBR to fix this problem.

    LOL.  It's simple, you just have to be in the Advanced Editor instead of the basic editor given at the foot of the thread - there's a link to it to the top right of the Reply text box.  Then just choose Andale Mono from the Font family drop-down.

    3. Tell me the build number of Mac OS X from the About this Mac Window.

    12A269

     

    By the way, I was a little nervous about the use of a Hybrid MBR to fix this, because the gdisk documentation specifically cautions against it.  But then it points out that this is what Boot Camp uses anyway!  So, what's next?

  • 8. Re: Repairing Boot Camp after creating new partition
    Christopher Murphy Level 3 Level 3 (525 points)

    Please confirm the GUID for the 5th partition (under index) is EBD0A0A2-B9E5-4433-87C0-68B6B72699C7.

    Please confirm the 5th entry for disk0 is BOOTCAMP with this command:

    diskutil list

  • 9. Re: Repairing Boot Camp after creating new partition
    Scotch_Brawth Level 3 Level 3 (815 points)

    I can confirm that GUID is assigned to the 5th partition, yes.  And the entry for partition 5 in diskutil list is:

     

    5:       Microsoft Basic Data BOOTCAMP                81.2 GB    disk0s5

    So, that's another yes.

  • 10. Re: Repairing Boot Camp after creating new partition
    Christopher Murphy Level 3 Level 3 (525 points)

    sudo gdisk /dev/disk0

     

    If you get any error messages at this point, report the error messages, don't proceed further.

     

    You're now in gdisk interactive mode. Menus/commands are single characters followed by return/enter. So type ? and <enter> and you'll get the main menu listing commands. Type p <enter> and it will print (display) the current GPT. Since you have 5 GPT entries, you can't use a 1 for 1 GPT to MBR scheme like Apple does. The following suggestion is safe, but all hybrid MBRs are non-standard inventions, and therefore I can't tell you how Boot Camp Assistant or Disk Utility will react to this hybrid MBR should you decide to make changes later. What I can tell you is Windows, Linux, and Mac OS X themselves have no problem with this MBR scheme.

     

    r <enter>        go to the recovery & transformation menu

    h <enter>        create a new hybrid MBR

    5 <enter>        add partion 5 to the MBR

    <enter>          accept the default MBR hex code of 07

    y <enter>        set the bootable flag

    n <enter>        do not protect more partitions

    o < enter>       print (display) the MBR

     

    You should have two entries. One type EE, one 07, with the 07 entry marked with * under Boot. If you don't, report back. If you do, write out the update partition information, and hope  a power failure doesn't occur for the next few seconds...

     

    w <enter>     write partition table to disk

     

    reboot. hold down option - you should be able to boot into either Mac HD, Recovery HD, or Windows.

     

    I just tested this same five partition GPT and 2 partition MBR on a working system and the instructions above worked.

     

    Note, so long as CSM-BIOS and thus MBR are required for Boot Camp instead of EFI booting Windows, we're stuck with flaky MBR problems, as well as the 2TB disk limitation for Windows boot disks.

     

    Also, I filed bug ID 11980880 at bugreport.apple.com and referenced this thread.

  • 11. Re: Repairing Boot Camp after creating new partition
    Christopher Murphy Level 3 Level 3 (525 points)

    BTW if you want, before the w command to write out the partition to disk, you can do

    o <enter>

    p <enter>

    And report those results first, leaving gdisk running...the modified partition tables are in memory only and nothing can be hurt by leaving it running in this state. But you do want to reboot shortly after writing this out to disk.

  • 12. Re: Repairing Boot Camp after creating new partition
    Scotch_Brawth Level 3 Level 3 (815 points)

    Okay,  I've reached a question in gdisk that I don't know how to respond to.  Here's what I've done so far:

    sudo gdisk /dev/disk0

     

    […]


    Found valid GPT with protective MBR; using GPT.

     

    Command: r <enter>

     

    Recovery/transformation command: h <enter>

     

    Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? (Y/N):

    This isn't a question/answer pair you cover in your walkthrough.  How do I answer?

  • 13. Re: Repairing Boot Camp after creating new partition
    Christopher Murphy Level 3 Level 3 (525 points)

    Oops. Forgot that one. Answer that yes.

  • 14. Re: Repairing Boot Camp after creating new partition
    Scotch_Brawth Level 3 Level 3 (815 points)

    <insert vulgar celebratory exclamation here>

     

    I am now, as I write this, looking at my Mac mini booted into Windows 7 x64.

     

    You, sir, deserve a barrowload of thanks.  I hope you will be satisfied with receiving as many points as I can give you on this thread.

     

    Man, this walkthrough should be turned into an official Apple KB document and you, sir, should be employed by them to fix Boot Camp.

     

    I sincerely thank you, and hope you have an excellent weekend!

     

    Cheers

1 2 3 Previous Next