MacOS – Can’t boot into Mac OS after Windows install via Bootcamp

bootcampmacospartition

I just installed Windows 10 successfully via BootCamp. Now I am neither able to boot into OSX, nor is its partition shown anywhere.

Turns out the issue occurs because of a mistake I made during the Windows installation. Once Bootcamp created the BOOTCAMP partition and restarted the system, I noticed that there was an additional small-sized partition created (~600 MB) just before the BOOTCAMP partition. Instead of ignoring it, I deleted and recreated the bootcamp partition from Windows Setup. Now I am only able to boot into Windows 10.

Now my question is: How can I recreate the deleted partition in order to be able to reboot into OS X?

I booted into Recovery Mode using cmd + r and ran diskutil list. Here is the outcome:

enter image description here

Besides, the Macintosh HD partition is also shown in Disk Utility:

enter image description here

The Recovery Mode even gives me the option to boot into my Mac partition, but doing so results in a black screen.

I am grateful for any suggestions out of this misery.


Edit 1

Output of gpt -r show /dev/disk0

bash-3.2# gpt -r show /dev/disk0
    start      size index contents
        0         1       PMBR
        1         1       Pri GPT header
        2        32       Pri GPT table
       34         6
       40    409600     1 GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
   409640 408928144     2 GPT part - 53746F72-6167-11AA-AA11-00306543ECAC
409337784        72
409337856     32768     3 GPT part - E3C9E316-0B5C-4DB8-817D-F92DF00215AE
409370624  80863232     4 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
490233856       863
490234719        32       Sec GPT table
490234751         1       Sec GPT header

Output of `diskutil cs list

-bash-3.2# diskutil cs list
CoreStorage logical volume groups (1 found)
|
+-- Logical Volume Group 017D5AE8-30F7-45E1-879E-BB02C0EC3DC1
    =========================================================
    Name:         Macintosh HD
    Status:       Online
    Size:         209371209728 B (209.4 GB)
    Free Space:   35655680 B (35.7 MB)
    |
    +-< Physical Volume FB261C56-1F49-4690-9B15-8C4EAA4770B0
    |   ----------------------------------------------------
    |   Index:    0
    |   Disk:     disk0s2
    |   Status:   Online
    |   Size:     209371209728 B (209.4 GB)
    |
    +-> Logical Volume Family A62719EC-A4E5-4821-B7E0-831444CC3...
        ----------------------------------------------------------
        Encryption Status:       Unlocked
        Encryption Type:         None
        Conversion Status:       NoConversion
        Conversion Direction:    -none-
        Has Encrypted Extents:   No
        Fully Secure:            No
        Passphrase Required:     No
        |
        +-> Logical Volume D0DEC2A0-0E60-49B1-9758-40E7677A5346
             Disk:                  disk2
             Status:                Online
             Size (Total):          209000005632 B (209.0 GB)
             Conversion Progress:    -none-
             Revertible:            Yes (no decryption required)
             LV Name:               Macintosh HD
             Volume Name:           Macintosh HD
             Content Hint:          Apple_HFS`

Best Answer

The small partition you've deleted is your on-board Recovery HD. But deleting it isn't the real reason why you can't boot. You hosed your GUID partition table by manipulating it from inside Windows 10.

The basic steps you have to execute are:

Preparation:

  • Detach any external drive (especially an external Time Machine backup drive).
  • Restart to Internet Recovery Mode by pressing alt cmd R at startup.
    The prerequisites are the latest firmware update installed, either ethernet or WLAN (WPA/WPA2) and a router with DHCP activated.
    On a 50 Mbps-line it takes about 4 min (presenting a small animated globe) to boot to a recovery netboot image which usually is loaded from an apple/akamai server.

    I recommend ethernet because it's more reliable. If you are restricted to WIFI and the boot process fails, just restart your Mac until you succeed booting.

    Alternatively you may start from a bootable installer thumb drive (Mavericks or Yosemite) or a thumb drive containing a full system (Mavericks or Yosemite).

Modify GUID partition table:

  • Open in the menubar Utilities/Terminal

