2

I partitioned my 1TB external drive as follows for use with both macOS & Windows:

  1. 949GB APFS
  2. 51GB Windows NTFS

As I no longer needed the Windows partition I tried to delete it through Disk Utility. The various changes that came along with the APFS complicated the process for me and I only managed to somehow turn the NTFS partition into free space but could not merge it into APFS due to 'Container' system I was unfamiliar with.

On the other hand, I had a PopOS! live USB at hand, so I tried to convert the free space to a FAT32 partition so that I could at least see that as such in Disk Utility. But had no further success in converting it into APFS & merge with the main partition.

So at some point, out of frustration, I decided that I might as well install PopOS! on this 51GB partition so I could try it out for a few days as Linux is generally fast on my 2015 Macbook Pro 13″.

Some error crept up and it said it was unable to complete the installation. So I dropped the idea & plugged my HDD back into macOS but to my dismay the main APFS container was unmountable. So after some quick Google-fu, I found that my GPT which should be 7C3457EF-0000-11AA-AA11-00306543ECAC was FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF

diskutil list, disk in question

Screenshot of the Terminal output for 'diskutil list'

sudo gpt -r show disk2 output

Screenshot of the Terminal output for 'sudo gpt -r show disk2'

Any way to access the APFS container without losing data (no backups sadly)?

nohillside
  • 100,768
A.maths
  • 41

1 Answers1

2

So I was able to access the drive as before just by changing its GUID back, by running

sudo sgdisk -g -t 2:7C3457EF-0000-11AA-AA11-00306543ECAC /dev/sdb

in Linux terminal.

enter image description here

I was then able to add the free disk space back to main APFS partition through Disk Utility by deleting it ('-' button in tool bar), which also dealt with the 'Suspicious MBR at Sector 0'.

enter image description here

nohillside
  • 100,768
A.maths
  • 41
  • 2
    I've rolled back your question edit, please post the answer as an edit to the answer. Also, we usually prefer if people copy/paste Terminal output as text because this is easier to read for a lot of people. – nohillside Nov 27 '22 at 18:02