I earlier had dual-booted my MacBook Pro(2013), Catalina OS with Ubuntu 18.04 LTS. I wished to remove it, so I erased the unwanted partition in disk utility and restarted my mac, it did not show the macOS symbol in refind so I started in internet recovery mode. Afterwards, I

enter image description here

followed step by step till the step where I removed my third and second partitions. Since my MacBook is working on Catalina OS and the guide was given according to the Sierra, I refrained from going further. Please help me out since I'm not that terminal savvy.

enter image description here

| improve this question | | | | |
  1. Remove the second and the third partition:

    gpt remove -i 3 /dev/disk0
    gpt remove -i 2 /dev/disk0
  2. Add the (former) second partiton with the proper size and partition type:

    gpt add -i 2 -b 409640 -s 461916744 -t apfs /dev/disk0
  3. Check disk0 and the resulting synthesized APFS container scheme with diskutil:

    diskutil list #get the deviceID of the APFS container scheme
    diskutil verifyDisk disk0
    diskutil verifyVolume diskX #diskX: deviceID of the APFS container scheme

Assuming you want to resize the APFS container to the full size of the disk (500 GB) you have to enter:

diskutil apfs resizeContainer disk0s2 0
| improve this answer | | | | |
  • It worked ! Thanks a lot @klanomath – Pranjal Gupta Feb 12 at 10:33

You must log in to answer this question.

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