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 7 of 102 last Next
  • by php dev,

    php dev php dev Sep 19, 2012 2:48 PM in response to Christopher Murphy
    Level 1 (0 points)
    Sep 19, 2012 2:48 PM in response to Christopher Murphy

    Hello Christopher Murphy, I am also looking for help to this problem. I was running Windows 7 (64 bit) fine off of bootcamp, until I wanted to try and run Fedora from Bootcamp as well. So I partitioned my Macintosh HD to run Fedora (off topic: is this actually possible? If so, then I'd like to keep this extra partition, otherwise it may as well be deleted), and found that Windows 7 would not show up upon restarting my PC, as well as getting the "No bootable device --- insert boot disk and press any key" page). This is something I really would like to get fixed without having to do a complete re-install of everything. I've executed the two commands you posted at the start of the thread, and would like to know if the instructions you posted to the orginal poster is pertinent to my case, or whether I need to go about this differently:

     

    sudo gpt -r -vv show disk0

    gpt show: disk0: mediasize=640135028736; sectorsize=512; blocks=1250263728

    gpt show: disk0: PMBR at sector 0

    gpt show: disk0: Pri GPT at sector 1

    gpt show: disk0: Sec GPT at sector 1250263727

           start        size  index  contents

               0           1         PMBR

               1           1         Pri GPT header

               2          32         Pri GPT table

              34           6        

              40      409600      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B

          409640   312453304      2  GPT part - 48465300-0000-11AA-AA11-00306543ECAC

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

       314132488   310968312      4  GPT part - 48465300-0000-11AA-AA11-00306543ECAC

       625100800      262144        

       625362944   624900096      5  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

      1250263040         655        

      1250263695          32         Sec GPT table

      1250263727           1         Sec GPT header

     

    sudo fdisk /dev/disk0

    Disk: /dev/disk0geometry: 77825/255/63 [1250263728 sectors]

    Signature: 0xAA55

             Starting       Ending

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

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

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

     

    I really appreciate the help you're providing, thanks.

  • by Christopher Murphy,

    Christopher Murphy Christopher Murphy Sep 19, 2012 3:22 PM in response to php dev
    Level 3 (555 points)
    Sep 19, 2012 3:22 PM in response to php dev

    It is possible to triple boot Apple hardware, with caveats that it's non-obvious how to do this and I never use "Boot Camp" per se to do it. Fedora 17 is one of the only distributions that supports EFI booting Linux on Apple hardware. You will end up with a pile of GPT partitions as a result, although any more than 4 means you will need to build your own hybrid MBR (with something like gdisk) because the Apple tools will not do it.

     

    Your disk now has five partitions, and Apple's tools only create hybrid MBRs for disks with 4 partitions or fewer. So what it did was it reset the hybrid MBR to a PMBR, removing the ability to boot Windows. So you probably have to deal with this in stages and decide what you want the final arragement to look like. And you have to realize how extraordinarily involved this is and that you're way way better off using VM for Fedora and Windows as guest, and Mac OS X as host.

     

    If you have some requirement for native booting these OS's, the ideal situation for the highly non-standard hybrid MBR that's required to do this, is for Windows to be in the last partition. It's in the last partition now, but you need to resize that Windows partition *and* move it. Resizing shrinks a partition from the end toward the middle, making room for more partitions after it. You need free space in front of the Windows partition in order to install Fedora. That way you can place all partitions except Windows into the MBR 0xEE partition, thus they are protected. Mac OS X and Fedora will honor the GPT, and ignore the MBR. And Windows will have its own entry in the MBR (and GPT), and of course Windows only honors the MBR when it's booting in legacy BIOS mode.

     

    You can use a Fedora Live CD, and yum install gparted, which can do a move/resize on NTFS volumes.

     

    You have two HFS+ partitions? Why? Partition 2 is HFS+ as is partition 4. In between them is Recovery HD.

     

    This is going to be complicated and take a while to move everything around. And then if it's not exactly correct, it'll take a lot of work to extract yourself out of a  partition scheme that will contain 7+ partitions. Again, I highly advise VM and having just a single Mac OS X partition.

  • by Christopher Murphy,

    Christopher Murphy Christopher Murphy Sep 19, 2012 3:38 PM in response to Christopher Murphy
    Level 3 (555 points)
    Sep 19, 2012 3:38 PM in response to Christopher Murphy

    The gist:

    1. Backup Mac OS X volumes.

     

    2. Get Windows bootable again so that you can back it up. This can be done with either gdisk (from sourceforge, search for GPT fdisk); or use the fdisk that comes with Mac OS X and add to partition 2 an entry identical to that of GPT partition 5. So, use the same start sector value and sector size value. The partition type should be 07. And you should set the active (bootable) flag on partition 2. You'll need to edit partition 1, keeping everything the same except you'll need to change its size so that it ends a sector before the Windows partition start sector.

     

    3. Resize and move Window NTFS partition with gparted. This will take some calculation to find the sector start offset you want and get the final size right. Invariably this will remove the hybrid MBR in step 2. So you'll eventually have to fix it later.

     

    4. Deal with the superfluous HFS+ volume?

     

    5. Install Fedora 17 into the free space between the 2nd HFS+ partition and the Windows partition.

     

    6. Create a new hybrid MBR to regain Windows bootability (needs to be done last because parted always writes out PMBRs not hybrid MBRs).

  • by php dev,

    php dev php dev Sep 19, 2012 11:32 PM in response to Christopher Murphy
    Level 1 (0 points)
    Sep 19, 2012 11:32 PM in response to Christopher Murphy

    I think I'll take your inital advice of running Fedora from a VM. So how would I go about making Windows 7 bootable again, and set up my PC to be able to boot Fedora in a VM?

    Christopher Murphy wrote:

     

    You have two HFS+ partitions? Why? Partition 2 is HFS+ as is partition 4. In between them is Recovery HD.

     

    I have no idea. Is this a problem, and can you help me fix it (if it is)? Thanks.

  • by Christopher Murphy,

    Christopher Murphy Christopher Murphy Sep 20, 2012 10:16 AM in response to php dev
    Level 3 (555 points)
    Sep 20, 2012 10:16 AM in response to php dev

    Please post the result from:

    diskutil list

     

    And also find, download, and install, gdisk from sourceforge. You're looking for GPT fdisk, 0.8.5 or later.

  • by php dev,

    php dev php dev Sep 20, 2012 10:51 AM in response to Christopher Murphy
    Level 1 (0 points)
    Sep 20, 2012 10:51 AM in response to Christopher Murphy

    diskutil list

    /dev/disk0

       #:                       TYPE NAME                    SIZE       IDENTIFIER

       0:      GUID_partition_scheme                        *640.1 GB   disk0

       1:                        EFI                         209.7 MB   disk0s1

       2:                  Apple_HFS Macintosh HD            160.0 GB   disk0s2

       3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3

       4:                  Apple_HFS Fedora                  159.2 GB   disk0s4

       5:       Microsoft Basic Data                         319.9 GB   disk0s5

    /dev/disk1

       #:                       TYPE NAME                    SIZE       IDENTIFIER

       0:     Apple_partition_scheme                        *84.0 MB    disk1

       1:        Apple_partition_map                         32.3 KB    disk1s1

       2:                  Apple_HFS Firefox                 84.0 MB    disk1s2

     

    I've also downloaded gdisk 0.8.5. Thanks for the support.

  • by Christopher Murphy,

    Christopher Murphy Christopher Murphy Sep 20, 2012 11:09 AM in response to php dev
    Level 3 (555 points)
    Sep 20, 2012 11:09 AM in response to php dev

    What is this 160GB partition labeled Fedora? It's marked as HFS+. A default Fedora installation on Apple hardware doesn't produce an HFS+ volume of this size, it produces a very tiny one that contains the bootloader and some other files only, so that it appears as a boot option in Startup Disk. Is this an incomplete installation?

     

    gdisk runs it interactive mode so you type

    sudo gdisk /dev/disk0

    And you'll end up in a program that reacts to lettered options. For example ? <return> will get you a list of commands. What you're after is:

    r [recovery menu]

    h [create a new hybrid mbr]

    5 [add GPT partition 5 to the mbr, this is your windows partition]

    y  [yes place 0xEE in the first MBR partition]

    <return>  [accept default of 07 for Windows partition type]

    y [set the bootable flag]

    n [do not protect more partitions]

    w [write out the new partition tables]

     

    Once done, it will drop to a prompt and you should reboot and test your ability to boot Mac OS and Windows.

  • by php dev,

    php dev php dev Sep 20, 2012 11:23 AM in response to Christopher Murphy
    Level 1 (0 points)
    Sep 20, 2012 11:23 AM in response to Christopher Murphy

    Christopher Murphy wrote:

     

    What is this 160GB partition labeled Fedora? It's marked as HFS+. A default Fedora installation on Apple hardware doesn't produce an HFS+ volume of this size, it produces a very tiny one that contains the bootloader and some other files only, so that it appears as a boot option in Startup Disk. Is this an incomplete installation?

    I partitioned my Macintosh HD into two, one for the Mac OS x system, and one for Fedora (which I did not install in the end, so it can be deleted); this was done through disk Utility. My other disk partition (named "Untitled") is for Windows 7 (it won't let me change the name; I don't suppose you have a solution for this as well?).

  • by Christopher Murphy,

    Christopher Murphy Christopher Murphy Sep 20, 2012 11:24 AM in response to php dev
    Level 3 (555 points)
    Sep 20, 2012 11:24 AM in response to php dev

    Well, you could use gdisk first to delete partition 4, assuming there's nothing on it. That will make it free space. Then reboot.

     

    Then go to Terminal and type:

    diskutil resizevolume /dev/disk0s2 limits

     

    See if the resizer will see the free space as something it can use to merge back into the Mac OS X volume. Deal with this first before Windows because any activity that involves changing the GPT will cause the hybrid MBR to revert to PMBR.

  • by php dev,

    php dev php dev Sep 20, 2012 11:39 AM in response to Christopher Murphy
    Level 1 (0 points)
    Sep 20, 2012 11:39 AM in response to Christopher Murphy

    I'm not too familiar with gdisk, so I deleted the partition in disk utility, but it's not allowing me to extend the Macintosh HD memory to the full width of the box. Here's an image to show:

     

    http://postimage.org/image/8pny3du1t/

     

     

    I've also tried the terminal command, but it's saying that the disk is at its current limit.

  • by Csound1,

    Csound1 Csound1 Sep 20, 2012 12:32 PM in response to php dev
    Level 9 (51,412 points)
    Desktops
    Sep 20, 2012 12:32 PM in response to php dev

    Back the partition up and delete it and all others, then make a new one.

  • by php dev,

    php dev php dev Sep 20, 2012 2:21 PM in response to Csound1
    Level 1 (0 points)
    Sep 20, 2012 2:21 PM in response to Csound1

    Thanks for the respone; though that sounds like a hefty task, which is something I'd rather avoid. I've managed to repartition the Macintosh HD so that I'm only loosing 5-10GBs or so to the unknown, and my Windows 7 OS is now bootable (which was the main thing I needed to fix).

  • by randalljn,

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

    I'm personally having the same issue, I've confirmed that my iMac has only 4 partitions and it is the 4th

    that has the GUID (under index) is EBD0A0A2-B9E5-4433-87C0-68B6B72699C7.


    "gpt show: disk0: mediasize=320072933376; sectorsize=512; blocks=625142448

    gpt show: disk0: Suspicious MBR at sector 0

    gpt show: disk0: Pri GPT at sector 1

    gpt show: disk0: Sec GPT at sector 625142447

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

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

      195985408  428894856      4  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

      624880264     262151        

      625142415         32         Sec GPT table

      625142447          1         Sec GPT header"

     

    So I was able to follow your specific set of instructions however when I get to the part of accepting the default hex code (which according to your post should be 07) mine is 03. If possible could you inform me of where I went wrong.

    Thanks!

    Randall

  • by Christopher Murphy,

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

    You've supplied a GPT, but 07 and 03 are MBR hex codes, not GPT hex codes. If you're fixing this in fdisk then the code would be 07, but it's not a default, you have to enter it in. If you're fixing this in gdisk's recovery > create new hybrid MBR option, the default code for your partition 4 will be 0700. So I have no idea what you're trying to fix this in.

  • by randalljn,

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

    Sorry for not supplying you with all the details

     

    The results when I punch in sudo gpt -r -vv show disk0 are :

     

    gpt show: disk0: mediasize=320072933376; sectorsize=512; blocks=625142448

    gpt show: disk0: Suspicious MBR at sector 0

    gpt show: disk0: Pri GPT at sector 1

    gpt show: disk0: Sec GPT at sector 625142447

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

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

      195985408  428894856      4  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

      624880264     262151        

      625142415         32         Sec GPT table

      625142447          1         Sec GPT header

     

    The results I get when I punch in sudo fdisk /dev/disk0:

    Disk: /dev/disk0geometry: 38913/255/63 [625142448 sectors]

    Signature: 0xAA55

             Starting       Ending

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

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

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

    *2: 03 1023 254  63 - 1023 254  63 [ 195985408 -  428894856] XENIX /usr 

    3: 00    0   0   0 -    0   0   0 [         0 -          0] unused     

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

     

    When I punch in diskutil I get

    /dev/disk0

       #:                       TYPE NAME                    SIZE       IDENTIFIER

       0:      GUID_partition_scheme                        *320.1 GB   disk0

       1:                        EFI                         209.7 MB   disk0s1

       2:                  Apple_HFS Wendy Hd                99.5 GB    disk0s2

       3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3

       4:       Microsoft Basic Data                         219.6 GB   disk0s4

    /dev/disk1

       #:                       TYPE NAME                    SIZE       IDENTIFIER

       0:                            GRMCPRXFRER_EN_DVD     *3.2 GB     disk1


     

    I then downloaded gdisk like instructed to and when I follow the process I get the following:

     

    After typing in p<enter> I get

     

    Disk /dev/disk0: 625142448 sectors, 298.1 GiB

    Logical sector size: 512 bytes

    Disk identifier (GUID): F932B20F-2EDE-420B-A677-C2EE508E9943

    Partition table holds up to 128 entries

    First usable sector is 34, last usable sector is 625142414

    Partitions will be aligned on 8-sector boundaries

    Total free space is 262157 sectors (128.0 MiB)

     

     

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

       1              40          409639   200.0 MiB   EF00  EFI System Partition

       2          409640       194715863   92.7 GiB    AF00  Wendy Hd

       3       194715864       195985407   619.9 MiB   AB00  Recovery HD

       4       195985408       624880263   204.5 GiB   0700  DOS_FAT_32_Untitled_3

     

     

     

    How should I proceed from here? Have I gotten all the steps down?

     

    Thanks so much for your help.


first Previous Page 7 of 102 last Next