You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

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:

User uploaded file

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

Reply
1,534 replies

Sep 18, 2012 12:00 PM in response to jupe699

If you boot from Recovery HD, and repartition with 1 partition in the GUI, in reality you will have two partitions because the EFI System partition is a requirement GPT disks as this is part of the (U)EFI spec. After you download and reinstall Lion or Mountain Lion, you will have three partitions. There is no way around this.


Even with Snow Leopard a single partition disk in the GUI really had two partitions, because the EFI System partition is a requirement for GPT disks.


After installation, you can manually delete the Recovery HD partition. But in so doing you lose the ability to boot from a known good volume to do repairs on your primary volume, to do restores over the internet, and the ability to use File Vault 2. If you're willing to live with such limitations then you can delete the Recovery HD partition using something like gdisk, before you resize the disk with Boot Camp assistant. But I don't know what the point of doing this would be.

Sep 18, 2012 4:48 PM in response to C_Jones

Make sure you have backups for Mac OS data, and then remove the two partitions with Disk Utility. In Disk Utility click on the drive icon (not volume icons, the one with the drive model #), then on the Partition tab, then on the partition you want deleted, then click the - button (the minus button) below the partition diagram. Do this again for the second partition you want deleted. Reboot.


Then go to Terminal and type:


diskutil resizevolume /dev/disk0s2 limits

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/disk0 geometry: 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.

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.

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).

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.

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.

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.

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

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.

Repairing Boot Camp after creating new partition

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.