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

Oct 19, 2012 11:09 AM in response to Esteves91

It's an unqualified statement is the short answer.


The long answer is esoteric. Windows, OS X, Linux, can run off a network so long as it has the proper drivers, so this is not really a Windows question. This is a firmware question, and Macs don't have a configurable BIOS like most PC's so that introduces limitations. Mac firmware is EFI, but then there's a CSM which is a software BIOS. It's also not configurable. And for now, Apple only supports Windows with this CSM-BIOS mode, ergo Windows isn't booting via (U)EFI. And that's a big part of the problems people have, including the partitioning problems. Ideally we'd be able to boot Windows in UEFI mode, and then both Windows and OS X would use only GPT for partition scheme.


So what this someone is referring to indirectly is that maybe Windows can only be installed on the primary drive on particular Macs, depending on the idiosyncracies of their firmware version. My recollection from the Boot Camp installation guide is Apple does say to remove all drives except the target drive for Windows, in a multi-disk boot setup. After installation, then you can reconnect all drives. But they say this for desktop computers. They don't expressly say you can do this with laptops. It should be possible in a laptop, but Windows on a 2nd drive may be an unsupported configuration as far as they're concerned for all I know. But that doesn't mean it can't be done.


Working around firmware limitations is the hallmark of bootloaders, and why that whole process is complicated. The bootloader stage, the computer is very, very dumb. It doesn't have a GUI yet, it doesn't have decent error messages, and early on it doesn't even know what a file system is. So each stage of bootloading is about teaching it new things, one of which is how to locate boot files on another drive.


But like on one of my older Macbook Pros, while I can (U)EFI boot OS X and Linux from a USB stick, the USB bus is simply not available with the CSM-BIOS mode. So I can't boot anything, including Windows, from USB. Not a Windows limitation, that's a firmware limitation.


Anyway, I highly recommend a virtual machine for this. You will have no partition questions, no volume resizing issues, you get snapshots for the VM environment, you get sharing of files between Mac and Windows, backups are easier, restore is vastly easier. All the way around a VM is better. Except for games. And I'm not highly sympathetic to people who go through all this trouble just to play games. :-\ If you don't really need native booting of Windows, I'd use a VM, not Boot Camp.

Oct 20, 2012 11:06 AM in response to Christopher Murphy

Hi all; I'm having a similar problem, and I seem to be making mistake after mistake trying to fix it. Just found this thread. So, here's where I'm at now:


I currently have a (now screwed up) drive from a Mac Mini with bootcamp + Windows 7. The Mac side boots fine, the Windows side says "no bootable device found". The Windows partition does not show in the startup manager. It does show in Disk Utility. It also shows as a selection in startup disks (and the Mac still tries to boot to it by default). Here is the output of various commands:


gpt (from OSX):


$ sudo gpt -r -vv show /dev/disk0

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

gpt show: /dev/disk0: Suspicious MBR at sector 0

gpt show: /dev/disk0: Pri GPT at sector 1

gpt show: /dev/disk0: Sec GPT at sector 976773167

start size index contents

0 1 MBR

1 1 Pri GPT header

2 32 Pri GPT table

34 409606

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

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

81757304 904

81758208 59845802 4 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

141604010 835169125

976773135 32 Sec GPT table

976773167 1 Sec GPT header


fdisk (from OSX):


$ sudo fdisk /dev/disk0

