Screwed up bootloader & partitions -- how to fix?

Discussion in 'MacBook Pro' started by Xcelerate, Jul 27, 2012.

  1. Xcelerate, Jul 27, 2012
    Last edited: Jul 27, 2012

    Xcelerate macrumors regular

    Joined:
    Jul 11, 2008
    #1
    It seems I've screwed something up once more.

    I installed Bootcamp on my Retina MBP, and it was working fine, but I realized I needed more space than I originally allotted it. So I went into disk utility in OS X and shrank my Mac partition by 40 GB. Then I rebooted into Windows and went into its disk utility. The option to expand the Windows partition into the new space was grayed out, so instead I just formatted the new 40 GB into NTFS.

    Then I restarted my Mac and all heck broke loose. It brings me to the screen where you can select which OS to boot into. Normally this screen has three options: OS X, Windows, and Recovery. This time it only showed "Windows". So I selected Windows, but it shows a blue error screen with a frown emoticon :( and restarts immediately. And this is where I'm stuck.

    I've tried resetting PRAM and NVRAM with Option + Cmd + P + R, but apparently the "bootloader" isn't the problem. On a PC I could probably fix all this, but I'm still new to Mac computers, so I have no clue what to do.

    I do have an external USB drive, so if there's something I could download and boot into it to repair everything, that'd be great. Thanks!
     
  2. meme1255 macrumors 6502

    Joined:
    Jul 15, 2012
    Location:
    Czech Republic
    #2
    You could try install OS X on external hard drive & try to access to data on internal HD :)
     
  3. Xcelerate thread starter macrumors regular

    Joined:
    Jul 11, 2008
    #3
    I didn't know you could that. Do I have to buy another copy since my RMBP didn't come with a USB key, or is there somewhere I can download an image of it using my Apple ID?
     
  4. meme1255 macrumors 6502

    Joined:
    Jul 15, 2012
    Location:
    Czech Republic
    #4
    You can try write to Apple support that you have accidentally deleted both OS X and recovery partition and what to do (and ask them for OS X Lion/ML copy)

    Which OS X version did you had? Holding cmd+r during boot does nothing?

    PS for others: rMBP doesnt have internet recovery?
     
  5. Xcelerate thread starter macrumors regular

    Joined:
    Jul 11, 2008
    #5
    Yeah, somehow I changed the boot records to MBR from GPT or something like that (don't really know...)

    Internet recovery works, but I'm trying to repair my disks now instead of reinstalling, but it shows the partitions as having WINDOWS_LDM partition type and when I click "repair disk" it says "Repairing volume failed: Unrecognized file system."
     
  6. meme1255 macrumors 6502

    Joined:
    Jul 15, 2012
    Location:
    Czech Republic
    #6
    If you dont mind data, you can format whole harddrive and then install OS X..
     
  7. Xcelerate thread starter macrumors regular

    Joined:
    Jul 11, 2008
    #7
  8. murphychris macrumors 6502a

    Joined:
    Mar 19, 2012
    #8
    Resizing involves two tasks: altering the partition table to account for the change in size and number of partitions, altering the file system (volume) inside a partition to shrink or expand it. One is about the file system (NTFS, HFS+, etc.) and one is about the partition.

    Problem 1: Windows will only modify the MBR (since on Apple hardware it is booting in CSM-BIOS mode, not EFI mode, an MBR is required by Windows for boot volumes). It will not modify the GPT that Mac OS X uses. As soon as the MBR and GPT contain conflicting information, bad things ensue.

    Problem 2: Mac OS X Disk Utility, up to at least 10.7.4, will allow you to create more than 2 visible partitions (either adding partitions, or resizing others and then adding), and this will obliterate the MBR and render Windows unbootable. In reality, there are always two additional hidden partitions on a Mac: EFI System, and Recovery HD. So if you create 3+ partitions, you actually have a 5 partition disk. And MBR can only hold 4 partitions. The way Apple chooses to handle this situation, is they don't recreate a hybrid MBR at all, rendering Windows unbootable.

    Now in the first case, Windows can't be expected to work any differently because hybrid MBR's are non-standard, and technically violate the UEFI spec, and even depart from Apple's own developer technotes advising against their use. Yet Boot Camp Assistant creates them, and they are required by Apple's CSM-BIOS implementation.

    In the 2nd case, Disk Utility is flat out doing the wrong thing. It should either prevent users from modifying disks with Windows volumes, or it should tell them that Windows will become unbootable if they insist on proceeding.
     
  9. PhuDaiKa macrumors newbie

    Joined:
    Aug 3, 2013
    #9
    Hi Xcelerate & murphychris

    I read your guide on how to repair the partition table, but am stuck with using the tool GTP fdisk.

    My problem is similar to Xcelerate's in that I accidentally modified my whole drive into LDM in windows and then rebooting. (I was trying to create a new partition in windows but did not read the pop-up message clearly enough).
    What I have now is a MBR only drive, but I cannot boot into windows 7 either.

    I cannot go into either OS, but I can get into Internet Recovery. The only problem is, how can i run GPT fdisk in there? Or better still, can you explain to me how I can go about recovering access to my Mac OSX.

    My HD is 756GB in size and exist like so from memory:

    1. Mac OSX ~352gb
    2. Recovery partition for OSX
    3. Bootcamp ~300gb
    4. Empty partition ~72gb

    I have a bootable Linux Mint distro if we can use that. All I need is to recover my OSX and recovery partition if possible.

    Please see my attachment for the results of the commands I did manage to get.
     

    Attached Files:

  10. murphychris macrumors 6502a

    Joined:
    Mar 19, 2012
    #10
    I'd read up on gdisk's ablity to do certain repairs, to see if the backup (secondary) GPT is valid and can be used to fix the problem by writing a new GPT. The MBR from the gdisk command says you have three linux swap partitions only and I'm guessing that's wrong and thus not very useful so I'd focus on the GPT. If that isn't repairable, then you are in data recovery territory with testdisk.
     
  11. PhuDaiKa macrumors newbie

    Joined:
    Aug 3, 2013
    #11
    I see, so I need to try use GPT fdisk I assume? Sorry for my stupidity, but how can I run it as a stand alone? I dont have any access to my HD other than Internet Recovery, and even that doesnt let me do any repairing using Disk Utilities.
     
  12. murphychris macrumors 6502a

    Joined:
    Mar 19, 2012
    #12
    You can use a linux livecd to do this, whatever you're most familiar with is fine. If it doesn't come with gdisk, you can use that distros package installer to install it since it's a live environment. Otherwise you can use Fedora 19 Desktop 64-bit which will boot a Mac from a USB stick (or CD-DVD), and it comes with gdisk already; it's also a live environment so you can 'yum install testdisk' if it gets to that point.
     

Share This Page