6

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.

  • Before I post an answer, I would need the output from the command fdisk /dev/disk0. Also, I assume you can boot your computer via internet recovery. I ask this because the gpt command can not be used to fix your computer when boot to your Recovery HD. – David Anderson May 12 '16 at 5:32
  • @DavidAnderson Certainly! Here are the results of fdisk. And yes, internet recovery does indeed work. – George May 12 '16 at 12:00
6

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.

  • This response saved me, but I figure I would also mention, you do not need internet access, you can also use a USB Installer and just open terminal under utilities – cujo Dec 1 '17 at 18:21
  • @cujo: Don't just comment. Edit my answer and add your improvement. – David Anderson Dec 1 '17 at 19:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .