coarse

Q: Cannot boot into OS X

While I was on my Windows, I sort of messed with the disk management and deleted a 600/621 mb partition in between my OS X partition and bootcamp partition. After trying to go back to OS X, I found that both the OS X and recovery partition are gone, though I can still see the OS X partition on my Windows.

 

Is there anyway to get my Mac to boot back on OS X?

iMac, Windows 8

Posted on Feb 21, 2015 2:32 PM

Close

Q: Cannot boot into OS X

  • All replies
  • Helpful answers

  • by coarse,

    coarse coarse Feb 21, 2015 4:22 PM in response to coarse
    Level 1 (0 points)
    Feb 21, 2015 4:22 PM in response to coarse

    I am able to go to internet recovery and run gpt and fdisk

    picture here

  • by Loner T,

    Loner T Loner T Feb 21, 2015 4:23 PM in response to coarse
    Level 7 (24,825 points)
    Safari
    Feb 21, 2015 4:23 PM in response to coarse

    Yes, it may be possible.

     

    1. What year/model is your Mac? Please use Command+Opt+R if your Mac supports Internet Recovery - OS X: About OS X Recovery - Apple Support.

    or

    2. You can use OS X: Installing OS X on an external volume - Apple Support to boot from an external disk.

     

    Using either method, please post the output of the following commands. For "sudo" commands, enter your password, it will not be echoed back to you.

     

    diskutil list

    diskutil cs list

    sudo gpt -vv -r show /dev/disk0

    sudo fdisk /dev/disk0

  • by coarse,

    coarse coarse Feb 21, 2015 5:33 PM in response to Loner T
    Level 1 (0 points)
    Feb 21, 2015 5:33 PM in response to Loner T

    I have done the last two commands beforehand but without sudo since it would not work. Do you still need the output of diskutil?

     

    Also, my iMac is a 27-inch Late 2011 model. I can perfectly go in internet recovery mode and run terminal from there.

  • by Loner T,

    Loner T Loner T Feb 21, 2015 5:40 PM in response to coarse
    Level 7 (24,825 points)
    Safari
    Feb 21, 2015 5:40 PM in response to coarse

    If you are in Recovery Console, sudo is not required, since you are already root. If you can, the diskutil may be useful for future as a record.

  • by coarse,

    coarse coarse Feb 21, 2015 6:37 PM in response to Loner T
    Level 1 (0 points)
    Feb 21, 2015 6:37 PM in response to Loner T

    Here is the diskutil output and here is the gpt and fdisk output.

    Currently, my iMac is on internet recovery mode though I have access to Windows 8.1 on EFI boot.

     

    The problem I see here is that somehow the larger partition (~800 gb) turned into microsoft basic data. This might have been caused by me deleting the 600 mb partition, but I am not so sure about that.

  • by Loner T,

    Loner T Loner T Feb 21, 2015 6:57 PM in response to coarse
    Level 7 (24,825 points)
    Safari
    Feb 21, 2015 6:57 PM in response to coarse

    The first link does not seem to work. The second link shows EFI, Two Windows partitions and then a HFS+ partition. It also has some free space at the end. Your MBR has been deleted. Manipulating partitions from either DU or Windows causes problems. The 600MB partition is your local recovery HD. Was there a specific reason to delete the 600MB Recovery HD?

  • by coarse,

    coarse coarse Feb 21, 2015 7:08 PM in response to Loner T
    Level 1 (0 points)
    Feb 21, 2015 7:08 PM in response to Loner T

    Here is the fixed link, sorry about that.

     

    I did not know that the 600 mb was the local recovery. I used the disk management program in windows to delete that partition since I thought it was some kind of left over partition. At that point, I only knew I was supposed to have 3 partitions (Mac HD, the 128 mb partition made during Windows installation, and the Windows drive itself.)

     

    After doing so, I learned that sound was not working due to an EFI installation and wanted to install windows via VMware instead to get sound working on Windows. That's when I noticed that I was unable to boot to Mac, and that there was only 1 option to boot from (EFI boot) which lead to Windows.

     

    Is it still possible to fix the Mac partition, and delete the Bootcamp/Windows partition?

  • by Loner T,Helpful

    Loner T Loner T Feb 21, 2015 7:34 PM in response to coarse
    Level 7 (24,825 points)
    Safari
    Feb 21, 2015 7:34 PM in response to coarse

    1. Your Mac does not support UEFI, so a Windows EFI will cause you issues with GPU and Audio, and possibly other devices.

    2. There is no way to install GPT Fdisk in Recovery console. Do you have a second Mac or an external OSX boot disk? Gdisk is the easiest tool to fix this.

  • by coarse,

    coarse coarse Feb 21, 2015 8:03 PM in response to Loner T
    Level 1 (0 points)
    Feb 21, 2015 8:03 PM in response to Loner T

    1. Ahhh, so that explains the igdkmd64.sys bsod I had before when bootcamp installed the Intel drivers.

    2. I do not have any of those, sadly. Though, is it possible to use a GParted live usb and use gdisk from there?

  • by Loner T,Solvedanswer

    Loner T Loner T Feb 21, 2015 8:48 PM in response to coarse
    Level 7 (24,825 points)
    Safari
    Feb 21, 2015 8:48 PM in response to coarse

    If you have the CLI on the Gparted CD/Live CD, you can use that.

     

    Please use the following example, and use the partition code as appropriate for  the specific GPT entries you want to change.

     

    The steps show be

     

    sudo gdisk /dev/disk0

    p (Print)

    t (Change Type codes)

    2

    AF00

    p

    w

    y

     

    Reboot and test.

     

    Here is an example.

    sudo gdisk /dev/disk0

    Password:

    GPT fdisk (gdisk) version 0.8.10

     

    Warning: Devices opened with shared lock will not have their

    partition table automatically reloaded!

    Partition table scan:

      MBR: hybrid

      BSD: not present

      APM: not present

      GPT: present

     

    Found valid GPT with hybrid MBR; using GPT.

     

    Command (? for help): ?

    b back up GPT data to a file

    c change a partition's name

    d delete a partition

    i show detailed information on a partition

    l list known partition types

    n add a new partition

    o create a new empty GUID partition table (GPT)

    p print the partition table

    q quit without saving changes

    r recovery and transformation options (experts only)

    s sort partitions

    t change a partition's type code

    v verify disk

    w write table to disk and exit

    x extra functionality (experts only)

    ? print this menu

     

    Command (? for help): t

    Partition number (1-4): 4

    Current type is 'Microsoft basic data'

    Hex code or GUID (L to show codes, Enter = AF00): 0700

    Changed type of partition to 'Microsoft basic data'

     

    Command (? for help): p

    Disk /dev/disk0: 500118192 sectors, 238.5 GiB

    Logical sector size: 512 bytes

    Disk identifier (GUID): 22749ACF-207D-458E-B255-5DF02C39DC2D

    Partition table holds up to 128 entries

    First usable sector is 34, last usable sector is 500118158

    Partitions will be aligned on 8-sector boundaries

    Total free space is 1325 sectors (662.5 KiB)

     

    Number  Start (sector)    End (sector)  Size       Code  Name

       1              40          409639   200.0 MiB   EF00  EFI System Partition

       2          409640       250801735   119.4 GiB   AF05  OSY-MBP13

       3       250801736       252071271   619.9 MiB   AB00  Recovery HD

       4       252071936       500117503   118.3 GiB   0700  BOOTCAMP

     

    Command (? for help):

     

  • by coarse,

    coarse coarse Feb 21, 2015 10:48 PM in response to Loner T
    Level 1 (0 points)
    Feb 21, 2015 10:48 PM in response to Loner T

    Thank you so much! Somehow, the partition type code was changed to 0700 which caused it to not work.

    I changed it to AF00 and now I can see my Mac HD upon boot selection!

     

    Nothing I can do with the 600mb recovery drive though, hahaha. Unless it's still possible to get back the data as it is still unallocated space.

     

    To those with the same problem, I put GParted live on an external HDD partition and booted it up on my Mac. From there, I ran "sudo gdisk /dev/sda" instead of "sudo gdisk /dev/disk0" and printed ("p") the partition list and looked at my Mac partition. The partition code was set to 0700 so I set the partition code ("t", then select the partition number of my Mac HD) to "af00" (Apple HFS/HFS+) and wrote it ("w".)

     

    After doing so, I rebooted to boot selection, just to make sure it did work properly and found another HD icon show up, which was my Mac HD. No damage done to the data or whatsoever.

  • by Loner T,

    Loner T Loner T Feb 22, 2015 5:12 AM in response to coarse
    Level 7 (24,825 points)
    Safari
    Feb 22, 2015 5:12 AM in response to coarse

    If you boot into OS X and re-install it (http://support.apple.com/kb/PH18872?viewlocale=en_US&locale=en_US) it will get your Recovery HD back. Be careful and backup Windows/BC before you do this.