mx585

Q: Repairing Bootcamp after new partition

Hello,

 

I have the same problem as many here before, but I'm confused about which commands to write into the terminal.

 

Problem: I created a second partition to install OS X El Capitan 10.11.2 besides my main 10.9.5 OS X Mavericks partition on my Macbook Pro Retina Mid 2012. This caused the Windows 8.1 Bootcamp to disappear from the startup selection.

 

Here is a screenshot of the output for the commands:

diskutil list

diskutil cs list

sudo gpt -vv -r show /dev/disk0

sudo fdisk /dev/disk0

Bildschirmfoto 2016-01-19 um 12.06.48.png

I understand that I have to

1. Boot in Local recovery > csrutil disable > reboot normally

2. Correct the MBR somehow like this:

sudo fdisk -e /dev/disk0

p

setpid 4

07

flag 4

p

write

y

 

Are the values for setpid and flag correct for my scenario? I'd like to understand what the code does.

 

Thanks in advance!

MacBook Pro with Retina display, Windows 8, and Bootcamp with MS Windows 8.1

Posted on Jan 19, 2016 4:58 AM

Close

Q: Repairing Bootcamp after new partition

  • All replies
  • Helpful answers

  • by Loner T,

    Loner T Loner T Jan 19, 2016 5:36 AM in response to mx585
    Level 7 (24,307 points)
    Safari
    Jan 19, 2016 5:36 AM in response to mx585

    You have a different issue. You have an extra partition with El Capitan. Is that intentional?

  • by mx585,

    mx585 mx585 Jan 19, 2016 5:48 AM in response to Loner T
    Level 1 (0 points)
    Jan 19, 2016 5:48 AM in response to Loner T

    The system I mainly use is on the Macintosh HD which runs Mavericks. I created an additional partition called "El Capitan" for the respective OSX. I want to run them both.

     

    Lastly my windows bootcamp partition, which is damaged since the partitioning.

     

    I hope this clears things?

  • by mx585,

    mx585 mx585 Jan 19, 2016 7:14 AM in response to mx585
    Level 1 (0 points)
    Jan 19, 2016 7:14 AM in response to mx585

    Another question is: What should I do to go back to the stand alone mavericks partition + bootcamp? I have a time machine backup of the osx, but unfortunately not of the windows partition (not too clever, I know).

  • by Loner T,

    Loner T Loner T Jan 19, 2016 1:26 PM in response to mx585
    Level 7 (24,307 points)
    Safari
    Jan 19, 2016 1:26 PM in response to mx585

    We can make this work, but you need to backup Windows very well, otherwise you will lose your data.

     

    Can you post the output of

     

    sudo dd if=/dev/rdisk0s5 count=1 2>/dev/null | hexdump -C

  • by mx585,

    mx585 mx585 Jan 19, 2016 1:30 PM in response to Loner T
    Level 1 (0 points)
    Jan 19, 2016 1:30 PM in response to Loner T

    Here is the output.

    Bildschirmfoto 2016-01-19 um 22.28.06.png

  • by Loner T,

    Loner T Loner T Jan 19, 2016 1:45 PM in response to mx585
    Level 7 (24,307 points)
    Safari
    Jan 19, 2016 1:45 PM in response to mx585

    El Capitan SIP can cause you issues in the future - About System Integrity Protection on your Mac - Apple Support .

     

    The following steps are non-standard because there is a third user-visible partition. Typically, there are two such partitions in a normal configuration on a single-disk Mac with OS X and Bootcamp. This is fragile and lack of proper backups can lead to potential data loss. Download GPT Fdisk from http://sourceforge.net/projects/gptfdisk/ and install it on the OS X side. The following steps are executed when booted in OS X. If you delete El Capitan in the future, these numbers (3 4 5) will change back to (2 3 4). You will lose visibility to OSX partition from Windows side.

     

    Rebuild MBR to match the new GPT information thus resetting the Hybrid MBR. Use defaults for other questions (like partition codes). The only values that need modifications are the Boot flags and step 10. Accept all other defaults that Gdisk offers. Please see the sample Q&A as an example. These steps can be repeated if you make a mistake before you get to Step 12, otherwise start from Step 1 for these steps. Step 6 has numbers which are typed with a space between the numbers. Please see the sample Q&A before you execute these steps.

    1. Sudo gdisk /dev/rdisk0
    2. P  (Print list of parts)
    3. R  (Recover)
    4. O (print current Hybrid MBR)
    5. H (chooses Hybrid)
    6. Partitions numbers to be hybridized: 3 4 5
    7. Y  (Good for GRUB question)
    8. N  (part 3 boot flag)
    9. N  (part 4 boot flag)
    10. Y  (part 5 boot flag make NTFS bootable partition)
    11. O  (print current Hybrid MBR)
    12. W (Write the new MBR)
    13. Y (Yes! write the new MBR)
    14. Reboot

     

    Here is sample Q&A for this section. Please notice the Press Enter/Return. Accept defaults offered by Gdisk.

     

    Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? (Y/N): Y

     

    Creating entry for GPT partition #3 (MBR partition #2)

    Enter an MBR hex code (default AF or AB): Press Enter/Return

    Set the bootable flag? (Y/N): N

     

    Creating entry for GPT partition #4 (MBR partition #3)

    Enter an MBR hex code (default AB or 0B or 0C): Press Enter/Return

    Set the bootable flag? (Y/N): N

     

    Creating entry for GPT partition #5 (MBR partition #4)

    Enter an MBR hex code (default 07): Press Enter/Return

    Set the bootable flag? (Y/N): Y

     

  • by mx585,

    mx585 mx585 Jan 19, 2016 1:57 PM in response to Loner T
    Level 1 (0 points)
    Jan 19, 2016 1:57 PM in response to Loner T

    Wow, I cannot express enough appreciation to you for taking so much time helping guys like me (that should have known better)!

     

    I'll let you know how things work out!

  • by Loner T,

    Loner T Loner T Jan 19, 2016 2:14 PM in response to mx585
    Level 7 (24,307 points)
    Safari
    Jan 19, 2016 2:14 PM in response to mx585

    No worries. Please post back if you run into any issues with the steps or things do not work.