I was messing around with running Ubuntu on my Mac and trying very hard to make GRUB boot without rEFInd. I just gave up and decided to somehow delete the old volumes created by Ubuntu. As I did it, the UUID of my volume became all FFFFs! FFFF%$#, I said to myself. Fearing for the worse, I rebooted the computer to see if that really harmed something. It did: there was no boot disk!
before trying anything here, investigate a bit further what is going on in your own environment, Your Mileage May Vary
I'm using a Macbook Air 2014 11", 500GB SSD, using APFS, running on Mojave (though the recovery image was from Yosemite).
Make sure you are pointing to the correct disk (mine was disk0, but you need to check with diskutil).
-
Boot into Internet Recovery (cmd + r on boot) – it takes a while, eventually it will boot.
-
Go to Utilities > Terminal
-
Destroy your GPT table! That won't destroy your data, your data is still physically where it's supposed to be.
a. Use gpt destroy disk0
b. This error showed up before I did that: The partition map needs to be repaired because there's a problem with the EFI system partition's file system and destroying the GPT table fixed (there was something wrong there).
- Recreate the partition table.
Luckily, I have another Macbook Air running Mojave and using APFS (128GB) and I could check the UUIDs of the partition tables on it:
gpt -r show 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 236568496 2 GPT part - 7C3457EF-0000-11AA-AA11-00306543ECAC
236978136 7
236978143 32 Sec GPT table
236978175 1 Sec GPT header
I believe these UUIDs will be the same for macOS Mojave + APFS.
Then you need to readd the partitions.
gpt add -i <index> -b <Start Block> -s <Size> -t <UUID> /dev/disk0
I had to run it like this
gpt add -i 1 -b 40 -s 409600 -t C12A7328-F81F-11D2-BA4B-00A0C93EC93B /dev/disk0
gpt add -i 1 -b 409640 -s 976695387 -t 7C3457EF-0000-11AA-AA11-00306543ECAC /dev/disk0976695387 was the size of the whole free space. What is interesting is that setting this to a lower number gave me an error no space left on device, which gave me relief since I knew data was ok.
Then run diskutil verifyDisk /dev/disk0 and luckily your partition map will be ok.
Reboot and enjoy macOS :) (if it doesn't boot straight to macOS, hit alt while booting to show the disk selection.
I think I lost my Bootcamp partition. No worries though, I was about to get rid of it since I broke Windows EFI already.
Thanks to these random people on the web
https://transscendsurvival.org/2019/02/27/mac-osx-fixing-gpt-and-pmbr-tables/ https://apple.stackexchange.com/questions/305706/os-volume-shows-as-type-ffffffff-ffff-ffff-ffff-ffffffffffff https://apple.stackexchange.com/questions/282550/data-not-backed-up-partition-type-ffffffff-ffff-ffff-ffff-ffffffffffff https://apple.stackexchange.com/questions/221114/how-to-fix-broken-gpt-guid-and-unmountable-no-type-volumes
After successfully recovering the GPT table and not losing all my data.