Scotch_Brawth

Q: Repairing Boot Camp after creating new partition

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)

Posted on Jul 26, 2012 11:28 PM

Close

Q: Repairing Boot Camp after creating new partition

  • All replies
  • Helpful answers

first Previous Page 8 of 102 last Next
  • by Christopher Murphy,

    Christopher Murphy Christopher Murphy Sep 25, 2012 9:26 PM in response to randalljn
    Level 3 (555 points)
    Sep 25, 2012 9:26 PM in response to randalljn

    OK so for whatever reason the name of the 4th GPT partition is "DOS_FAT_32_Untitled_3" which is weird. You can change it to something else if you want (I'm not sure it gets used for anything really) with gdisk using the c command and giving it a new name. Next you need to make a new hybrid MBR:

     

    r       [recovery menu]

    h       [create new hybrid MBR]

    2 3 4   [add partitions 2 3 and 4 to MBR]

    y       [place 0xEE partition as #1]

    <enter> [accept the default]

    n       [not bootable]

    <enter> [accept default]

    n       [not bootable]

    <enter> [accept default]

    y       [mark as bootable]

    w       [write changes to disk]

    y       [confirm you really want to do this]

  • by randalljn,

    randalljn randalljn Sep 25, 2012 9:45 PM in response to Christopher Murphy
    Level 1 (0 points)
    Sep 25, 2012 9:45 PM in response to Christopher Murphy

    Followed step by step and unlike before I see the windows partition in he boot picker. However when I select the windows partition it loads with "error loading operating system. " Is there a way for me to just get the data off the windows side so I can reformat? Thanks for all your help!

  • by Christopher Murphy,

    Christopher Murphy Christopher Murphy Sep 25, 2012 9:49 PM in response to randalljn
    Level 3 (555 points)
    Sep 25, 2012 9:49 PM in response to randalljn

    Does the volume mount in Mac OS X? You can extract the data on that side.

  • by nikdaquik,

    nikdaquik nikdaquik Sep 29, 2012 3:45 PM in response to Christopher Murphy
    Level 1 (0 points)
    Sep 29, 2012 3:45 PM in response to Christopher Murphy

    Hi Christopher Murphy,

     

    I've read and reread this thread and attempted to use gdisk to create a hybrid MBR so I could boot Windows 7 and Windows 8.  Unfortunately, I still can't seem to boot up into Windows (either version).

     

    sudo gpt -r -vv show disk0 returns this:

     

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

    gpt show: disk0: Suspicious 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  585937496      2  GPT part - 48465300-0000-11AA-AA11-00306543ECAC

      586347136    1269536      3  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC

      587616672       1632        

      587618304   95703040      4  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

      683321344  293451776      5  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

      976773120         15        

      976773135         32         Sec GPT table

      976773167          1         Sec GPT header

     

    I tried adding #s 4 and 5 to the MBR and set them both to be bootable, however OS X's startup manager doesn't "see" them when I hold option at startup.

    Do you have any suggestions on how to correct this? You seem extremely knowledgeable on this subject so any help would be very appreciated.

  • by Christopher Murphy,

    Christopher Murphy Christopher Murphy Sep 29, 2012 5:10 PM in response to nikdaquik
    Level 3 (555 points)
    Sep 29, 2012 5:10 PM in response to nikdaquik

    Only one MBR partition can be flagged as bootable. In all of my testing to date it doesn't matter which one is flagged as bootable, which tells me the CSM-BIOS will blindly execute the 440 bytes of bootstrap code in the first 440 bytes of the MBR. That code tells the CPU to jump elsewhere, and loads more code, irrespective of what partition is flagged as bootable. So remove the active flag on partition 4 and see what happens.

     

    Also consider posting the results of

    sudo fdisk /dev/disk0

  • by pendo,

    pendo pendo Sep 29, 2012 5:36 PM in response to Christopher Murphy
    Level 1 (0 points)
    Sep 29, 2012 5:36 PM in response to Christopher Murphy

    Hello Christopher Murphy,

     

    I had pm'ed you on another forum, but as I've found you here with more recent activity I thought I'd try this as well.

     

    Without going into the "what was I thinking" (really, _really_ should've known better)  I mananged to break boot camps ability to boot.  My setup isn't exactly stock either.  I run a 128GB ssd in the main bay, with a 500 GB regular hd in the superdrive bay (formatted case sensitive).  Late '08 macbook on 19,6,8.  Bootcamp originally was on ssd, but later moved to the older drive (via winclone I think...can't remember for sure). 

     

    So I shrink the case sensitive hfs+ on the spinning drive a bit and then used gparted to expand the boot camp partition, and...breakage.  As of right now, the drive that holds the boot camp partition has been removed and placed in an external enclosure (put a new ssd in the superdrive bay...ideally want to restore the previous boot camp into it)

     

     

    diskutil list

    /dev/disk0

       #:                       TYPE NAME                    SIZE       IDENTIFIER

       0:      GUID_partition_scheme                        *120.0 GB   disk0

       1:                        EFI                         209.7 MB   disk0s1

       2:       Microsoft Basic Data BOOTCAMP                119.8 GB   disk0s2

    /dev/disk1

       #:                       TYPE NAME                    SIZE       IDENTIFIER

       0:      GUID_partition_scheme                        *128.0 GB   disk1

       1:                        EFI                         209.7 MB   disk1s1

       2:                  Apple_HFS MacintoshSSD            127.7 GB   disk1s2

    /dev/disk2

       #:                       TYPE NAME                    SIZE       IDENTIFIER

       0:      GUID_partition_scheme                        *500.1 GB   disk2

       1:                        EFI                         209.7 MB   disk2s1

       2:                  Apple_HFS HDD                     352.7 GB   disk2s2

       3:       Microsoft Basic Data BOOTCAMP                101.9 GB   disk2s3

    sudo gpt -r -vv show disk2

    Password:

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

    gpt show: disk2: Suspicious MBR at sector 0

    gpt show: disk2: Pri GPT at sector 1

    gpt show: disk2: 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  688939952      2  GPT part - 48465300-0000-11AA-AA11-00306543ECAC

      689349592   88405032        

      777754624  199018496      3  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

      976773120         15        

      976773135         32         Sec GPT table

      976773167          1         Sec GPT header

    sudo fdisk /dev/disk2

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

    Signature: 0xAA55

             Starting       Ending

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

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

    1: EE 1023 254  63 - 1023 254  63 [         1 -     409639] <Unknown ID>

    2: AF 1023 254  63 - 1023 254  63 [    409640 -  688939952] HFS+       

    *3: 07 1023 254  63 - 1023 254  63 [ 777754624 -  199018496] HPFS/QNX/AUX

    4: 00    0   0   0 -    0   0   0 [         0 -          0] unused    

     

    Anyway to make this bootable again?  If not, since the partition is still otherwise accessible is there a way to move it over to a new bootcamp partition?

     

    Thanks in advance.  Your expertise on this matter is unbelievably thorough, and I feel very lucky to have found all that you've covered so far.

  • by nikdaquik,

    nikdaquik nikdaquik Sep 29, 2012 6:09 PM in response to Christopher Murphy
    Level 1 (0 points)
    Sep 29, 2012 6:09 PM in response to Christopher Murphy

    Ok, so I removed the flag on #4 and successfully booted to partition 5! It seems however that whichever partition contains the bootable flag is the only one that can boot.  That's what I'm seeing whenever I boot up to the OS X startup manager at least. Switching allowed the other to boot but not both.

     

    Here's the results of sudo fdisk /dev/disk0:

     

    Disk: /dev/disk0geometry: 60801/255/63 [976773168 sectors]

    Signature: 0xAA55

             Starting       Ending

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

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

    1: EE    0   0   2 - 1023 254  63 [         1 -  587618303] <Unknown ID>

    *2: 07 1023 254  63 - 1023 254  63 [ 587618304 -   95703040] HPFS/QNX/AUX

    3: 07 1023 254  63 - 1023 254  63 [ 683321344 -  293451776] HPFS/QNX/AUX

    4: 00    0   0   0 -    0   0   0 [         0 -          0] unused

  • by Christopher Murphy,

    Christopher Murphy Christopher Murphy Sep 29, 2012 6:12 PM in response to pendo
    Level 3 (555 points)
    Sep 29, 2012 6:12 PM in response to pendo

    So what's this large, 42GB, pile of free space between the Mac OS (partition 2), and Boot Camp (partition 3)?

     

    The GPT and MBR agree with each other, and the partition designated for Windows in the MBR has the active flag set. What do you get when you reboot with the option key, and choose the Windows option at the boot menu?

  • by Christopher Murphy,

    Christopher Murphy Christopher Murphy Sep 29, 2012 6:15 PM in response to pendo
    Level 3 (555 points)
    Sep 29, 2012 6:15 PM in response to pendo

    deleted because i was confused

  • by Christopher Murphy,

    Christopher Murphy Christopher Murphy Sep 29, 2012 6:24 PM in response to nikdaquik
    Level 3 (555 points)
    Sep 29, 2012 6:24 PM in response to nikdaquik

    I can't tell you how to dual-boot two Windows installations on Apple hardware. Apple's CSM provides one Windows option per disk, I've never seen it present two. I'm vaguely aware that the Windows bootloader can be configured to boot more than one copy of Windows. I would expect the Windows 8 bootloader to know how to boot Windows 7 and 8, but also it's so new as to possibly not be that well documented. I'm can't imagine whether the Windows 7 bootloader will know how to boot Windows 8 in addition to 7.

     

    Your alternative is to use fdisk from the command line to flag a different partition. I think that fdisk only lets one partition be flagged at one time. To edit in fdisk:

     

    sudo fdisk -e /dev/disk0

    ?      [this will get you the menu of options one of which is setting the boot/active flag]

  • by nikdaquik,

    nikdaquik nikdaquik Sep 29, 2012 6:31 PM in response to Christopher Murphy
    Level 1 (0 points)
    Sep 29, 2012 6:31 PM in response to Christopher Murphy

    Yeah I figured it wouldn't be too easy to do considering most people don't have a need for two Windows OS's on one machine. I'm going to look into the Windows 8 bootloader though because it would make sense for it to know how to boot Win7.

     

    As for the fdisk command, would that just change the bootable flag without having to create a new hybrid MBR each time?

  • by Christopher Murphy,

    Christopher Murphy Christopher Murphy Sep 29, 2012 6:44 PM in response to nikdaquik
    Level 3 (555 points)
    Sep 29, 2012 6:44 PM in response to nikdaquik

    fdisk is an MBR editor, so it edits the (hybrid) MBR that you already have. Fortunately the boot flag feature in fdisk is a toggle, so you just toggle a partition, write the change to disk, and then reboot. You don't have to enter in all of the information: partition#, ID, start sector, size, like you do when editing a partition.

     

    Just realise that when you add only GPT partitions 4 and 5 to the MBR, they become MBR partitions 2 and 3. So your choices will be to "flag 3" or to "flag 4" to set the flag. I just tested this and in fact only one partition can be set at a time. When I "flag 3" now partition 3 is marked bootable, and when I "flag 4" now partition 3 is not flag but partition 4 is.

  • by Christopher Murphy,

    Christopher Murphy Christopher Murphy Sep 29, 2012 6:45 PM in response to nikdaquik
    Level 3 (555 points)
    Sep 29, 2012 6:45 PM in response to nikdaquik

    Oh and when I said fdisk, I mean literally fdisk. Not "GPT fdisk" a.k.a. gdisk, which is a GPT partition editor.

  • by nikdaquik,

    nikdaquik nikdaquik Sep 29, 2012 7:14 PM in response to Christopher Murphy
    Level 1 (0 points)
    Sep 29, 2012 7:14 PM in response to Christopher Murphy

    Ok, I understand. I'm going to keep looking into the Windows 8 Bootloader option but I think I might even be able to write a script that performs fdisk for me.  Anyway, thanks so much! I really appreciate it!

  • by pendo,

    pendo pendo Sep 29, 2012 8:37 PM in response to Christopher Murphy
    Level 1 (0 points)
    Sep 29, 2012 8:37 PM in response to Christopher Murphy

    Hi, thanks for your reply.

     

    That's where I shrank the hfs+ partition so I could enlarge boot camp.

     

    When I press option, I am presented with 3 choices, one for rEFIt and two for windows.  I'm uncertain why I see two, but it's been that way for a while (possibly from when I moved it from the ssd many months ago).  One option says no operating system, and the other produces the rapid flashing cursor in the upper left.

first Previous Page 8 of 102 last Next