For a variety of reasons, the Boot Camp Assistant sometimes fails to let you do the things you want to do. It doesn’t work, for instance, if your drive is already partitioned. Many early adopters partitioned their drives before Boot Camp, hoping for an eventual dual boot solution either from Apple or elsewhere. In my case, I used Boot Camp to repartition my hard drive, then used that partition to install another copy of OS X for a test. Unfortunately, Boot Camp Assistant refused to reclaim that partition when I was done. That’s 20GB down the drain!
GPT Mangling for Dummies
Apple includes a utility called gpt for mangling with the GPT headers on your drive. Unfortunately, this specific utility requires you to unmount all volumes on a disk before it will work, but that’s not a huge barrier. Reboot to your OS X Install CD or to another Tiger volume and use Disk Utility to unmount (but not eject) all volumes on the disk in question.
The gpt utility, on the command line, allows you to do a variety of things. In my case, I wanted to remove the existing secondary HFS+ partition (disk0s3) and expand the first (disk0s2) to take over its space. I shouldn’t have to explain that the commands in this tip all require root access; use sudo as appropriate.
To see the current GPT headers, use the show verb. Using any gpt commands will remount all volumes, oddly. Keep Disk Utility running, as you’ll need to unmount volumes frequently.
# gpt show disk0
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 629145600 2 GPT part - 48465300-0000-11AA-AA11-00306543ECAC
629555240 262144
629817384 151343200 3 GPT part - 48465300-0000-11AA-AA11-00306543ECAC
781160584 262151
781422735 32 Sec GPT table
781422767 1 Sec GPT header
Index 1 belongs to Apple for EFI; 2 is my original, bootable HFS volume for Mac OS X; 3 is my test volume that I’m trying to do away with. Let’s trash #3.
# gpt remove -i 3 disk0
gpt remove: /dev/disk0: 1 partition(s) removed
In theory, one could now use diskutil to resizeVolume (per this tip). Theory may or may not work out. On my first run through, I found that diskutil complained that my disk wasn’t capable of being resized. When reproducing this for the tip, it let me do it.
# diskutil resizeVolume disk0s2 300G
Started resizing on disk disk0s2 Celaeno
...
If it doesn’t work, you can always put it back to a Boot Camp-safe state and let the Boot Camp Assistant have another go at it. Using the “size” parameter from the show command above, issue the add command, tell it to make a Windows partition, and Boot Camp should now play nice.
# gpt add -s 151343200 -t windows disk0
At this point, you’ll need to reboot back to disk0 to use the Boot Camp Assistant. Oddly, while everything else prefers (or demands) not to tamper with the boot device, Boot Camp requires the boot device.
thanx for the help,
i did everything as written above, but when trying to “gpt add…” it complained about something with the MBR point(sorry folks im not too much into that stuff yet).
after that i restarted and booted regularly into my macosx. Boot Camp offered me to resize my Disk to 73GB, after doin that and restartin, my HD was not only resized to 73GB but to the full 93,...GB thus the original size of my HD
i dont know why it worked, though i’m glad it did of course ..
.zy
Thank you for your very detailed explanation. Unlike most Apple help sites this isn’t advice like “plug in the power cord”.
However I can not boot from any CD at the moment and this leaves me with none of the partition tools mentioned above…
This is what happened: After trying to get a friends mac mini to dual-boot macosx and winxp with the WindowsNT Bootloader delivered with WinXP, and failing I tried Acronis DiskDirector. It removed Hal.dll, leaving me with no possibility to boot WinXP nor MacOsX and I also can not boot from any CD!!
Please help me!!!
yeah I had the same experience as zy, so when i got those ‘add’ and ‘resize’ errors i booted into osx and it all worked out:
-as per above unmount all partitions
-remove all the unwanted partitions
-reboot into OS X from hd
-run boot camp, make a windows partition
-reboot, run boot camp, and it will propose to restore the disk to full capacity
-(optional) repartition your disk, play around some more, make another mistake, and repeat previous instructions.
great post thanks!
bob
just wanted to say thanks!
followed all steps above minus the resize which I did outside of terminal and in Disk Utility itself, and all worked perfectly. Top post – thanks again!
a
Could I do this to delete a partition that boot camp created but now I am unable to delete (it would mount).?
I had the same issue with my hard drive, when I tried to use boot camp it gave me some error. I am pretty sure the extensive solution you have can be cut down simply by going into Disk Utility, Clicking on your main hard drive, then Partition tab, Click on the partition, in my case disk0s3, and click the minus button beneath it. Then it will remove the partition, click back on your Main hard drive, and adjust the size, which it should do automatically but I have heard of it being a pain. It was pretty simple and I think running back through all of these processes can be slimmed down for inexperienced mac users.
I am using boot camp2.0 on macbook with os 10.5.2. Boot camp failed to make a bootable partition and then would not give me back the 10 Gigs it set asside for windozz partition. I was able to use the partiton manager in unbutu to get back my space and then used disk utility to regain all of it in one partition.
Now boot camp refuses to give it another try. I keep getting“The startup disk cannot be partitioned or restored to a single partition.The startup disk must be formatted as a single Mac OS Extended (Journaled) volume or already partitioned by Boot Camp Assistant for installing Windows.What can I do. Is there a preference file that is bad. I only have one partition and it is all Mac OS Extended (journaled). I want boot camp to partition my drive again so I can have another try at installing unbuntu.
Hi there – I’m a fairly seasoned computer user and am pretty emberassed to have this happen to me…
When I used Boot Camp Assistant to remove the Windows partition (which in all fairness it hadn’t created itself, I had before) and make it all one OS X partition – it seems to have deleted the WRONG PARTITION?
Instead of my usable OS X, I end up with an unusable Win partition with a boot loader which can’t find the OS, and now I’m desperately trying to make it an HFS+J partition again and recover the filesystem… have you ran into that the Boot Camp Assistant would fail this catastrophically?
You’ll need something like DataRescue II to get the data back. You’ll need to run a scavenge recovery, most likely.
The only hope I can see of getting the data back is knowing exactly which block (I do mean exactly) the partition used to start on and then edit the partition map manually to start at that location again. Running the BCA again will not do this; you’ll need to do it on the CLI and — again — you’ll need to know the exact block it used to start on and hope nothing’s been written to that end of the disk.
Or restore from backup.
Hi, I tried doing a windows partition using boot camp assistant and everytime during the partition process, a screen appears saying to restart the computer. Once I restart the computer and go back into boot camp assistant, there are no options to install windows, it just says to partition it again. How do i regain the gb’s that were “partitioned” previously?
Post new comment