MacOS partition shows up as FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF (Mojave) I suspect this this may be  a duplicate, but I'm not sure what I should do considering almost everyone else has another macOS version or other partition size and I'm not sure how to generalize another answer to my setup.

So I wanted to delete a Linux partition back to APFS on my main HDD, but it split up the APPLE SSD SM0256F Media. I'm still on my macOS system, but I know that if I reboot I won't be able to access it. I've made a backup but would like to make the partition bootable/accessable since I can't backup programs etc. I still have a 16GB USB drive for use if that's necessary. Also Macintosh wasnt split up as it is now. Macintosh was the main drive that showed up in Disk utility.






  /dev/disk0 (internal, physical):
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *251.0 GB   disk0
       1:                        EFI EFI                     209.7 MB   disk0s1
       2: FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF               205.8 GB   disk0s2

    /dev/disk1 (synthesized):
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      APFS Container Scheme -                      +205.8 GB   disk1
                                     Physical Store disk0s2
       1:                APFS Volume Macintosh HD            122.9 GB   disk1s1
       2:                APFS Volume Preboot                 45.8 MB    disk1s2
       3:                APFS Volume Recovery                517.0 MB   disk1s3
       4:                APFS Volume VM                      2.1 GB     disk1s4

    /dev/disk2 (external, physical):
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *15.7 GB    disk2
       1:                        EFI EFI                     209.7 MB   disk2s1
       2:       Microsoft Basic Data SD CRUZER               15.5 GB    disk2s2


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  401934440      2  GPT part - FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF
  402344080   87890639         
  490234719         32         Sec GPT table
  490234751          1         Sec GPT header
This solution will work because you already have System Integrity Protection (SIP) disabled.


  Note: The current version of gdisk is version 1.0.4. This is the only version that will recognize Apple's new APFS format. So, if you already have an older version of gdisk already installed, then you will need to download and reinstall before proceeding.


The gdisk package can be downloaded by clicking on this link.
This should place the file gdisk-1.0.4.pkg in your Downloads folder. Before installing this package, enter the command given below in a Terminal application window to remove the quarantine attribute.

xattr -d com.apple.quarantine ~/Downloads/gdisk-1.0.4.pkg


Once gdisk is installed, you will need to enter the commands given below.


  Note: The sudo gdisk /dev/disk0 command may ask for your password.


sudo gdisk /dev/disk0
t
2
AF0A
w
y


An example is given below.

Marlin:startup davidanderson$ sudo gdisk /dev/disk0
Password:
GPT fdisk (gdisk) version 1.0.4

Warning: Devices opened with shared lock will not have their
partition table automatically reloaded!
Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): t
Partition number (1-3): 2
Current type is 'Unknown'
Hex code or GUID (L to show codes, Enter = AF00): AF0A
Changed type of partition to 'Apple APFS'

Command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/disk0.
Warning: Devices opened with shared lock will not have their
partition table automatically reloaded!
Warning: The kernel may continue to use old or deleted partitions.
You should reboot or remove the drive.
The operation has completed successfully.
Marlin:startup davidanderson$ 


After restarting your Mac, you will need to enter the following command to reclaim the free space back to macOS.

sudo diskutil apfs resizeContainer disk0s2 0


When finished, you should enter the following command to enable SIP on your next restart.

sudo csrutil clear