So I have MacBook Air late 2015. I’ve been using bootcamp for a while.

Yesterday I installed rEFInd to use triple boot for Linux. Made partition for Linux. Later I decided to delete this partition and extended Macintosh HD. Later when I restarted MacBook it was not able to boot.

I used Internet Recovery and found some threads about this issue:

I tried:

diskutil umountDisk disk0    
gpt remove -i 2 disk0

And when I try to:

gpt add -i 2 -b 409640 -s 322344416 -t 7C3457EF-0000-11AA-AA11-00306543ECAC disk0

it says not enough space or something like that. I got stuck in here.

enter image description here

I fixed my problem by this commands!!

gpt remove -i 3 disk0
gpt remove -i 2 disk0
gpt destroy /dev/disk0
gpt create -f /dev/disk0 
gpt add -b 40 -s 409600 -t C12A7328-F81F-11D2-BA4B-00A0C93EC93B /dev/disk0
gpt add -b 409640 -s 322344416 -t 7C3457EF-0000-11AA-AA11-00306543ECAC /dev/disk0
gpt add -b 361738240 -s 128495616 -t EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 /dev/disk0

After this commands I was able to boot in macOS, no data loss or anything but unfortunately 20 gb is missing from Macintosh HD which was Linux partition at first. After booting to macOS I tried to sudo diskutil apfs resizeContainer disk0s2 0 but it didn’t work. Also Windows Bootcamp is not working properly: when I boot in Windows 10 it says Error code 0xc000000e.



Browse other questions tagged .