I have encountered a nearly identical issue to the one in this question (and this too: Data Not Backed Up, Partition Type: FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF), but my hard drive's main partition is formatted in APFS. When I tried correcting the GUID error as shown in the answer, after reaching the step in which the following command:
gpt add -i 2 -b 409640 -s 372637568 -t APFS /disk0 had to be entered, it returned an error:
usage: gpt add [-b lba] [-i index] [-s lba] [-t uuid] device ....
I cannot boot into macOS, my computer is in internet recovery environment. What's the uuid of the new APFS format? I cannot seem to find it anywhere in the web, and my computer isn't detecting the type of the main macOS partition.
My computer's model: MacBook Pro late 2013.
My data is not backed up and I would really love to recover it.
gpt -r show disk0:
I created a MacOS High Sierra Installation disk, and rebooted to it. The new disk utility does not recognize the disk0s2 partition at all, and
diskutil list included the size of the main osx partition in
GUID_partition_scheme part of the disk. Would it be possible (and how) to recover the data of the deleted partition (s2) if I reinstalled macOS on an existing unused partition (the Linux partition disk0s4)?
... -t 7C3457EF-0000-11AA-AA11-00306543ECAC ...instead of
... -t apfs ...! Maybe your recovery boot system is too old and gpt doesn't recognize the apfs argument. AFAIK only 10.12 and 10.13 recovery system's gpt binary can deal with
... - t apfs ....
gpt add: /dev/disk0: Suspicious MBR at sector 0and
gpt add: /dev/disk0: error: no space available on device
gpt -r show disk0output to check what replaced partition 2!