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 28 of 102 last Next
  • by Gatormac2112,

    Gatormac2112 Gatormac2112 Jan 23, 2013 7:01 PM in response to Christopher Murphy
    Level 1 (0 points)
    Jan 23, 2013 7:01 PM in response to Christopher Murphy

    Great, thanks for the quick response. Going to try it now.

  • by autnagrag,

    autnagrag autnagrag Jan 23, 2013 7:13 PM in response to autnagrag
    Level 1 (49 points)
    Mac OS X
    Jan 23, 2013 7:13 PM in response to autnagrag

    I've been reading the man pages for GDISK (8) at http://www.rodsbooks.com/gdisk/gdisk.html

     

    I'm a bit daunted. I especially don't see how to apply what you suggest, and I don't understand how I access the three different menus of gdisk that are detailed there. I'm going to leave work & go home, entailing a reboot, and see what is up here when I do that. Also I'll check diskutil list after booting.

  • by Christopher Murphy,

    Christopher Murphy Christopher Murphy Jan 23, 2013 7:28 PM in response to autnagrag
    Level 3 (555 points)
    Jan 23, 2013 7:28 PM in response to autnagrag

    diskutil list

    sudo gdisk /dev/diskX

     

    Replace X with the number for the whole disk that contains the Windows partition. Once you hit return, you will be in gdisk, in interactive mode. Use ? <enter> to display the main menu. You're after the recover/transformation menu, so that's r <enter>. Again use ? to display the options in this menu, you'll find the option to create a new hybrid MBR is h, and which point you'll be asked to input the information relevant to your disk. For those with 4 or fewer partitions, add all except partition 1. It's trickier when you have 5 or more partitions. Everyone should add EFI GPT to the first MBR entry (that's a y then enter). Once you're done that it asks for each partition you're adding what hex code to use, just enter the default, gdisk grabs the right code from the GPT; and asks whether it should be flagged bootable or not. Only the Windows partition should be flagged bootable.

     

    When you're back at the prompt "Recovery/transformation command (? for help):" you can type p <enter> and o <enter> which will display the GPT and the new hybrid MBR. This is all in memory, it's not yet commited to disk so you can post those two things and just leave gdisk waiting in the background (hide Terminal if you want). When you're ready to write it out, w <enter> and then reboot after gdisk quits.

  • by maghikal,

    maghikal maghikal Jan 24, 2013 12:08 AM in response to Christopher Murphy
    Level 1 (0 points)
    Jan 24, 2013 12:08 AM in response to Christopher Murphy

    Hello again Cristopher!

     

    So i wasn't able to boot windows from a USB stick like i figured. i get the No Boot Device Inserted error like i remember getting when i used an external DVD drive.

    I'm not sure what else to do. i'm probably going got go ahead and reinstall windows

  • by Christopher Murphy,

    Christopher Murphy Christopher Murphy Jan 24, 2013 12:15 AM in response to maghikal
    Level 3 (555 points)
    Jan 24, 2013 12:15 AM in response to maghikal

    Only relatively recent Macs can boot Windows off a USB stick. My 2008 MBP can't. I *think* the 2011 MBP can but I haven't actually tried it. In any case, the USB stick must be prepared by Boot Camp Assistant on the computer that will be booted, for the USB stick to be bootable.

  • by maghikal,

    maghikal maghikal Jan 24, 2013 12:28 AM in response to Christopher Murphy
    Level 1 (0 points)
    Jan 24, 2013 12:28 AM in response to Christopher Murphy

    i actually used the Boot Camp Assistant to create an Install USB withan ISO i donwlaoded straight from Microsoft

  • by autnagrag,

    autnagrag autnagrag Jan 24, 2013 7:41 AM in response to Christopher Murphy
    Level 1 (49 points)
    Mac OS X
    Jan 24, 2013 7:41 AM in response to Christopher Murphy

    Thank you for drawing my attention to the apparent drive identity change. After reboot, my former disk0 is now disk1.

     

    Since I do not want or need the Recovery HD partition anyway, I was considering

     

    $ diskutil mergePartitions JHFS+ "MtnLion1" disk1s2 disk1s3

     

    Then I would only have 4 partitions. Would you advise me to do that using diskutil, or to get rid of the offender in the process of using gdisk as you detail so clearly? If I understand you, when I am adding partitions to the about to be created new MBR hybrid, I would simply omit addition of the Recovery HD partition, which is now at

     

    disk0s3

     

    ?

  • by Gatormac2112,

    Gatormac2112 Gatormac2112 Jan 24, 2013 7:41 AM in response to Christopher Murphy
    Level 1 (0 points)
    Jan 24, 2013 7:41 AM in response to Christopher Murphy

    I backed up the drive to a network drive so I'm just now getting started. I followed the directions but didn't get the EE or 07 default HEX code that you stated in the first set of instructions on the first page of this thread. Instead I got this:

     

    Screen Shot 2013-01-24 at 9.39.28 AM.png

    Not wantng to bork it even worse I decided to let it sit until confirmation from you that its ok to proceed.

  • by Christopher Murphy,

    Christopher Murphy Christopher Murphy Jan 24, 2013 10:48 AM in response to autnagrag
    Level 3 (555 points)
    Jan 24, 2013 10:48 AM in response to autnagrag

    Actually it's a good point that you can use diskutil mergepartitions to do this. Just make sure you have a backup.

     

    The man page makes it clear that:

     

    All data on merged partitions other than the first will be lost.

    So make really sure that the first partition is the OS X partition you want to keep.

     

    Data on the first partition will be lost as well if the force argument is given.

    So don't use force.

     

    However, realize that this merge will only grow the OS X partition into the Recovery HD partition. You have much, much more free space after the Recovery HD that this command will not recapture. For that you'll need to use diskutil resizevolume after you've mergedpartitions.

  • by Christopher Murphy,

    Christopher Murphy Christopher Murphy Jan 24, 2013 10:52 AM in response to Gatormac2112
    Level 3 (555 points)
    Jan 24, 2013 10:52 AM in response to Gatormac2112

    That 2nd partition is your OS X partition. The hex code is AF. So just accept the default. The next question about it will be whether to make it bootable, and the answer is no.

     

    The following partition, #3, is your Recovery HD partition, the hex code is AB, you should accept that as default, and also do not make it bootable.

     

    The last partition, #4, is Windows, accept the 07 default, do make this one bootable.

     

    It's not strictly necessary to add OS X and Recovery HD partitions to the hybrid MBR. However I have some reason to believe that unsync'd hybrid MBRs and GPTs is causing some Apple utility to try to fix it, which can subsequently cause data loss. I haven't figured that part out at all because I have never seen a before MBR/GPT just prior to an OS upgrade that goes badly. So whenever possible I recommend people mimic Apple's version of a hybrid MBR, which is what I'm doing in this case.

  • by autnagrag,

    autnagrag autnagrag Jan 24, 2013 11:22 AM in response to Christopher Murphy
    Level 1 (49 points)
    Mac OS X
    Jan 24, 2013 11:22 AM in response to Christopher Murphy

    That turns out to be a tricky business, making sure one has a backup.

     

    Winclone 3.7 kicks an error citing partition 5 as the cause. I'm negotiating with the publisher.

     

    It amazes me how full of surprises can be the experience of trying to recover from creating an extra partition on a Bootcamp drive, whether willfully, as did the OP (original poster) or inadvertently, as did I when I failed to scrutinize the activity of Carbon Copy Cloner adequately.

  • by Christopher Murphy,

    Christopher Murphy Christopher Murphy Jan 24, 2013 11:36 AM in response to autnagrag
    Level 3 (555 points)
    Jan 24, 2013 11:36 AM in response to autnagrag

    One method to backup that I find useful in cases like this, is a block copy. But you need a disk with at least as much free space on it, as the entire disk you're backing up. In your case, the disk to backup is 500GB, so you would need a 2nd drive with at least 500GB of free space. This backup method is inefficient because it includes free space and deleted files, literally every sector whether it's used or not, is backedup. But the advantage is, it's an exact snapshot, and easy to restore. Basically it's a sector copy, although the performance is faster if you specify a slightly larger block size (multiple sectors at a time). The command is dd.

     

    You can use dd from/to a disk, partition, or file, in any combination. So you can turn a disk or partition into a file or vice versa. It's very much like Disk Utility pointed at a volume icon, and telling it to make a DMG of it. Except, this works with any file system. The catch is that the file system must be unmounted, because any mounted/active file system is constantly changing. So you can't make a sector backup of it while small bits are changing.

     

    I can explain more how to do this if this is something you'd actually use, including how to find the mounted volume, unmount it, and how to copy the Windows partition to a file onto another drive. And briefly how to restore it should it be necessary.

     

    But yeah, if the Winclone folks have a work around, that's easier because during their restore, they fix things automatically like the boot loader and BCD, which with a sector/block copy, you have to fix these things manually after a restore if they need fixing (by manually, you use Windows Startup Repair).

  • by Christopher Murphy,

    Christopher Murphy Christopher Murphy Jan 24, 2013 11:39 AM in response to Christopher Murphy
    Level 3 (555 points)
    Jan 24, 2013 11:39 AM in response to Christopher Murphy

    If you're only backing up Windows, then you only need as much free space as the entire Windows partition. FWIW. And the tool I'm referring to do this is dd. Comes with OS X. And it will copy an entire Windows NTFS partition to a file which you can store on any file system, even JHFS+.

  • by Csound1,

    Csound1 Csound1 Jan 24, 2013 1:18 PM in response to Christopher Murphy
    Level 9 (51,412 points)
    Desktops
    Jan 24, 2013 1:18 PM in response to Christopher Murphy

    Hi Chris,

     

    If you want a little more work can you look in on ths thread for me. https://discussions.apple.com/message/21016617#21016617

     

    Thanks

  • by autnagrag,

    autnagrag autnagrag Jan 24, 2013 5:07 PM in response to Christopher Murphy
    Level 1 (49 points)
    Mac OS X
    Jan 24, 2013 5:07 PM in response to Christopher Murphy

    The source volume is now unmounted. It is now at dev/disk0s5. I have a place to put the output file (a JHFS+ volume with much more empty space than needed for the source).

     

    I assume I want to tell dd what its source is – I can't figure that out from the man pages for dd. Perhaps you'll tell me how to navigate to the unmounted volume. Right now I have navigated to /dev and I can see the volume there.

     

    I assume when I'm in the right place, I want to do something like

    rightplace myuser$ dd of=path-to-output-file

     

    Yes? Tell where/if I'm wrong, and how to navigate to the unmounted file so dd will accept it as the source, please.

     

    Wow, do I appreciate your help!

first Previous Page 28 of 102 last Next