dgnhlp

Q: Lost boot ability to OSX and Windows 10

So I had a working bootcamp install of Windows 10 and was able to switch back and forth between WIN10 and OSX. I decided I wanted to also install Linux so I went into OSX and cut a partition off of the OSX install. This caused me to lose ability to boot into Windows 10.

 

Using very limited research and some of the commands found in this thread: Repairing Boot Camp after creating new partition I managed to make things worse and ended up unable to boot to either OS. I ended up installing windows 7 on the partition I created for Linux and that is now the only thing I am able to boot into.

 

Is there anyone who can help me repair my MBR through windows 7 to restore access to my windows 10 and OSX partitions?

 

I appreciate any help in advance!

MacBook Pro

Posted on Aug 23, 2015 12:45 PM

Close

Q: Lost boot ability to OSX and Windows 10

  • All replies
  • Helpful answers

Page 1 of 3 last Next
  • by Loner T,

    Loner T Loner T Aug 23, 2015 12:55 PM in response to dgnhlp
    Level 7 (23,828 points)
    Safari
    Aug 23, 2015 12:55 PM in response to dgnhlp

    Please post the output of the following Terminal commands.

     

    diskutil list

    diskutil cs list

    sudo gpt -vv -r show /dev/disk0

    sudo fdisk /dev/disk0

     

    The "sudo" commands will prompt for your password, and it will not be echoed back. You may also see a warning about improper use of "sudo" and potential data loss due to "abuse" of the command.

  • by dgnhlp,

    dgnhlp dgnhlp Aug 23, 2015 12:57 PM in response to Loner T
    Level 1 (0 points)
    Aug 23, 2015 12:57 PM in response to Loner T

    I don't have access to OSX. is there a way i can get to a mac terminal without booting into OSX?

  • by Loner T,

    Loner T Loner T Aug 23, 2015 1:05 PM in response to dgnhlp
    Level 7 (23,828 points)
    Safari
    Aug 23, 2015 1:05 PM in response to dgnhlp
  • by dgnhlp,

    dgnhlp dgnhlp Aug 23, 2015 1:40 PM in response to Loner T
    Level 1 (0 points)
    Aug 23, 2015 1:40 PM in response to Loner T

    I dont have an external disk or another mac. And when I try to boot into recovery mode I get an error code -5101r.

     

    Is there windows equivalent commands I can run in the CLI that do the same as those?

  • by Loner T,

    Loner T Loner T Aug 23, 2015 3:25 PM in response to dgnhlp
    Level 7 (23,828 points)
    Safari
    Aug 23, 2015 3:25 PM in response to dgnhlp

    Install GPT Fdisk (http://sourceforge.net/projects/gptfdisk/) on the Windows side and run gdisk32.exe from an elevated CMD prompt window. When prompted, use '0:' as the disk (zero-colon without the quotes) and post the output of 'p' command.

  • by dgnhlp,

    dgnhlp dgnhlp Aug 23, 2015 5:09 PM in response to Loner T
    Level 1 (0 points)
    Aug 23, 2015 5:09 PM in response to Loner T

    Capture.PNG

  • by dgnhlp,

    dgnhlp dgnhlp Aug 23, 2015 5:10 PM in response to Loner T
    Level 1 (0 points)
    Aug 23, 2015 5:10 PM in response to Loner T

    Capture.PNG

  • by Loner T,

    Loner T Loner T Aug 23, 2015 5:58 PM in response to dgnhlp
    Level 7 (23,828 points)
    Safari
    Aug 23, 2015 5:58 PM in response to dgnhlp

    1. You do not have a GPT 2 entry which is typically OS X. GPT2 should start at 409640 and end at 195715463.

    2. Do not modify the GPT or MBR, it will lead to catastrophic failures.

    3. Type 'r' (recovery).

    4. Type 'o' (show hybrid MBR)

    5. Post the output.

  • by dgnhlp,

    dgnhlp dgnhlp Aug 23, 2015 6:04 PM in response to Loner T
    Level 1 (0 points)
    Aug 23, 2015 6:04 PM in response to Loner T

    Capture.PNG

  • by Loner T,

    Loner T Loner T Aug 23, 2015 6:54 PM in response to dgnhlp
    Level 7 (23,828 points)
    Safari
    Aug 23, 2015 6:54 PM in response to dgnhlp

    Using both the GPT and Hybrid MBR to reconstruct the full GPT gives us the following disk layout. Please verify the numbers before we start the fix.

     

    GPTTypePartitionType CodeStartEndMBRStartEndGPT SizeMBR SizeGPT-MBR Diff
    1EFIEF0040409639409600
    2OSXAF00409640195715463195305824
    3Recovery HDAB001957154641969849992195715464196984999126953612695360
    4Shared?7003196986880390836223193849344193849344
    5BOOTCAMP70039083622497677311943908362249767731195859368965859368960

     

     

    EFI - 200MB, OSX - 93GB, Recovery HD - 605MB, Shared - 92GB, Bootcamp - 279Gb.

  • by dgnhlp,

    dgnhlp dgnhlp Aug 23, 2015 9:16 PM in response to Loner T
    Level 1 (0 points)
    Aug 23, 2015 9:16 PM in response to Loner T

    yes that looks correct. the "Shared?" is the partition i created for linux which ended up now having windows 7 on and is the only working partition (although it does take forever to start to boot into it, sits on a gray screen for about a  minute or two before it loads)

  • by Loner T,

    Loner T Loner T Aug 24, 2015 5:49 AM in response to dgnhlp
    Level 7 (23,828 points)
    Safari
    Aug 24, 2015 5:49 AM in response to dgnhlp

    We are going to

     

    1. recreate the missing GPT 2 entry.

    2. delete GPT 4.

    3. create a new GPT 4 (Shared?). This is not your Bootcamp as you can tell by the start/end disk addresses.

    4. create a new GPT 5 (BOOTCAMP). This is the bootable entry in your MBR as shown by the start/end disk addresses.

     

    Your MBR will be untouched leaving Windows bootable.

     

    You need to use the following steps. If you see any error messages during the following steps, please stop and post back here with the error message. The following steps have values from your GPT and MBR output (please verify for any typing errors). The text in parentheses is for informational purpose to describe theaction being taken. Gdisk has one-character commands except when entering numbers.

     

    Rebuild GPT entries using start/end disk addresses

     

    1. P  (print the full list of parts)
    2. N  (new part)
    3. 2  (part 2 - OS X)
    4. 409640 ( - Start offset in sectors or the start point for OSX part)
    5. 195715463 ( - End offset)
    6. AF00 (HFS+ part type)
    7. D (delete)
    8. 4 (part 4 - old Bootcamp)
    9. N (new part)
    10. 4 ( Shared part)
    11. 196986880 ( - Start offset in sectors or the start point for Shared part)
    12. 390836223 ( - End offset)
    13. 0700 (Microsoft Basic Data)
    14. N (new part)
    15. 5 ( Bootcamp part)
    16. 390836224 ( - Start offset in sectors or the start point for Bootcamp part)
    17. 976773119 ( - End offset)
    18. 0700 (Microsoft Basic Data)
    19. P  (print list of all parts just to see what changes will be made)
    20. W (Write the new GPT)
    21. Y  (Yes! really write the new GPT)

    This will delete and re-write the GPT partition info for /dev/disk0s2, /dev/disk0s4 and /dev/disk0s5.


    You should now be able to see OSX and boot into it. Once you are able to verify OSX we can do the next step.

  • by dgnhlp,

    dgnhlp dgnhlp Aug 24, 2015 8:31 AM in response to Loner T
    Level 1 (0 points)
    Aug 24, 2015 8:31 AM in response to Loner T

    Capture.PNG

    I stopped here because you were referring to this as the partition for OSX and it said "current type is 'Microsoft basic data'"

     

    Just wanted to make sure that was okay before continuing?

     

    Thanks for all this help by the way.

  • by Loner T,

    Loner T Loner T Aug 24, 2015 9:50 AM in response to dgnhlp
    Level 7 (23,828 points)
    Safari
    Aug 24, 2015 9:50 AM in response to dgnhlp

    You can ignore the default value that Gdisk shows. Use AF00, since this a new GPT 2 and is pointing to HFS+.

Page 1 of 3 last Next