My question is very similar to this thread, but my situation is slightly different.
I have been successfully dual-booting OS X and Ubuntu for some time now with 2 partitions. I managed the partitions using OS X Disk Utility to avoid any partition table errors that Linux may incur given the new APFS structure.
Recently, I decided to shrink the OS X partition and create a 3rd partition as a dedicated swap partition for Ubuntu. Again, I managed the partitions in OS X Disk Utility to avoid errors. I successfully added the swap partition in Ubuntu (I am sure the correct partition was specified) and all seemed well. However, after I rebooted, the boot manager (stock, not rEFInd) was no longer showing OS X as a boot option. I decided to use gdisk (thank you Rod Smith for your incredible recovery tools!) to check the table structure, and it seems that the OS X partition is still recognized, but has been given the partition code FF. As far as I can tell the sectors all look good, leaving me to believe that all of my data is present. Unfortunately, I don't have a backup because my backup drive recently crapped out. Lucky me.
Can I simply change the type code of the OS X partition to rescue my data? From my understanding, APFS doesn't quite work that way.
Here is my output from gdisk -l:
Partition table scan: MBR: protective BSD: not present APM: not present GPT: present Found valid GPT with protective MBR; using GPT. Disk /dev/sda: 488397168 sectors, 232.9 GiB Model: Crucial_CT250MX2 Sector size (logical/physical): 512/4096 bytes Disk identifier (GUID): 37FE5D3B-875C-471A-B4FC-A4887DDA4659 Partition table holds up to 128 entries Main partition table begins at sector 2 and ends at sector 33 First usable sector is 34, last usable sector is 488397134 Partitions will be aligned on 8-sector boundaries Total free space is 13 sectors (6.5 KiB) Number Start (sector) End (sector) Size Code Name 1 40 409639 200.0 MiB EF00 EFI System Partition 2 409640 416425263 198.4 GiB FFFF 3 416425264 449628383 15.8 GiB FFFF 4 449628384 488397127 18.5 GiB 8300
Partition 2 is my OS X partition, partition 3 is my swap partition (not sure why its also marked FFFF instead of 8200?), and partition 4 is the Ubuntu partition.
Here is my output from swapon -s && free to prove I'm not a moron:
Filename Type Size Used Priority /dev/sda3 partition 16601556 435456 -2 total used free shared buff/cache available Mem: 16335648 2089764 374952 51452 13870932 14611436 Swap: 16601556 435456 16166100