Accidently deleted some small sized partitions when installing Windows. OSX Partition wont boot

Solution 1:

Your GUID Partition Table (GPT) look OK. You MBR table appears to have the wrong values. You can correct this by entering the following commands in a Terminal application window. I assume you will be doing this while booted using OS X Internet Recovery.

INPUT=$(printf  "e  1\nee\n\n1\n\nq\ny")
diskutil  unmountdisk  /dev/disk0
fdisk  -e  /dev/disk0  <<<"$INPUT"  &>/dev/null

This will restore your MBR to a Protected MBR (PMBR) which is required for GPT partitioned drives. When finished the command fdisk /dev/disk0 should produce the following output.

Disk: /dev/disk0    geometry: 14751/255/63 [236978176 sectors]
Signature: 0xAA55
         Starting       Ending
 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
------------------------------------------------------------------------
 1: EE    0   0   2 - 1023 254  63 [         1 -  236978175] <Unknown ID>
 2: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
 3: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
 4: 00    0   0   0 -    0   0   0 [         0 -          0] unused      

Solution 2:

You didn't delete any partition. Instead the MBR got bogus by using Windows' Disk Management tool.

Instead of the MBR you should have a pMBR. After removing the bogus MBR you have to destroy and recreate the GUID partition table:

  • Boot to Internet Recovery Mode
  • Open Terminal in the menubar Utilities -> Terminal
  • Get an overview (especially the gpt command is important!):

    diskutil list
    gpt -r show disk0
    
  • Unmount disk0:

    diskutil umountDisk /dev/disk0
    
  • Delete the MBR:

    dd if=/dev/zero of=/dev/disk0 bs=512 count=1
    
  • Destroy the GUID partition table and create a new one:

    gpt destroy disk0
    gpt create -f disk0
    
  • Rebuild all previous GUID partitions:

    gpt add -i 1 -b 40 -s 409600 -t C12A7328-F81F-11D2-BA4B-00A0C93EC93B disk0
    gpt add -i 2 -b 409640 -s 166939584 -t 53746F72-6167-11AA-AA11-00306543ECAC disk0
    gpt add -i 3 -b 167349224 -s 1269536 -t 426F6F74-0000-11AA-AA11-00306543ECAC disk0
    gpt add -i 4 -b 168620032 -s 68356096 -t EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 disk0
    

    If you get a resource busy error after one of the steps, just unmount disk0 again with

    diskutil umountDisk /dev/disk0
    

Depending on your Mac model this will render your Windows installation unbootable. Check one of David Anderson answers how to restore a proper MBR entry to boot Windows if you have a MBR-bootable Mac (in contrary to GUID-bootable Macs since ~2013).