I had Tripple Boot configured on my MacBook Pro mid 2012 sharing the same 240GB Sata SSD drive in the following order:

  1. APFS MacOS
  2. Boot Camp Windows
  3. Linux POP OS
  4. EFI partition or something.

I used diskutil command to delete partitions 3 and 4, and now that space is unallocated. I wanted to add that space to the MacOS partition, but I can't since the free space was after the Windows partition. I didn't know how to do this from the macOS terminal, but after some digging, I used the trial version of Paragon Disk Manager to move the Boot Camp Windows partition to the end of disk. then went back to Disk Utility app and increased the macOS partition. But as you may know, the APFS container (disk3) size was not increased and kept showing the same old size.

I don't have any command outputs from back then, but here are some details about my Macbook: I have 2 internal disks:

  • 240 GB SSD multiple partitions for OSs.
  • 1 TB HDD single partition for Data.

After some searching on the internet, I found How do I resize an APFS Volume to reclaim all space inside its container? which looks pretty similar to my case.

I decided to try the latest solution from David Anderson. But I got a failure in the first command:

# gpt -f remove -b 409640 disk0
gpt remove: disk0: Suspicious MBR at sector 0
disk0s2 removed

In my situation I'm sure it was not disk0, either disk1 or disk2, all I remember is that disk3 was the APFS container.

I was worried about the MBR-related message, but proceeded with the next command as follows:

# gpt -f add -b 409640 -s 976562496 -t apfs disk0
gpt remove: disk0: Suspicious MBR at sector 0
gpt remove: disk0:  error: no space available on device

And here it gets stuck. I couldn't proceed any further from here. I was in Recovery mode so I knew I might get stuck after rebooting. Looking online I saw that gdisk can fix the MBR or whatever, but I don't have gdisk installed.

I land on this article trying to fix the partitions: How to fix partitions if disk utility is not able to?

The output of the fdisk command was somewhat similar to what has been shared in that post:

 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
 1: EE 1023 254  63 - 1023 254  63 [         1 -     409639] <Unknown ID>

I don't remember the other three lines, one of them had a Windows-related name and I said maybe it's the Boot Camp but the first line was reported as \<Unknown ID\>.

After more online research, I found someone using fdisk -e /dev/disk0 I couldn't find the article nor the sequence of commands I did later on, but I ended it with the write command and exit.

After rebooting I ended up with the folder with a question mark. I couldn't even enter recovery mode, But I could Access the Internet Recovery Mode though. I tried installing gdisk in Recovery mode, but I couldn't. The only article I found about this was this one: Trying to rebuild my partition map But I don't have /Volumes/EFI anymore...

I played a lot on my disk using fdisk to be honest trying to get things back. I run it with all options -u, -auto, -i, ...etc. But always the same result.

I have a spare Windows laptop, So I tried reinstalling macOS, Downloaded the macOS Catalina dmg file, and used my external 300 GB HDD with TransMac following online articles, but couldn't boot from it no matter how many tries and tried with 2 different dmg images downloaded from different website.

Here is my current situation:

Screenshot of the output for 'diskutil list'

Screenshot of the output for 'fdisk /dev/disk0'

Does anyone please know how to fix this mess?



You must log in to answer this question.

Browse other questions tagged .