I was trying to install Ubuntu onto my MacBook Pro 2011 (Catalina running via Catalina Patcher) which already had Windows 10 with bootcamp. When I tried to run Windows again, I couldn't so I decided to delete Windows 10 and Ubuntu and just keep MacOS. I deleted the partitions but couldn't get the deleted space to combine with the MacOS partition. When I checked the type, it said unknown type. So I rebooted my computer but when it turned on it started flashing the question mark file. I found a previous question that matched my problem so I followed it.
Data Not Backed Up, Partition Type: FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF
I got to the step where you do gpt remove then I realized I needed my original numbers to be able to do gpt add. Is there any way I can get my boot, data and settings back?
This is my first time posting, I usually read other questions and the answers a few times over but this time I really messed up. Any and all help is very much appreciated. Thank you in advance.
TLDR: Forgot to note down the size and starting before gpt remove.
output from the commands export LC_CTYPE="ASCII";dd if=/dev/disk1 count=1 skip=409640 | vis -c
After running the gpt command that @David Anderson said below. I was able to boot using an external drive and see my MacOS partition. I restarted and was able to boot into my original drive. The only problem is that there seems to be 187.85GB of memory available rather than the full 240GB.
Edit: I was able to remove the "free space" partition from Disk Utility and now have access to all 240GB.
Thank you so much @David Anderson, you saved 4 years worth of my data and settings.
Best Answer
The answer you posted shows the string
NXSB\0\^P\0\0+\M-L\M-;\^B\0\0\0\0
. This can be converted to hexadecimal and ASCII values by entering the commands given below.The output from this command is given below.
The string
2b cc bb 02 00 00 00 00
when byte reversed is the hexadecimal value of 2bbcc2b, which is 45,861,931 in decimal. This means the APFS file system contains 45,861,931 blocks, where a block is 4096 bytes in size. In your case, this can be converted to 512 byte sectors by multiplying by 8. The result is 366,895,448 sectors. In this case, the commands to add the APFS container partition are given below.