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

Jan 25, 2013 7:06 AM in response to Christopher Murphy

myuser$ sudo dd if=/dev/rdisk0s5 of=/Volumes/external/directoryname/POCTOBAM.iso bs=128k

Password:

dd: /dev/rdisk0s5: Input/output error

196415+0 records in

196415+0 records out

25744506880 bytes transferred in 612.548041 secs (42028551 bytes/sec)

myuser$


The target disk has given me I/O errors in other settings. The source disk has never given any I/O errors. I will choose a different target.

Jan 25, 2013 7:09 AM in response to Christopher Murphy

Oh my. This just came in:


SMARTReporter has detected an 'I/O Error' on the disk named

MtnLion1,SnoLeopard (/dev/disk0)! This is not a S.M.A.R.T. error, but repeated errors still can indicate a failing disk - please consult SMARTReporter's FAQ for recommendations how to proceed.

Full message from 'kernel.log':

Jan 25 06:58:54 Figaro71 kernel[0]: disk0s5: I/O error.

Jan 25, 2013 10:35 AM in response to autnagrag

disk0s5 is is what it's complaining about and is the source; so while the USB power notifications are a problem too I'm not sure it's related. Is the only USB device the drive? I'd disconnect the hub and everything else you can and directly plug the drive into the computer. Also, I see spurious behavior like this with USB bus powered drives all the time, which is why I don't use them anymore. I only use USB enclosures with a separate power supply. Firewire has more power available so that's workable for bus powered.

Jan 25, 2013 10:37 AM in response to Berend de Meyer

Nope sorry. I've done that one a bunch of times already in this thread, the UI is interactive and very straightforward. And gdisk is well documented. If you post the result from the o and p commands from the recovery and transformation menu, I'll look at those before you commit the write, just leave gdisk running after you issue the o and p commands, post the result and leave gdisk to hang out while you wait back for a response.

Jan 25, 2013 1:27 PM in response to Christopher Murphy

I turned off Time Machine, whether it was involved or not, because it was mentioned in the log. I chose a different target, on FW800 bus, and I disconnected all USB devices. I think I have a backup now. disk0s5 must have behaved for long enough.


myuser$ sudo dd if=/dev/rdisk0s5 of=/Volumes/SomeVolume/BOOTCAMP.iso bs=256k

Password:

173836+0 records in

173836+0 records out

45570064384 bytes transferred in 1096.566970 secs (41557028 bytes/sec)

myuser$


So now I guess I'm ready to try (disk1 is now the disk in question)


$ diskutil mergePartitions JHFS+ "MtnLion1" disk1s2 disk1s3


Then I'll reboot and see what that Bootcamp will do.

Jan 25, 2013 4:30 PM in response to Christopher Murphy

myuser$ sudo gdisk -l /dev/disk1

Password:

GPT fdisk (gdisk) version 0.8.6



Partition table scan:

MBR: protective

BSD: not present

APM: not present

GPT: present



Found valid GPT with protective MBR; using GPT.

Disk /dev/disk1: 976773168 sectors, 465.8 GiB

Logical sector size: 512 bytes

Disk identifier (GUID): 8BA679D7-517C-470D-91B9-912CEB5EC9AC

Partition table holds up to 128 entries

First usable sector is 34, last usable sector is 976773134

Partitions will be aligned on 8-sector boundaries

Total free space is 1984349 sectors (968.9 MiB)



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

1 40 409639 200.0 MiB EF00 EFI System Partition

2 409640 805626287 384.0 GiB AF00 Deltitnu

3 805626288 807157967 747.9 MiB AB00 Apple_HFS_Untitled_2

4 807157968 885784759 37.5 GiB AF00 Untitled

5 887769088 976773119 42.4 GiB 0700 BOOTCAMP

myuser$


myuser$ sudo fdisk /dev/disk1

Disk: /dev/disk1 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 - 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

myuser$

Jan 25, 2013 4:43 PM in response to autnagrag

Weird. So the merge didn't work. Did you get an error? Because disk1s3 is stil there, and it's still the Recovery HD partition.


It's easier to just leave it alone, and built a new hybrid MBR and add only partition 5 and make it bootable. Then add no more partitions. The consequence of this is that it's a.) non-standard, and might cause issues with upgrades down the road; b.) you can't read OS X files from within Windows, those volumes won't be visible in Windows. But that's it.


The consequence for deleting the partition and for Windows to become the 4th partition instead of the 5th, is that it's possible (?) the BCD will no longer be valid and you'll have to run Windows Startup Repair to fix it. But if you're willing to risk that, you can use gdisk to delete the 3rd partition, then use p <enter> to see if the Windows partition is now 4, or if it's still 5. I think i'll still be 5. In which case, ? from the main menu will show a list of options and somewhere in there is a sort option, maybe it's s. If you do that, it will reorder the partitions 1-4. Confirm with p. Then go to the transformation menu, and use h to make a new hybrid mbr, and add partitions 2, 3, 4, making 4 bootable. And then see if Windows boots, or if you get some boot loade error - in which case you'll need to use Windows Startup Repair.


See! I tell people to just use VMs. Way easier! None of this stuff applies to VMs.

Jan 25, 2013 5:30 PM in response to Christopher Murphy

The merge may well have worked. I misunderstood and thought you wanted to see the output of those commands before I merged. I agree in principle with your comments about virtual machines. Heck, I use one. However, there are one or two feats I cannot accomplish without booting into Windows 7.


Here see output from the merge, and the two other commands. I'm going to reboot.


myuser$ diskutil mergePartitions JHFS+ “Trefoil_Metdale" disk1s2 disk1s3

Merging partitions into a new partition

Start partition: disk1s2 Trefoil_Metdale

