I am running El Capitain on a MacBook Pro and I decided to add a Ubuntu dual boot to the system. To do this I installed rEFInd, partitioned 100GB for the linux file system, partitioned 2GB for the Linux OS (as Mac is very funny about booting from USB) and partitioned ~20GB swap space for linux.
The install went successful and even though I had to fiddle about with the boot order to ensure rEFInd was shown instead of going straight to ubuntu everything worked fine. My issue was the extra Linux OS partition still existed and I wanted to get rid of it.
To do this I used this command
eraseVolume deleteme JFS+ /dev/…, which renamed the partition as 'deleteme'. Stupidly, I assumed the Recovery OS partition which seemed to have appeared was part of this process and so I ran that command on that partition too. From this point onwards I could no longer boot into Mac OS.
When booting into Internet Recovery and looking at diskutil I found the partition type of my main partition had become
FFFFFFF-FFFF-FFFF-FFFFFFFF. To fix this I used the instructions detailed here: OS volume shows as type 'FFFFFFFF-FFFF-FFFF-FFFFFFFF' after attempting to delete some Linux partitions—cannot log in, which seemed to work. But after this rEFInd still wouldn't load and macOS wouldn't show on
startup disk or when holding
Option on boot, in fact nothing shows in these menus.
When trying to fix the partition via diskutil I obtained these error messages:
Specifically diskutil firstaid says:
Volume on disk1s2 has 0 bytes of trailing loader space and it needs X bytes. Problems were found with the partition map which might prevent booting.
diskutil repairDisk says:
Partition map repair failed file system check when creating loader space for the partition. You should repair that specific partition and then try repairing the partition map again.
Does anyone have any ideas on how to restore the macOS partition?