1

I have a problem after deleting Kali OS from my dual-boot Macbook (with High-Sierra MacOS). The problem is:

  1. I can only boot into internet-recovery-mode
  2. I can not use gpt command, as it results: 'resource busy'

enter image description here

1 Answer 1

1

The partition types got hosed by removing Kali Linux. Disk0s2 and disk0s3 got the wrong types. I would expect some Apple partition type for disk0s2 (HFS+/CoreStorage/APFS) and a Linux partition type for disk0s3. Disk0s4 is probably some dispensable Linux boot/swap partition.

To regain access to macOS you have to modify the partition type of disk0s2.

  • Boot to Internet Recovery Mode
  • In the menubar open Terminal.app and enter:

    diskutil list
    gpt -r show disk0
    

    to get all partition and volume details of the internal SSD

  • Unmount all disk0 related volumes and disks (in your example that's disk2 (based on disk0s3), disk0s4 and finally disk0). Examples: diskutil unmountVolume disk0s4 or diskutil unmountDisk disk0.
  • Remove the APFS container disk2: diskutil ap deleteContainer disk2
  • Remove disk0s3 and disk0s4 (either with diskutil or gpt). Example: diskutil eraseVolume "Free Space" Nil disk0s4
  • Determine the partition type of disk0s2 (How can I make my Mac partition bootable again?) and remove and re-add disk0s2 using gpt with the same size but the proper type. Considering the macOS version (10.13) and the hardware (SSD) the proper partition type is probably 7C3457EF-0000-11AA-AA11-00306543ECAC (APFS) instead of FFFFFFFF-FFFF….
  • Expand disk0s2 with diskutil ap resizeContainer disk0s2 0.

Under certain circumstances you have to disable SIP to edit the partition table with gpt!

1
  • thankyou, you saved my life. I do appreciate your help that solved my problem. Now I can boot normally without loosing any file.
    – aha rin
    Apr 28, 2018 at 15:01

You must log in to answer this question.

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