1

[Solved]

I recently installed Kali Linux onto my MacBook Air 2015, and shortly after, realized that I needed to install Refind to get the full functionality. I deleted the partition, which is 20 Gb, from disk utility in MacOS. I closed my laptop for a while, and when I came back, I was met with the Grub Rescue screen. I tried some things in Grub Rescue to no avail, so I booted into Internet Recovery Mode.

I opened the terminal and used $ diskutil list and $ gpt -r show disk0, which you can see the results of below. I followed the directions at this post How can I make my Mac partition bootable again? I used gpt remove -i 3 disk0 and gpt remove -i 2 disk0 I then learned that I have an APFS container from dd if=/dev/disk0 skip=409640 count=3 |vis -c. Therefore, I used gpt add -i 4 -b 409640 -s 2542739416 -t 7C3457EF-0000-11AA-AA11-00306543ECAC disk0 as the directions specify. Of course, when I did this I got an error:

gpt add: disk0: Suspicious MBR at sector 0 gpt add: disk0: error: no space available on device

I researched this, and found this. I tried both gpt destroy disk0 and gpt create disk0 to which both returned an error: gpt destroy/create: disk0: Suspicious MBR at sector 0. It seems like this person had the same problem, and went down the wrong road so to speak. Perhaps I can avoid making the same mistake.

I am really not sure what to do from here. Any help would be appreciated. Thank you!


edit: So thanks to David Anderson, I was able to correct the "gpt add: disk0: error: no space available on device" error.

I then added the third partition, which I think is for recovery(?), using gpt add -i 3 -b 227212504 -s 1269536 -t 426F6F74-0000-11AA-AA11-00306543ECAC disk0. The fourth picture is the most recent output of gpt -r show disk0.

Moving on, I tried diskutil verifyDisk disk0 to which i got the error: Error: -69846: Unrecongnized Filesystem. (Also in image 4) Not sure what to do about that. In fact, that was the original error it returned when I booted into grub rescue.

Also in the fourth image is the output of diskutil verifyVolume disk0s2. Which seems error free.


diskutil list ------------gpt -r show disk0

old gpt -r show and fdisk output


output after successfully adding partitions 2 and 3. verifyDisk output


Booted successfully to my machine after deleting that third partition and holding down option at the startup manager screen. Thanks for your help!

  • gpt add -i 1 -b 40 -s 409600 -t C12A7328-F81F-11D2-BA4B-00A0C93EC93B disk0 and gpt add -i 2 -b 409640 -s 197570600 -t 7C3457EF-0000-11AA-AA11-00306543ECAC disk0 For now, ignore the Suspicious MBR at sector 0 error message. – David Anderson Dec 23 '18 at 03:38
  • Thanks for your comment. the first command returned disk0s1 added. Good. The second command returned gpt add: disk0: error: no space available on device. Same as before. – Roscoe Turner Dec 23 '18 at 04:11
  • There is something missing in your question. Did you get the error message "disk0: error: device contains a MBR" after entering "gpt create disk0"? To make sure I am clear about the current state of your partition tables, post the output from gpt -r show /dev/disk0 and fdisk /dev/disk0. – David Anderson Dec 23 '18 at 07:10
  • I do not get that error at the moment. I edited the post to include a picture of the output of those two statements. – Roscoe Turner Dec 23 '18 at 17:38
  • The second command that I posted for you to enter was gpt add -i 2 -b 409640 -s 197570600 -t 7C3457EF-0000-11AA-AA11-00306543ECAC disk0, but you instead entered gpt add -i 2 -b 409640 -s 2542739416 -t 7C3457EF-0000-11AA-AA11-00306543ECAC disk0 – David Anderson Dec 23 '18 at 17:50
  • I apologize; I didn't look closely enough at that. (Also didn't notice until now that -s is for size and there wasn't enough space because I was adding it to a number that my SSD doesn't even contain) I was able to add disk0s2 after using your updated command. I edited the post to describe the next wave of errors. Thanks for everything so far. – Roscoe Turner Dec 24 '18 at 11:24
  • You should not have added the third partition. You need to delete this partition. Use the command gpt remove -i 3 disk0. – David Anderson Dec 24 '18 at 16:13
  • To boot back to macOS, hold down the option key at startup. Release the option key when the Startup Manager appears. Next, hold down the control key before selecting to boot macOS. Once you have booted to macOS, we can discuss if there is any Grub code that still needs to be removed. – David Anderson Dec 24 '18 at 16:21
  • That did it. It booted into MacOS, finally. Thank you so much for your help! :) I'm gonna stick to VMs next time I run linux... – Roscoe Turner Dec 24 '18 at 17:43

0 Answers0