Finish partition: disk1s3 Recovery HD

Started partitioning on disk1

$<3>Merging partitions

$<3>Waiting for the disks to reappear

$<3>Growing disk

$<3>Finished partitioning on disk1

/dev/disk1

#: TYPE NAME SIZE IDENTIFIER

0: GUID_partition_scheme *500.1 GB disk1

1: EFI 209.7 MB disk1s1

2: Apple_HFS Trefoil_Metdale 412.9 GB disk1s2

3: Apple_HFS Trefoil_Scandale 40.3 GB disk1s4

4: Microsoft Basic Data POCTOBAM 45.6 GB disk1s5

myuser$


myuser$ sudo gdisk -l /dev/disk1

Password:

GPT fdisk (gdisk) version 0.8.6



Partition table scan:

MBR: hybrid

BSD: not present

APM: not present

GPT: present



Found valid GPT with hybrid MBR; using GPT.

Disk /dev/disk1: 976773168 sectors, 465.8 GiB

Logical sector size: 512 bytes

Disk identifier (GUID): 8BA679D7-517C-470D-91B9-912CEB5EC9AC

Partition table holds up to 128 entries

First usable sector is 34, last usable sector is 976773134

Partitions will be aligned on 8-sector boundaries

Total free space is 2246493 sectors (1.1 GiB)



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

1 40 409639 200.0 MiB EF00 EFI System Partition

2 409640 806895823 384.6 GiB AF00 Deltitnu

3 807157968 885784759 37.5 GiB AF00 Untitled

4 887769088 976773119 42.4 GiB 0700 BOOTCAMP

myuser$




myuser$ sudo fdisk /dev/disk1

Disk: /dev/disk1 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 - 806486184] HFS+

3: AF 1023 254 63 - 1023 254 63 [ 807157968 - 78626792] HFS+

4: 0C 1023 254 63 - 1023 254 63 [ 887769088 - 89004032] Win95 FAT32L

myuser$

Jan 25, 2013 5:41 PM in response to autnagrag

Wonky. That seems like a couple of bugs there.


a.) the 4th partition in the MBR is type 0C, although it should be 07. Probably not a big deal.

b.) the 4th partition in the MBR doesn't have the active flag set. I don't think this is going to boot.


Give it a shot. But I bet you need to come back to gdisk, create a new hybrid mbr, add partitions 2 3 4, make only 4 bootable, then write out the new partitions. Reboot.

Jan 25, 2013 5:51 PM in response to Christopher Murphy

The merge did work, but the Bootcamp partition won't boot, and can't be accessed via Startup Manager.


The machine has no internal optical drive.


I have a Win7 32b install CD or DVD, a .iso file of it, and a USB enclosure that contains the former internal optical drive of the machine. It is a powered USB enclosure. I might have made a Win7 "rescue" CD. I'll have to check when I get home.


What do you suggest to recover bootability of my Bootcamp partition? I'm not sure I fully understand your last post to me, but it sounds to me like I should go home and get that external optical drive hooked up, and boot holding down the C key.

Jan 26, 2013 7:01 AM in response to Christopher Murphy

$ diskutil list

/dev/disk0

#: TYPE NAME SIZE IDENTIFIER

0: GUID_partition_scheme *1.0 TB disk0

1: EFI 209.7 MB disk0s1

2: Apple_HFS MAC_OSX_ML 499.0 GB disk0s2

3: Apple_Boot Recovery HD 650.0 MB disk0s3

4: Microsoft Basic Data WIN8_PROx64 500.3 GB disk0s4

$ sudo gpt -r -vv show disk0

Password:

gpt show: disk0: mediasize=1000204886016; sectorsize=512; blocks=1953525168

gpt show: disk0: Suspicious MBR at sector 0

gpt show: disk0: Pri GPT at sector 1

gpt show: disk0: Sec GPT at sector 1953525167

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

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

976288520 1272

976289792 977233920 4 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

1953523712 1423

1953525135 32 Sec GPT table

1953525167 1 Sec GPT header


$ diskutil resizevolume /dev/disk0s2 limits

For device disk0s2 MAC_OSX_ML:

Current size: 499.0 GB (498999984128 Bytes)

Minimum size: 499.0 GB (498999984128 Bytes)

Maximum size: 499.0 GB (498999984128 Bytes)


$ sudo gdisk /dev/disk0

GPT fdisk (gdisk) version 0.8.5


Partition table scan:

MBR: hybrid

BSD: not present

APM: not present

GPT: present


Found valid GPT with hybrid MBR; using GPT.


Command (? for help): p

Disk /dev/disk0: 1953525168 sectors, 931.5 GiB

Logical sector size: 512 bytes

Disk identifier (GUID): DF74661F-A6DE-466B-B637-8D81F396CD3E

Partition table holds up to 128 entries

First usable sector is 34, last usable sector is 1953525134

Partitions will be aligned on 8-sector boundaries

Total free space is 2701 sectors (1.3 MiB)



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

1 40 409639 200.0 MiB EF00 EFI System Partition

2 409640 975018983 464.7 GiB AF00 Apple_HFS_Untitled_5

3 975018984 976288519 619.9 MiB AB00 Apple_HFS_Untitled_2

4 976289792 1953523711 466.0 GiB 0700 BOOTCAMP



Command (? for help): r


Recovery/transformation command (? for help): o


Disk size is 1953525168 sectors (931.5 GiB)

MBR disk identifier: 0xEC1946A7

MBR partitions:



Number Boot Start Sector End Sector Status Code

1 1 409639 primary 0xEE

2 409640 975018983 primary 0xAF

3 975018984 976288519 primary 0xAB

4 * 976289792 1953523711 primary 0x07


Recovery/transformation command (? for help):

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.