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 75 of 102 last Next
  • by DHughes01,

    DHughes01 DHughes01 Feb 26, 2014 2:15 PM in response to Scotch_Brawth
    Level 1 (0 points)
    Feb 26, 2014 2:15 PM in response to Scotch_Brawth

    Hi everyone,

     

    First off, thanks to everyone for their contributions to this post.  I foolishly repartitioned my OS X drive and obliterated my MBR.  This post helped me recover it.  What I was trying to do was set up three partitions on my Mac - one for OS X Mavericks, one for Bootcamp (Windows 7 Professional) and one as a shared drive so I can access my documents, music, videos, and pictures from either OS.  After reading several posts on here, I tried creating a hybrid MBR (using gdisk) with partitions 4 and 5 included, but the system won't let me.  When I get to the step where it creates an entry for partition #4 (MBR hex code 07, no bootable flag), it skips creating the entry for partition #5 and goes straight to "unused partition space(s) found..."  What am I doing wrong?  I've pasted the info from my terminal below:

     

    Last login: Wed Feb 26 13:53:08 on ttys000

    DGH-LAPTOP:~ admin$ sudo gdisk /dev/disk0

    Password:

    GPT fdisk (gdisk) version 0.8.9

     

    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: 4 5

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

     

    Creating entry for GPT partition #4 (MBR partition #2)

    Enter an MBR hex code (default 07):

    Set the bootable flag? (Y/N): y

     

    NOTE: Here's where it deviates. Instead of saying "Creating entry for GPT partition #5..." (as I assume it should) it skips past that step every time. I tried listing the partitions as "5 4" instead of "4 5" and it did the opposite (created 5 and skipped 4).  Am I doing something wrong?

     

    Unused partition space(s) found. Use one to protect more partitions? (Y/N): n

     

    Recovery/transformation command (? for help): o

     

    Disk size is 977105060 sectors (465.9 GiB)

    MBR disk identifier: 0xE8D38E1B

    MBR partitions:

     

    Number  Boot  Start Sector   End Sector   Status      Code

       1                     1    388397927   primary     0xEE

       2      *      388397928    587413503   primary     0x07

     

    Recovery/transformation command (? for help): q

     

    Here's some additional information from Terminal that may be useful:

     

    Last login: Wed Feb 26 17:06:07 on ttys000

    DGH-LAPTOP:~ admin$ sudo gpt -r -vv show disk0

    Password:

    gpt show: disk0: mediasize=500277790720; sectorsize=512; blocks=977105060

    gpt show: disk0: Suspicious MBR at sector 0

    gpt show: disk0: Pri GPT at sector 1

    gpt show: disk0: Sec GPT at sector 977105059

          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  386718744      2  GPT part - 48465300-0000-11AA-AA11-00306543ECAC

      387128384    1269544      3  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC

      388397928  199015576      4  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

      587413504  389691523      5  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

      977105027         32         Sec GPT table

      977105059          1         Sec GPT header

    DGH-LAPTOP:~ admin$ sudo fdisk /dev/disk0

    Disk: /dev/disk0    geometry: 60821/255/63 [977105060 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 1023 254  63 - 1023 254  63 [    409640 -  386718744] HFS+       

    3: AB 1023 254  63 - 1023 254  63 [ 387128384 -    1269544] Darwin Boot

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

    DGH-LAPTOP:~ admin$ diskutil list

    /dev/disk0

       #:                       TYPE NAME                    SIZE       IDENTIFIER

       0:      GUID_partition_scheme                        *500.3 GB   disk0

       1:                        EFI EFI                     209.7 MB   disk0s1

       2:                  Apple_HFS Macintosh HD            198.0 GB   disk0s2

       3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3

       4:       Microsoft Basic Data                         101.9 GB   disk0s4

       5:       Microsoft Basic Data                         199.5 GB   disk0s5

    DGH-LAPTOP:~ admin$

  • by Number88,

    Number88 Number88 Feb 26, 2014 2:21 PM in response to DHughes01
    Level 3 (750 points)
    Feb 26, 2014 2:21 PM in response to DHughes01

    What happens if you answer Y to

    Unused partition space(s) found. Use one to protect more partitions? (Y/N):

  • by DHughes01,

    DHughes01 DHughes01 Feb 26, 2014 2:31 PM in response to Number88
    Level 1 (0 points)
    Feb 26, 2014 2:31 PM in response to Number88

    The interesting thing about that is that I created the partitions using "add a new partition" in gdisk (instead of through Disk Utility's partition tool) so I could specify a start and end sector number to prevent there from being unused space so the fact that I'm getting a message about unused space has me puzzled.  That said, here's what happens when I choose "y":

     

    Unused partition space(s) found. Use one to protect more partitions? (Y/N): y

    Note: Default is 0xEE, but this may confuse Mac OS X.

    Enter an MBR hex code (default EE):

     

    Recovery/transformation command (? for help): o

     

    Disk size is 977105060 sectors (465.9 GiB)

    MBR disk identifier: 0xE8D38E1B

    MBR partitions:

     

    Number  Boot  Start Sector   End Sector   Status      Code

       1                     1    388397927   primary     0xEE

       2             388397928    587413503   primary     0x07

       4             587413504    977105059   primary     0xEE

     

    Recovery/transformation command (? for help):

     

    I'm very much a newbie as far as MBRs are concerned so naturally I'm quite weary of confirming the changes with the "w" (write table to disk & exit) command to see what happens.  But my guess is that because I'm seeing 1, 2, and 4 instead of just 1 and 2, that my shared partition will end up not being added to the hybrid MBR and therefore I won't see it in Windows.  But I don't know for sure.

  • by Number88,

    Number88 Number88 Feb 26, 2014 2:39 PM in response to DHughes01
    Level 3 (750 points)
    Feb 26, 2014 2:39 PM in response to DHughes01

    This isn't something I've tried before. Changes like this will be over-written with subsequent OSX upgrades and other things too, rendering Windows unbootable again.

    Having said that, in the example above you have accepted the default partition type EE for the last partition. Two partitions of type EE on the same disk is not a particularly good thing to have.

    I might try entering "07" (without quotes) at that point then press enter. If it asks you if you want to make it bootable answer N.

    Then you can write the changes to disk with a "w".

  • by DHughes01,

    DHughes01 DHughes01 Feb 26, 2014 3:05 PM in response to Number88
    Level 1 (0 points)
    Feb 26, 2014 3:05 PM in response to Number88

    Thanks for the tip.  Last night I used WinClone to make an image of my BOOTCAMP partition.  Once I've restored the image, I'll try your suggestion and let you know how it turned out.

  • by Number88,

    Number88 Number88 Feb 26, 2014 3:11 PM in response to DHughes01
    Level 3 (750 points)
    Feb 26, 2014 3:11 PM in response to DHughes01

    Ok, but I should tell you that it's not an ideal setup. It is likely to lead to problems in the future.

    It would be much easier to use an external disk as a shared drive.

  • by DHughes01,

    DHughes01 DHughes01 Feb 26, 2014 3:49 PM in response to Scotch_Brawth
    Level 1 (0 points)
    Feb 26, 2014 3:49 PM in response to Scotch_Brawth

    Duly noted, but I can't bear the thought of having to lug around an external drive all the time, not to mention I have an SSD installed as an internal drive for speed purposes and I hate to lose some of that speed saving to a non-SSD.  (That said, for safety purposes, I will be backing up my Winclone image and my regular files to a home network drive regularly.)

     

    At one point I considered wiping out the recovery drive so that I could simply have 4 normal partitions without the need of a custom-configured MBR.  But I don't like not having a built-in way to repair the Mac OS should something go haywire.  My understanding is that four is the maximum number of partitions that an MBR can hold without having to tinker around with stuff the way I'm trying to do now. 

     

    I wonder if I could save the recovery drive as an image and make a bootable CD out of it, then set the computer up with just 4 partitions: the EFI partition, Mac OS X, Windows, and a shared partition.  Hmm....

  • by Number88,

    Number88 Number88 Feb 26, 2014 3:57 PM in response to DHughes01
    Level 3 (750 points)
    Feb 26, 2014 3:57 PM in response to DHughes01

    I have done something similar in the past creating a USB using the OSX installer image rather than the recovery partition. That would need to be downloaded from Apple and subsequently installed on a USB (assuming your Mac can boot from a USB).

    I think it may depend on how old your Mac is and what version of OSX it came with (but not 100% sure on that).

  • by Christopher Murphy,

    Christopher Murphy Christopher Murphy Feb 26, 2014 6:31 PM in response to DHughes01
    Level 3 (555 points)
    Feb 26, 2014 6:31 PM in response to DHughes01

    When I get to the step where it creates an entry for partition #4 (MBR hex code 07, no bootable flag), it skips creating the entry for partition #5 and goes straight to "unused partition space(s) found..."  What am I doing wrong?

     

    Looks like a new bug in 0.8.9 because I can reproduce it. If I revert to 0.8.8 it works as expected. I've reported it to the developer.

  • by Christopher Murphy,

    Christopher Murphy Christopher Murphy Feb 26, 2014 6:37 PM in response to DHughes01
    Level 3 (555 points)
    Feb 26, 2014 6:37 PM in response to DHughes01

    Also, 5+ partitions in the GPT means you can't have a GPT and MBR that are sync'd. This currently invites certain Apple utilities to "repair" them without notice, mainly this is Disk Utility but also includes the OS Installer. So far minor updates haven't caused this behavior, that I'm aware of, but even that could happen. The "repair" replaces the hybrid MBR with a protective MBR which renders the non-OS X operating system unbootable. So just make sure you're keeping backups - it's not like it should just vanish in normal use. But you'll always wonder.

  • by Number88,

    Number88 Number88 Feb 27, 2014 6:58 AM in response to Christopher Murphy
    Level 3 (750 points)
    Feb 27, 2014 6:58 AM in response to Christopher Murphy

    Thanks for clearing that up about the 0.8.9 bug.

    DHughes01 is only including partitions 1,4 & 5 in the hybrid MBR (excluding 2 & 3).

    Still not ideal though.

  • by DHughes01,

    DHughes01 DHughes01 Feb 27, 2014 7:20 AM in response to Scotch_Brawth
    Level 1 (0 points)
    Feb 27, 2014 7:20 AM in response to Scotch_Brawth

    Thanks Number88 and Christopher Murphy for your insightful thoughts.  Ultimately, I decided to stay away from a 5-partition MBR as you've both made it sound like a recipe for future problems.  I burned my recovery partition to a CD and saved a backup of the image on a network drive, then deleted that partition and went with four partitions (EFI, Mac, Win, and Shared - FAT32) and no hybrid MBR.

     

    Everything seems to be working fine, as I can read and write to the shared drive in both operating systems.  Unfortunately, I can also see the Mac partition in Windows.  I don't know if that's a problem or not, or if Windows can try to write to the Mac partition (I wouldn't think so since Mac uses a Mac OS Extended format, but I don't know.)  As long as Windows being able to see Mac can't later cause corruption issues, I'm good to go.  If it could be a problem, I'll have to see if I can figure out how to safely hide the Mac partition from Windows.

     

    Oh, and I think I discovered another bug: in order to delete the recovery partition, I enabled Debug mode in Disk Utility using defaults write com.apple.DiskUtility DUDebugMenuEnabled 1 but it won't let me turn Debug mode back off using defaults write com.apple.DiskUtility DUDebugMenuEnabled 0.  It doesn't really matter as long as I keep my hands off the EFI partition, but it is annoying not to be able to hide it again.  But all in all, everything turned out just super.  Thanks again for your help, gentlemen.

  • by Loner T,

    Loner T Loner T Feb 27, 2014 7:30 AM in response to DHughes01
    Level 7 (24,879 points)
    Safari
    Feb 27, 2014 7:30 AM in response to DHughes01

    DHughes01 wrote:


    Unfortunately, I can also see the Mac partition in Windows.  I don't know if that's a problem or not, or if Windows can try to write to the Mac partition (I wouldn't think so since Mac uses a Mac OS Extended format, but I don't know.)  As long as Windows being able to see Mac can't later cause corruption issues, I'm good to go.  If it could be a problem, I'll have to see if I can figure out how to safely hide the Mac partition from Windows.

    The Bootcamp drivers contain a read-only HFS driver, which lets you see the MAC HD (it should be a non-Fusion HD).

    DHughes01 wrote:

     

    Oh, and I think I discovered another bug: in order to delete the recovery partition, I enabled Debug mode in Disk Utility using defaults write com.apple.DiskUtility DUDebugMenuEnabled 1 but it won't let me turn Debug mode back off using defaults write com.apple.DiskUtility DUDebugMenuEnabled 0.  It doesn't really matter as long as I keep my hands off the EFI partition, but it is annoying not to be able to hide it again.

    sudo may solve your problem. If you can see the debug menu in DU, you may need to exit DU and start it back again.

  • by Number88,

    Number88 Number88 Feb 27, 2014 7:48 AM in response to Christopher Murphy
    Level 3 (750 points)
    Feb 27, 2014 7:48 AM in response to Christopher Murphy

    Just to be clear, if you installed Windows through Bootcamp you will (almost) certainly still have a hybrid MBR.

  • by Christopher Murphy,

    Christopher Murphy Christopher Murphy Feb 27, 2014 9:36 AM in response to Number88
    Level 3 (555 points)
    Feb 27, 2014 9:36 AM in response to Number88

    It's fixed in 0.8.10 which should get pushed within a week.

first Previous Page 75 of 102 last Next