My 1TB SSD failed on me with what appears to be a corrupted APFS container. I found a post here on stackexchange that suggests to remove and create GPT entries but the values in the example are specific to the case of that post. I need help understanding what values to use and which GPT entries to remove and add.
I will provide the same information that the original poster linked above did and extensive information about my disk after:
The post suggests "To correct the GPT, you need to remove the second and third entries" with:
sudo gpt remove -i 2 /dev/disk0
sudo gpt remove -i 3 /dev/disk0
And then "The command below will add the APFS container to the GPT."
sudo gpt add -i 2 -b 409640 -s 1875036440 -t apfs /dev/disk0
So my actual question is - what numbers should I use as input here to remove and add gpt entries? I assume that the numbers there are specific to the post he replied to but I can't find "1875036440" referenced anywhere there. And it looks to me like he suggests to remove two entries but only add one? What should I do in my case?
This is the result of diskutil list disk2 on my disk:
/dev/disk2 (external, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *1.0 TB disk2
1: EFI EFI 209.7 MB disk2s1
2: Apple_APFS Container disk3 377.0 GB disk2s2
3: Apple_HFS MEDIA 622.9 GB disk2s3
There are 2 partitions, APFS is the OS which doesn't work and HFS is MEDIA which still mounts fine.
And this is the result of sudo gpt -r show disk2 on my disk:
gpt show: disk2: Suspicious MBR at sector 0
start size index contents
0 1 MBR
1 1 Pri GPT header
2 32 Pri GPT table
34 6
40 409600 1 GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
409640 736324336 2 GPT part - 7C3457EF-0000-11AA-AA11-00306543ECAC
736733976 1216529008 3 GPT part - 48465300-0000-11AA-AA11-00306543ECAC
1953262984 262150
1953525134 32 Sec GPT table
1953525166 1 Sec GPT header
This is the result of sudo dd if=/dev/disk2 bs=512 count=1 skip=409640 | hexdump -Cv
1+0 records in
1+0 records out
512 bytes transferred in 0.004883 secs (104852 bytes/sec)
00000000 c2 f9 f4 f8 b1 61 fd 24 01 00 00 00 00 00 00 00 |.....a.$........|
00000010 5d 7f 5c 00 00 00 00 00 01 00 00 80 00 00 00 00 |].\.............|
00000020 4e 58 53 42 00 10 00 00 5e 6d 7c 05 00 00 00 00 |NXSB....^m|.....|
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000040 02 00 00 00 00 00 00 00 3e 87 ef 07 9e 5b 40 14 |........>....[@.|
00000050 89 f7 e7 da ca 29 7d 4c 13 f8 7c 00 00 00 00 00 |.....)}L..|.....|
00000060 5e 7f 5c 00 00 00 00 00 18 01 00 00 2c 6c 00 00 |^.\.........,l..|
00000070 34 21 9f 02 00 00 00 00 2c 80 9e 02 00 00 00 00 |4!......,.......|
00000080 3a 00 00 00 04 0d 00 00 38 00 00 00 02 00 00 00 |:.......8.......|
00000090 ca 0c 00 00 3a 00 00 00 d3 ef 03 00 00 00 00 00 |....:...........|
000000a0 73 7c 0b 00 00 00 00 00 01 04 00 00 00 00 00 00 |s|..............|
000000b0 00 00 00 00 64 00 00 00 03 04 00 00 00 00 00 00 |....d...........|
000000c0 06 04 00 00 00 00 00 00 ca ef 03 00 00 00 00 00 |................|
000000d0 c1 93 04 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000200
And this is the result of sudo dd if=/dev/disk2 bs=512 count=1 skip=736733976 | hexdump -Cv
1+0 records in
1+0 records out
512 bytes transferred in 0.004882 secs (104878 bytes/sec)
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000200
Trying to run First Aid on the OS partition gives me this:
Running First Aid on “” (disk2s2)
Repairing storage system
Performing fsck_apfs -y -x /dev/disk2s2
Checking the container superblock.
Checking the EFI jumpstart record.
error: (oid 0x401) nr: invalid o_oid (0x7d11eb)
error: (oid 0x401) nr: invalid o_type (0x80000003, expected 0x80000011)
error: verification/reading of the nx_reaper object failed: Illegal byte sequence
The volume /dev/disk2s2 could not be verified completely.
Storage system check exit code is 8.
Storage system verify or repair failed. : (-69716)
Operation failed…
Trying to run First Aid on the AppleAPFSMedia gives me this:
Running First Aid on “AppleAPFSMedia” (disk3)
Fixing damaged partition map.
Invalid disk.
Operation failed…
Some background info: This all started with my Macbook Pro (2012, latest Mojave) having some hickups not long ago where the screen would freeze for a minute or two and then go back to normal. Then one time it just got really slow and froze up every 10 seconds so I tried to shut it down but it would only shut down to a black screen with the mouse pointer still on the screen and stayed there for over an hour. I decided to force it to power off by holding the power button but when I turned it back on I then got the dreaded "no entry" sign. I held cmd+v for verbose and got told that it could not find the APFS boot partition.
If you made it this far - thank you for reading, any input is greatly appreciated!