Disk: /dev/disk0 geometry: 60801/255/63 [976773168 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 25 127 15 - 1023 254 63 [ 409640 - 80078128] HFS+

*3: AB 1023 254 63 - 1023 254 63 [ 80487768 - 1269536] Darwin Boot

*4: 07 1023 254 63 - 1023 254 63 [ 81758208 - 59845802] HPFS/QNX/AUX


fdisk (from a Linux machine):


$ sudo fdisk /dev/sdb


WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


Command (m for help): p


Disk /dev/sdb: 500.1 GB, 500107862016 bytes

255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000


Device Boot Start End Blocks Id System

/dev/sdb1 1 409639 204819+ ee GPT

/dev/sdb2 * 409640 80487767 40039064 af HFS / HFS+

/dev/sdb3 * 80487768 81757303 634768 ab Darwin boot

/dev/sdb4 * 81758208 141604009 29922901 7 HPFS/NTFS/exFAT


gdisk (from a Linux machine):


jason@ubuntu:~$ sudo gdisk /dev/sdb

GPT fdisk (gdisk) version 0.6.14


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/sdb: 976773168 sectors, 465.8 GiB

Logical sector size: 512 bytes

Disk identifier (GUID): 584883BF-EEBA-402D-AC7B-658C2B1EE5F2

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 835579635 sectors (398.4 GiB)


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

2 409640 80487767 38.2 GiB AF00 Apple HFS/HFS+

3 80487768 81757303 619.9 MiB AB00 Apple boot

4 81758208 141604009 28.5 GiB 0700 BOOTCAMP


Command (? for help): i

Partition number (2-4): 4

Partition GUID code: EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 (Linux/Windows data)

Partition unique GUID: 8AE632B6-2832-4368-B127-3D2C15F8BC16

First sector: 81758208 (at 39.0 GiB)

Last sector: 141604009 (at 67.5 GiB)

Partition size: 59845802 sectors (28.5 GiB)

Attribute flags: 0000000000000000

Partition name: BOOTCAMP


Partition 4 is the Windows partition. I renamed it to BOOTCAMP at some point while trying to fix it today. I've also been futzing with the type ID of that partition. I do not know what the correct settings should be.


How I got here was sort of complicated but here's generally what happened:


1. I had a working OSX + Bootcamp + Windows 7 setup.

2. Using Easeus partition manager from a different Windows machine, I shrunk the size of the Windows partition down to 28.5GB. However, when applying the changes, a vague error occurred along the lines of "An error occurred while writing partition chains."

3. When attempting to boot the Mac again, the Windows side worked fine, but the OSX partition didn't show up in the Mac's startup manager.


At this point I didn't really know 100% what I was doing and probably should not have proceeded.


4. Gdisk (GPT) showed the previous Mac partitions as unallocated space (as did Easeus). Fdisk showed the correct partition info. I used gdisk to rebuild the GPT from the MBR. At this point I was able to boot OSX again but now the Windows partition didn't show up in the startup manager. The machine was about in the same state it is currently in.

5. At this point, fdisk (MBR) no longer showed any partitions except the first EE one. I tried rebuilding a hybrid MBR with gdisk; which caused fdisk to display all the partitions from the MBR, but did not change the system's behavior.

6. I also tried messing around with the type IDs, changing the MBR id for the 4th partition to 07 (it was EF), and changing the GPT id for the 4th partition to 0700, various combinations of this, but with no effect.


I feel like I'm very close to getting this right, but I just don't quite know how to fix it and I'm afraid that if I keep bumbling around I'll make the problem even worse.


This all started when I attempted to shrink the bootcamp partition so I could clone the drive to a smaller disk, which should have been simple. But whatever I did has now cost me the entire day 9:30AM - 2PM and I haven't even started the drive clone copying yet. :-(


Does anybody have any advice how to proceed? I do not have an OSX CD. I do have a Windows CD and a bunch of spare USB sticks, although I don't have a CD-ROM drive handy for the Mac Mini.


Thanks a lot,

J

Oct 20, 2012 12:04 PM in response to JasonC2

1. Make sure you're using gdisk 0.8.5, the linux version 0.6.14 is kinda old. You can use a Fedora 17 LiveCD which includes gdisk 0.8.4 or 0.8.5.


2. The drive is missing GPT partition 1, which should be the EFI System partition, type code is EF00. The normal start and end sector values, if you originally partitioned this disk with the OS X Disk Utility: 40s and 409639s. Based on the free space after the GPT table, this is a safe assumption. So you should use gdisk to create a new partition, doesn't matter what partition number, 40s start and 409639s end, type code EF00. This partition is required but the (U)EFI spec, and when booting in EFI mode from a GPT disk, it's possible the Mac firmware insists on finding an EFI System partition, and fails if it doesn't.


3. You have 398GiB free space at the end of the disk. If you intend to use it, you should add another partition. Type codes 0700 for NTFS, AF00 for JHFS+/X, 8300 for Linux or 8e00 for Linux LVM.


4. The type codes on the other partitions are correct.


5. After this, go the gdisk main menu, and use the 's' command to resort the partition tables in order. Then remake the hybrid MBR: add partitions 4 5 to the MBR; EFI GPT first = yes; make 4 bootable; do not make 5 bootable. No other partitions to protect. Write it out.


6. Windows partition managers, when booted in BIOS mode, tend to only look for and modify an MBR. They aren't generally able to deal with hybrid MBRs, and in any case there is no such thing as a standard hybrid MBR, and therefore they can be interpreted differently. So using any partitioning tool that is not EXPLICITLY capable of dealing with hybrid MBR (i.e. both MBR and GPT at the same time, a rare thing indeed) is begging for data loss, especially combined with volume resizing. It's why I keep harping on people to just use VMs. They're way way safer.

Oct 20, 2012 1:49 PM in response to Christopher Murphy

Thank you so much. Recreating the EFI partition and rebuilding the MBR allowed me to boot into Windows again.


After doing that Windows failed booting with error 0xC000000E (complaining that system configuration changed). I could have fixed this with the recovery CD but I do not have a CD-ROM drive handy, the drive was readable so I was able to fix it with bcdboot by attaching the drive to an existing Windows machine and doing bcdboot F:\Windows /s F: /v where "F:" was the Windows partition on the Mac Mini drive.


Once I did that, the system booted, although had two "Windows" entries in the Windows boot menu. I cleaned this up by removing the broken unused entry with bcdedit.


And now, it's all working great again. I am exactly where I was 8 hours ago, but at least I learned something.


Once again, thank you for your help, it is greatly appreciated.


I have one final question. I now need to resize, nondestructively, both an HFS and NTFS partition. I'm not going to attempt it with Easeus again. I also need to clone the drive afterwards - although I can at least do a sector-by-sector clone with Easeus which may work for that. Can you recommend a reliable tool that can do this? I have gparted, which I have not looked at closely yet, and also I've seen mention of iPartition, which I will buy if I know it will work. I'm not that familiar with software available for the Mac or with reliable disk editing tools.


Thanks!

Jason

Oct 20, 2012 2:17 PM in response to JasonC2

Is OS X booting also? Or is that still messed up?


Honestly I'm not a fan of proprietary software when open source software is available, and exactly how it behaves is well understood and documented. So I use dd. You can do this from a Linux live cd, or you can use the dd in OS X *however* to do a sector copy you have to make sure the source disk does not have any mounted file systems. If they're mounted rw, they're changing, and by the time you've copied all sectors, the resulting copy has become completely inconsistent and likely not usable. Anyway something like:


dd if=/dev/sda of=/folder1/folder2/seagate900G_sector.img bs=256K


will do it. Use 256k and rdiskX on OS X, you'll get better performance using the raw device. You can also make separate images of the partitions instead of the whole disk. Use /dev/sdaX on linux, or /dev/rdiskXsY on OS X where X is the device and Y is the partition. You can get those values from 'diskutil list'.


I'm not going to write out a tutorial on disk resizing here. It would take way too much time. It's way too perilous to describe how to do this without losing data on hybrid MBR disks with 5+ partitions. You are better off with a commercial application like iPartition, Winclone, or CampTune to do this. I haven't used any of them, so I can't give feedback on those products.

Oct 20, 2012 3:02 PM in response to Mobzy3000

Ok, I've tried a couple of things today and still no good. It seems that when I get into the Recovery Menu when booting off the Windows 7 disk, It doesn't detect the Windows OS on the partition and it asks that I should load drivers 😢. Disk Utility still reports the same format but I've given up on that because it is just stupid.



If anyone can give me any advice, it would be much apprciated! I tried making a copy of the hardisk with Acronis but it doesn't work if the drive is on a GUID format 😟


If I can't get this working, I'm just going to have to accept that I've lost all my data on Windows, fml.

Oct 20, 2012 4:24 PM in response to Mobzy3000

when booting off the Windows 7 disk, It doesn't detect the Windows OS on the partition


I suggest you start from the Windows 7 install disk, and use chkdsk, followed by chkdsk /f to make sure the partition even contains a valid, clean, NTFS volume. Nothing else matters unless that's true. Then you can try to do manual repairs. In order of bootloading: fixmbr, fixboot, rebuildbcd. There is a fourth, multi-step way to totally rebuild the bcd which is buried in this document.


it asks that I should load drivers


No idea.


Disk Utility still reports the same format


I don't understand what this means. Disk Utility has no idea what NTFS is, it cannot repair NTFS.


tried making a copy of the hardisk with Acronis but it doesn't work if the drive is on a GUID format


Disk Utility (asr) can make a sector copy of a partition so long as the volume (the file system) on that partition is not mounted. If that doesn't work something like:

dd if=/dev/disk0s4 of=/Volumes/MyExternalDrive/folder1/windowsbackup.img bs=256k

will make a sector partition copy. It will produce a file as large as the partition, every sector including the ones that don't contain information, so it will be a big file. Bigger than the amount of data you've got on that Windows partition.

Oct 22, 2012 5:50 AM in response to Christopher Murphy

Thanks Chris,


I couldn't select the drive from the Recovery Options menu but I went straight to command prompt and I ran chkdsk, It's weird as only 29 file records where processed and 0 large file, EA records where processed. It detected the file system as NTFS;



Windows has checked the file system and found no problems.


3086 KB total disk space.

4 KB in 9 indexes.

0 KB in bad sectors.

2485 KB in use by the system.

2058 KB occupied by the log file.

597 KB available on disk.


512 bytes in each allocation unit.

6173 total allocation units on disk.

1195 allocation unites available on disk.

Failed to transfer logged messages to the event log with status 50.



I'm trying to figure out if I can select the Bootcamp partition using diskpart and run chkdsk and chkdsk /f on the selected partition. Running chkdsk /f on the hdd comes up with the message that it cannot write onto the disk.



I know I have been a pain and that there is only so much you can do, so If I can't this figure out I'm just going to assume that the data on the bootcamp partition is gone. Maybe I'll wipe the HDD and try recovering it using a data recovery program.



Thanks so much for your help.

Oct 22, 2012 9:59 AM in response to Mobzy3000

It's found a 3MB file system according to those numbers. That doesn't make sense. I think the MBR contains incorrect start and/or end sector values, or the file system is irreparably corrupt. Probably the former.


When you say you're missing a boot partition for Windows, this doesn't make sense given your original partition table you posted. And it's non-standard on a Mac because Boot Camp only creates a single partition for Windows to install into. The Windows installer will create a ~200MB boot partition (I think they call it a system partition actually) when it's installed onto a whole disk. But that's not what happened here. If you are positive you had a Windows boot partition, then the partitioning is wrong and that's why it's not finding the file system. The only practical way to proceed is to stop making any file system changes to any non OS X partition, and image those sectors. You might be able to use hexdump C and grep to find the start of the NTFS volume header, and from that find the proper start sector for this NTFS volume that's missing in action. This is quite tedious. But then you free up the drive to start over and get back to work.


The sectors to image look like 89611688 through to the end of the disk. This can be done with the dd command also, where you add skip=89611688 flag along with if=/dev/disk0. So that will start imaging disk0 at sector 89611688 to the end of the disk.

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.