First you should get an overview of your disks and the partition layout:

  • Enter diskutil list, diskutil cs list and gpt -r show /dev/disk0

    diskutil list:

    bash-3.2# diskutil list
    /dev/disk0
       #:                       TYPE NAME               SIZE      IDENTIFIER
       0:      GUID_partItion_scheme                   *251.0 GB  disk0
       1:                        EFI EFI                209.7 MB  disk0s1
       2:          Apple_CoreStorage                    209.4 GB  disk0s2
       3:         Microsoft Reserved                     16.8 MB  disk0s3
       4:       Microsoft Basic Data BOOTCAMP            41.4 08  disk0s4
    /dev/disk1
       #:                       TYPE NAME               SIZE      IDENTIFIER
       0:     Apple_partition_scheme                     *1.3 GB  disk1
       1:        Apple_partition_map EFI                 30.7 KB  disk1s1
       2:                  Apple_HFS OS X Base System     1.3 GB  disk1s2
    /dev/disk2
       #:                       TYPE NAME               SIZE      IDENTIFIER
       0:                  Apple_HFS Macintosh HD      *209.0 GB  disk2
    
    /dev/disk3 - /dev/disk13 part of the Recovery System
    

    diskutil cs list:

    -bash-3.2# diskutil cs list
    CoreStorage logical volume groups (1 found)
    |
    +-- Logical Volume Group 017D5AE8-30F7-45E1-879E-BB02C0EC3DC1
        =========================================================
        Name:         Macintosh HD
        Status:       Online
        Size:         209371209728 B (209.4 GB)
        Free Space:   35655680 B (35.7 MB)
        |
        +-< Physical Volume FB261C56-1F49-4690-9B15-8C4EAA4770B0
        |   ----------------------------------------------------
        |   Index:    0
        |   Disk:     disk0s2
        |   Status:   Online
        |   Size:     209371209728 B (209.4 GB)
        |
        +-> Logical Volume Family A62719EC-A4E5-4821-B7E0-831444CC3...
            ----------------------------------------------------------
            Encryption Status:       Unlocked
            Encryption Type:         None
            Conversion Status:       NoConversion
            Conversion Direction:    -none-
            Has Encrypted Extents:   No
            Fully Secure:            No
            Passphrase Required:     No
            |
            +-> Logical Volume D0DEC2A0-0E60-49B1-9758-40E7677A5346
                 Disk:                  disk2
                 Status:                Online
                 Size (Total):          209000005632 B (209.0 GB)
                 Conversion Progress:    -none-
                 Revertible:            Yes (no decryption required)
                 LV Name:               Macintosh HD
                 Volume Name:           Macintosh HD
                 Content Hint:          Apple_HFS
    

    gpt -r show /dev/disk0:

    bash-3.2# gpt -r show /dev/disk0
        start      size index contents
            0         1       PMBR
            1         1       Pri GPT header
            2        32       Pri GPT table
           34         6
           40    409600     1 GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
       409640 408928144     2 GPT part - 53746F72-6167-11AA-AA11-00306543ECAC
    409337784        72
    409337856     32768     3 GPT part - E3C9E316-0B5C-4DB8-817D-F92DF00215AE
    409370624  80863232     4 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
    490233856       863
    490234719        32       Sec GPT table
    490234751         1       Sec GPT header
    
  • Unmount the CoreStorage volume first and then the main disk:

    diskutil umountDisk /dev/disk2
    diskutil umountDisk /dev/disk0
    
  • then delete the Windows partitions on your main disk with gpt:

    gpt remove -i 4 /dev/disk0
    gpt remove -i 3 /dev/disk0
    

    If you get an error "gpt remove: unable to open device '/dev/disk0': Resource busy" trying to remove a second (or third) partiton just repeat

    diskutil umountDisk /dev/disk2
    diskutil umountDisk /dev/disk0
    

    After deleting or adding a partition with gpt the system sometimes|often|always tries to immediately mount all remaining partitions. If you get an error similar to "disk2 is not mounted" trying to unmount disk2, just continue with diskutil umountDisk /dev/disk0.

  • delete the GUID partition table and force create a new one:

    gpt destroy /dev/disk0
    gpt create -f /dev/disk0
    
  • add the EFI-partition and the Macintosh HD Logical Volume Group with gpt

    gpt add -b 40 -i 1 -s 409600 -t C12A7328-F81F-11D2-BA4B-00A0C93EC93B disk0 
    gpt add -b 409640 -i 2 -s 408928144 -t 53746F72-6167-11AA-AA11-00306543ECAC disk0 
    
  • disk0 and the CoreStorage should be mounted automatically after adding the second volume. Please check this with diskutil list and df. Your CoreStorage volume may have different DiskIdentifier now. After entering diskutil list to get the DiskIdentifier of your CoreStorage volume enter df and check if the file system is mounted. The output is similar to that one:

    User$ df
    Filesystem     512-blocks       Used  Available Capacity   iused     ifree %iused  Mounted on
    ...
    /dev/disk13     6066780416 5444610552  621657864    90% 680640317  77707233   90%  /Volumes/Macintosh HD
    ...
    

    If the CoreStorage wasn't mounted earlier, you may mount it with diskutil mount /dev/disk13 (or whatever the DiskIdentifier of your CoreStorage Volume is).

  • open Disk Utility and verify/repair first the hard drive, then the CoreStorage volume. If the CoreStorage wasn't mounted earlier

Expand the CoreStorage volume:

  • expand the Macintosh HD Logical Volume Group to the full available size of your main disk:

    diskutil cs resizeStack LVUUID size #LVUUID = Logical Volume UUID
    

    In your case (just copy the UUID of the Logical Volume in the "diskutil cs listing" you got earlier and paste it here. The UUID below might be faulty because I OCRed your screenshot):

    diskutil cs resizeStack D0DEC2A0-0E60-49B1-9758-40E7677A5346 0g
    

    If you encounter an error like "Error: -69722: You can't perform this resize unless it has a booter (target partition is probably too small)" here, you have to revert your CoreStorage volume to a normal volume:

    diskutil cs revert LVUUID
    

    In your case:

    diskutil cs revert D0DEC2A0-0E60-49B1-9758-40E7677A5346
    

    Then quit Terminal by entering exit and open Disk Utility. Mount the volume Macintosh HD if unmounted and verify/repair it. Choose the hard disk and then the partition tab. Expand the volume with the slider to the full size of your hard disk.

Recreate Recovery HD

  • now try to boot to Macintosh HD
  • by reinstalling Lion with the latest Lion installer (10.7.5) your Recovery HD will be recreated. Your data and already installed applications shouldn't be affected by reinstalling Lion. If you had no CoreStorage volume, you may use Recovery Partition Creator 3.8 instead.

Reinstall Windows 10

  • Install Windows 10 with the Boot Camp Assistant

If you run into problems please add a comment with @klanomath