Lost my APFS partition after using EaseUS partition manager on Bootcamp
From Windows, you can open a Command Prompt window as an Administrator. Next, you could enter the commands given below to change disk0s2
to an APFS type.
diskpart
select disk 0
select partition 2
set id=7C3457EF-0000-11AA-AA11-00306543ECAC override
gpt attributes=0x0000000000000000
exit
Update
The output from dd if=/dev/disk0s2 count=1 bs=512 | vis -c
contains the character sequence NXSB
which gives evidence that disk0s2
is a APFS container. The sequence that follows NXSB
is \0\^P\0\0?\M^B?\^B\0\0\0\0\
. This sequence indicates the size value of 49283834
in the GPT is wrong for the 2nd entry (disk0s2
). This incorrect value would cause the APFS volume to remain unmounted. Unfortunately, because the sequence contains question mark (?
) characters, the correct value for the size can not be precisely determined.
Based on this new information, I can only guess at a solution. Below is my best guess.
Enter the following commands while booted to macOS Internet Recovery.
diskutil unmountdisk /dev/disk0
gpt remove -i 2 /dev/disk0
diskutil unmountdisk /dev/disk0
gpt remove -i 3 /dev/disk0
diskutil unmountdisk /dev/disk0
gpt add -i 2 -b 76806 -s 49316602 -t 7C3457EF-0000-11AA-AA11-00306543ECAC /dev/disk0
How to determine the exact size for disk0s2
.
-
While booted to macOS Internet Recovery, copy the first 512 bytes of
disk0s2
to a flash drive. Below is an example, where the flash drive volume label isMYFLASHDRV
. You will need a flash drive that isMS-DOS (FAT)
orExFAT
formatted.dd if=/dev/disk0s2 count=1 bs=512 of=/Volumes/MYFLASHDRV/hexdump.bin
-
Print out a hex dump of the saved file. Post the output to your question.
Upload the
hexdump.bin
file to the website File to hexadecimal converter.Note: Before uploading the file, make sure the box labeled "Use 0x and comma as separator (C-like)" is unchecked and the box labeled "Insert newlines after each 16B" is checked off.
Or, find another Mac and run the command shown below.
hexdump -Cv /Volumes/MYFLASHDRV/hexdump.bin
Or, boot to Windows, then download and run the command shown below. Here, I assume the flash drive is assigned the drive letter
D:
.writehex < D:\hexdump.bin
Note: You will need to download the
readgpt1.1.0x64.zip
file from the readgpt website. You can extract thewritehex.exe
application from this zip file. This is a website that I created. Determine the size in 4096 bytes sectors of the APFS container partition (
disk0s2
). I can do this for you and update my answer. Or, you can read the accepted answer to the question: Tried to fix filesystem type: FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF and probably made it worse.
Alternative method to determine the exact size for disk0s2
.
-
While booted to macOS Internet Recovery, enter the commands given below.
export LC_CTYPE="ASCII" dd if=/dev/disk0s2 bs=1 count=16 skip=32 2>/dev/null | vis -wc; echo
If value of
49316602
posted in my above guess is correct, then you should get the following output.NXSB\0\^P\0\0\M-z\M^B\M-p\^B\0\0\0\0
If your results are different, then you can post your results and wait for me to update my answer. OR, you can proceed to step 2.
-
Find another Mac and enter the command shown below. Here you need to replace the string with your results.
Note: It is important that the string be enclosed by single quotes ('). Do not use double quotes (").
echo -n 'NXSB\0\^P\0\0\M-z\M^B\M-p\^B\0\0\0\0' | unvis | hexdump -Cv
The above command would produce the following output.
00000000 4e 58 53 42 00 10 00 00 fa 82 f0 02 00 00 00 00 |NXSB............| 00000010
Determine the size in 4096 bytes sectors of the APFS container partition (
disk0s2
). The procedure for doing this is posted in the accepted answer to the question: Tried to fix filesystem type: FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF and probably made it worse.