MacOS – OS volume shows as type ‘FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFF’ after attempting to delete some Linux partitions—cannot log in

bootdisk-utilitymacospartitionrecovery

I was unable to just delete the partitions left by an old Linux Mint installation by pressing the '-' button in disk utility. I looked online and read that I could reformat them to a journaled format from the command line and then delete it from disk utility. The command was something like diskutil eraseVolume deleteme JFS+ /dev/disk0s4 (and then again for disk0s5, as there were two).

After this command, disk utility showed the two partitions had been reformatted, but I could now see the Recovery HD partition between the two deleteme partitions and the Macintosh HD partition, which meant I could not delete them without deleting the Recovery HD partition, which even I knew was a bad idea.

I checked diskutil list and saw that my main partition was now showing the type 'FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFF', so I was pretty sure something had gone wrong. I backed up my home folder and rebooted to be successfully brought to the login screen, but when I try to log in, it loads for a while before showing me a black screen with a grey no-symbol.

Here are the results of diskutil list and gpt -r show /dev/disk0:

image

For the record I have a 13" Retina MacBook Pro mid-2014 version.

Best Answer

To correct the GUID error in your GPT, you need to start up from OS X Recovery over the Internet or from a USB drive with the macOS Installer flashed on it. To boot into recovery mode press and hold the command(⌘)optionR keys immediately after you turn on your Mac and hear the startup sound. To boot into a USB key, hold option immidiatly after you turn on your Mac. You will be prompted to select a drive, one of which will be titled something similar ot "macOS Installer" which you will need to select. For more information see the site: OS X: About OS X Recovery. Once started to OS X Recovery or the Installer, select the Terminal application from the menu bar. Enter the following commands to repair your GPT.

diskutil  unmountdisk  /dev/disk0
gpt  remove  -i  2  /dev/disk0
diskutil  unmountdisk  /dev/disk0
gpt  add  -i  2  -b  409640  -s  194016208  -t  hfs  /dev/disk0

Note: I do not know if this will fix your log in problems.