I would like to I've recently installed Debian Linux on my Macbook, which required repartitioning the hard drive.
I now can't boot into Recovery Mode. Holding down Command+R on boot brings up Internet Recovery Mode. Holding Option on boot brings up the Startup Manager, which lists the Recovery HD, but if I select it, regular OS X boots.
I'm using a Retina MacBook Pro Early 2015 13" on OS X 10.11.4
$ sudo gpt -r show /dev/disk0
gpt show: /dev/disk0: Suspicious MBR at sector 0
start size index contents
0 1 MBR
1 1 Pri GPT header
2 32 Pri GPT table
34 6
40 409600 1 GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
409640 843043264 2 GPT part - 48465300-0000-11AA-AA11-00306543ECAC
843452904 1269536 3 GPT part - 48465300-0000-11AA-AA11-00306543ECAC
844722440 123046872 4 GPT part - 0FC63DAF-8483-4772-8E79-3D69D8477DE4
967769312 262144
968031456 8811424 5 GPT part - 0657FD6D-A4AB-43C4-84E5-0933C84B4F4F
976842880 262147
977105027 32 Sec GPT table
977105059 1 Sec GPT header
$ sudo fdisk /dev/disk0
Disk: /dev/disk0 geometry: 60821/255/63 [977105060 sectors]
Signature: 0xAA55
Starting Ending
#: id cyl hd sec - cyl hd sec [ start - size]
------------------------------------------------------------------------
1: EE 0 0 1 - 1023 254 63 [ 1 - 409639] <Unknown ID>
*2: AF 1023 254 63 - 1023 254 63 [ 409640 - 843043264] HFS+
3: AF 1023 254 63 - 1023 254 63 [ 843452904 - 1269536] HFS+
4: 83 1023 254 63 - 1023 254 63 [ 844722440 - 123046872] Linux files*
$ diskutil list
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *500.3 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_HFS Macintosh HD 431.6 GB disk0s2
3: Apple_HFS Recovery HD 650.0 MB disk0s3
4: Linux Filesystem 63.0 GB disk0s4
5: Linux Swap 4.5 GB disk0s5
$ diskutil cs list
No CoreStorage logical volume groups found
Best Answer
From the results you posted, I can see the GUID for the Recovery partition is wrong. This is partition number 3 in the tables. The correct value in the GPT would be 426F6F74-0000-11AA-AA11-00306543ECAC. The
fdisk
command also shows the value to be wrong in the MBR table. Here, the correct value should beAB
. If you can not boot to your Recovery partition after repairing these tables, then I would assume the contents of the partition is corrupted.As far as I know, there is no utility in OS X for this type of repair. (Technically, you could use the
dd
command, but no sane person would attempt usingdd
to fix this problem.) I would recommend downloading and installing thegdisk
command from here. To install, you may have to modify the setting on the "Security & Privacy" pane of the "System Preferences".To use the
gdisk
command, you will need to disable System Integrity Protection (SIP). Normally, this can be done while in Recovery mode. Since you can not boot to Recovery mode, you can use a product called "rEFInd". Many Linux users already have this product installed on their Mac computer. If you do not, you can create a USB flash drive version which can be used to disable/enable SIP. The instructions are given here.Once
gdisk
is installed and SIP is disabled, you will need to make three changes. These changes involve modifying both the GUID Partition Table (GPT) and the Master Boot Record (MBR) partition table. The changes are listed below.gdisk
uses a value ofAB00
to represent the value 426F6F74-0000-11AA-AA11-00306543ECAC.0002000000000000
. In the example below, I assume the current value for the attribute is0000000000000000
. If not, make the appropriate corrections.AF
toAB
.In the example below, I create and mounted a sparse image as
/dev/disk1
. I then used this image as input to thegdisk
command. This was done to simulate the conditions on your computer. You will be making changes to your/dev/disk0
.At this point, I would restart your Mac.