MacOS – Accidently deleted some small sized partitions when installing WIndows(Bootcamp). OSX Partition wont boot

bootbootcampdisk-utilitymacospartition

I tried to install Windows 8 into my Mac via Bootcamp. I booted into the Windows 8 Installer and had issues formatting the drive that I partitioned for the OS.

Like an idiot, I deleted all of the partitions on my hard drive, except my main OSX partition. I believe the partitions I deleted were 600MB, 3MB, 1GB(Not sure if they were this large). But im certain I deleted one that was 600MB.

After exiting out of the Windows installer, I booted up my Mac again only see the Windows partition as an option. When I go into recovery mode, I see the partition still there, but I cant really interact with it. Does anyone know what I need to do to make my OSX partition bootable again? I went into DU(Recovery Mode) and tried mounting through DU but nothing happens.

diskutil

The image shows my "diskutil list" output. My OSX partition is disk0s1. I am stuck and don’t want to lose my data/am trying to boot into my machine again.

Best Answer

The snap shot of the distutil output helps, but I would have also included the output from the commands:

sudo gpt -r show /dev/disk0
sudo fdisk /dev/disk0

Either command would give me the exact start and size of disk0s1. I have read that the EFI partition is not necessary to boot to OS X. My recovery flash drive does not have an EFI partition and I can boot using it. To create the image you posted, you had to boot your computer and that image does not show a EFI partition either.

The image shows me two things wrong. First, you are suppose to have a GPT partition scheme and what is shown is MBR. (Yes, I know, the letters MBR do not appear in the picture.) Second, the "0xAC" appears where there should be either "0xAF" or "Apple_HFS". This means you probably have a Core Storage partition. I assume you have installed Yosemite.

Assuming your partition is still intact and is a Core Storage partition, then do the following.

First: Run the above commands to get the start and size of the slice. Post something, if you can not understand the output.

Second: Reset the partition scheme back to GPT. Enter the commands:

sudo diskutil unmountDisk /dev/disk0    
sudo gpt create -f /dev/disk0

Third: Restore the desired partition. Assume start and size represent the integers from the first step, enter the commands:

sudo diskutil unmountDisk /dev/disk0    
sudo gpt add -b start -s size -t 53746F72-6167-11AA-AA11-00306543ECAC /dev/disk0

At this point, you should be able to enter the ls command to see a directory listing. If not, check the disk utility to see if the partition is mounted.

Fourth, try to boot the computer. You may need to hold down the option key at startup.

If you can access the partition and even boot the computer, you are not out of the woods yet. You will probably need to backup your stuff and reload the computer from scratch. Yes, reloading can be avoided, but that is the subject for a different question.

Also, you probably want to change the Core Storage partition back to HFS+. See if you can get the computer to boot, then we can address this problem.