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 67 of 102 last Next
  • by JuliusMD,

    JuliusMD JuliusMD Dec 31, 2013 12:34 PM in response to Loner T
    Level 1 (0 points)
    Dec 31, 2013 12:34 PM in response to Loner T

    I did not have a recovery partition before.

     

    With a deep search I got the following.

     

     

    The HPFS - NTFS entry seems to be my missing partition

    Capture_deepsearch.PNG

  • by JuliusMD,

    JuliusMD JuliusMD Dec 31, 2013 2:58 PM in response to JuliusMD
    Level 1 (0 points)
    Dec 31, 2013 2:58 PM in response to JuliusMD

    OK, guys, thanks for your help. With testdisk I could retrieve the neccessary files.

     

    Now I will do a clean new win8 bootcamp install with a windows partition larger then 60GB (the small size of the partition was the reason why I had to do the weird partition stuff in the first place).

     

    Now I only have to find out how to install windows 8 in bootcamp on a iMac (21.5.-inch Late 2009) possibly from an iso.

  • by Number88,

    Number88 Number88 Dec 31, 2013 4:25 PM in response to JuliusMD
    Level 3 (750 points)
    Dec 31, 2013 4:25 PM in response to JuliusMD

    Oh well at least you got your files back.

    I presume your iMac has a dvd drive? If so you will have to use that to install Windows after (slowly!) burning the iso to disc, as an image. Though you've done all that once, I'm sure.

  • by PS_STI,

    PS_STI PS_STI Jan 3, 2014 7:39 AM in response to Christopher Murphy
    Level 1 (0 points)
    Jan 3, 2014 7:39 AM in response to Christopher Murphy

    Geez, my hands were trembling when I was doing all the gdisk magic, but it worked for me as well. GREAT THANKS Christopher Murphy!

  • by JustAHobbit,

    JustAHobbit JustAHobbit Jan 4, 2014 1:09 AM in response to Scotch_Brawth
    Level 1 (0 points)
    Jan 4, 2014 1:09 AM in response to Scotch_Brawth

    I Have similar problem. Booting to Win 7 doesn't work. At first, the bootable disk didn't show up, after installing rEFInd, I can now start booting to Win 7, but it tells me "no bootable device" or something like this.

    After entering the commands:

     

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

      1660565888     1269544      3  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC

      1661835432        1880        

      1661837312   291686400      4  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

      1953523712        1423        

      1953525135          32         Sec GPT table

      1953525167           1         Sec GPT header

    Hannos-iMac:~ Hanno$ sudo fdisk /dev/disk0

    Disk: /dev/disk0          geometry: 121601/255/63 [1953525168 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 - 1660156248] HFS+       

    3: AB 1023 254  63 - 1023 254  63 [1660565888 -    1269544] Darwin Boot

    4: 0C 1023 254  63 - 1023 254  63 [1661837312 -  291686400] Win95 FAT32L

    Hannos-iMac:~ Hanno$ diskutil list

    /dev/disk0

       #:                       TYPE NAME                    SIZE       IDENTIFIER

       0:      GUID_partition_scheme                        *1.0 TB     disk0

       1:                        EFI EFI                     209.7 MB   disk0s1

       2:                  Apple_HFS Macintosh HD            850.0 GB   disk0s2

       3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3

       4:       Microsoft Basic Data BOOTCAMP                149.3 GB   disk0s4

     

    Many thanks in forward.

  • by Loner T,

    Loner T Loner T Jan 4, 2014 6:17 AM in response to JustAHobbit
    Level 7 (24,845 points)
    Safari
    Jan 4, 2014 6:17 AM in response to JustAHobbit

    Your fdisk output for partition 4 is the first suspect. You do not have the more-than-4-partitions-on-a-bootcamp-disk syndrome.

     

    Can you run sudo fdisk -e /dev/disk0 and use setpid and flag commands (see man fdisk and look under command mode)?

     

    This should allow you to see the Bootcamp partition in Startup Manager under System Preferences. Page 54/55 of this thread has details, if you need them.

     

    If you get "Missing Operating System" then a Windows Recovery after these steps, may be required.

     

    PS: Curious as to what started your problem. It would help in better understanding of your issue.

  • by JustAHobbit,

    JustAHobbit JustAHobbit Jan 4, 2014 11:29 AM in response to Scotch_Brawth
    Level 1 (0 points)
    Jan 4, 2014 11:29 AM in response to Scotch_Brawth

    fdisk -e /dev/disk0 returns me:

    fdisk: could not open MBR file /usr/standalone/i386/boot0: No such file or directory


    EFI disk showed up in iStat menu, I had not seen that before. Disk utility verfication suggested me a repair and I did it, after that the EFI disk disappeared and I could not boot to windows.

  • by Number88,

    Number88 Number88 Jan 4, 2014 11:49 AM in response to JustAHobbit
    Level 3 (750 points)
    Jan 4, 2014 11:49 AM in response to JustAHobbit

    Is it the same result for

    sudo fdisk -e /dev/rdisk0

     

    Your Bootcamp partition does not appear to be marked bootable. If you perform the "flag 4" command as Loner T suggests it could possibly fix your issue (maybe).

  • by JustAHobbit,

    JustAHobbit JustAHobbit Jan 4, 2014 12:42 PM in response to Number88
    Level 1 (0 points)
    Jan 4, 2014 12:42 PM in response to Number88

    Did following:

    sudo fdisk -e /dev/rdisk0

    Password:

    fdisk: could not open MBR file /usr/standalone/i386/boot0: No such file or directory

    Enter 'help' for information

    fdisk: 1> flag 4

    Partition 4 marked active.

    fdisk:*1>

     

    What next? Still no bootcamp shows up in System Preferences "Startup Disk"

  • by Number88,

    Number88 Number88 Jan 4, 2014 1:35 PM in response to JustAHobbit
    Level 3 (750 points)
    Jan 4, 2014 1:35 PM in response to JustAHobbit

    From memory I think you need to do the flag 4 then type in "write" and hit enter for the changes to take effect.

    You then need to answer Y to the reboot question and then type exit.

    Then you reboot and see what appears in the boot menu when holding the Alt key.

     

    More details here in post 2 (numbered 3 in the post)

    https://discussions.apple.com/thread/2285185

     

    EDIT

    Don't forget to use the rdisk0 rather than disk0

  • by Loner T,

    Loner T Loner T Jan 4, 2014 3:08 PM in response to JustAHobbit
    Level 7 (24,845 points)
    Safari
    Jan 4, 2014 3:08 PM in response to JustAHobbit

    As Number88 said, a write is necessary. You may also want to 'print' before and after you make changes, write and verify the changes using fdisk again before a reboot.

  • by JustAHobbit,

    JustAHobbit JustAHobbit Jan 4, 2014 3:12 PM in response to Scotch_Brawth
    Level 1 (0 points)
    Jan 4, 2014 3:12 PM in response to Scotch_Brawth

    Thank you both alot! Seems like it has fixed my problem Saved me tons of time. Thanks again.

     

     

    /Strange thing is that I can't see Windows in boot options in Mac System Preferences, but it is there when I reboot and hold "alt", also I can boot Windows up fine.

  • by Number88,

    Number88 Number88 Jan 4, 2014 3:17 PM in response to JustAHobbit
    Level 3 (750 points)
    Jan 4, 2014 3:17 PM in response to JustAHobbit

    Thanks for getting back to tell us as it also confirms something in my mind. ie that the type code 0C is ok for a Bootcamp Windows install. I was wondering whether that was true or not.

     

    Maybe a PRAM reset would restore things. I'm sure there's a fix for the Windows option in Startup Disk.

     

    If you've installed rEFInd it may need re-blessing. See the home page for refind on that command.

  • by Loner T,

    Loner T Loner T Jan 4, 2014 3:20 PM in response to JustAHobbit
    Level 7 (24,845 points)
    Safari
    Jan 4, 2014 3:20 PM in response to JustAHobbit

    Can you please post the output of fdisk again? I assume that you did both setpid and flag commands prior to a write.

  • by Christopher Murphy,

    Christopher Murphy Christopher Murphy Jan 4, 2014 3:34 PM in response to Number88
    Level 3 (555 points)
    Jan 4, 2014 3:34 PM in response to Number88

    0x0C is the code Apple's diskutil sets for FAT32 formatted partitions which is what's created from Boot Camp Assistant. Apple has no included code to create NTFS volumes. That's why it's necessary to reformat with the Windows installer before installing Windows.

     

    I've seen two layouts where the 0x07 is replaced by diskutil (used by both Boot Camp Assistant and Disk Utility) with 0x0C. Further the active bit (boot flag) is unset on this partition. 1.) The user creates a 5th partition, thereby causing the hybrid MBR to be replaced with a protective MBR; the user then reasonably deletes this 5th partition thinking that's why Windows is no longer bootable, but while diskutil creates a hybrid MBR it incorrectly sets the Windows partition with type code 0x0C and without active bit set. 2.) The user has some other mismatch between the MBR and GPT, runs Disk Utility "repair disk" on the whole disk device, not merely the HFS+ volume, and this causes diskutil to recreate the hybrid MBR.

     

    Both of these behaviors are wrong. If Windows still boots from type code 0x0C with active bit set then that's fortunate even though it's the wrong code; it's possible Windows 8 could behave differently from Windows 7.

first Previous Page 67 of 102 last Next