I was trying to remove Ubuntu (dual boot) from my 2017 Macbook Air. Now my computer can not start successfully in either macOS or Linux. When I restart it, it now opens refind, then gnu rnu in both macOS and Linux.
I used Disk Utility when trying to remove Ubuntu. I don't completely remember what I did. However, I could not remove the partition Ubuntu uses. Then, I opened macOS in recovery mode and did some changes using diskutil. The disk now looks like this:
Can you help me fix this without losing my data? Is my data gone for good?
gpt -r show /dev/disk0
shows:
Disk utility shows:
Edit: Output of :
export LC_CTYPE="ASCII"
diskutil unmountdisk disk0
dd if=/dev/disk0 count=1 bs=16 skip=13108482 | vis -cw;echo
Edit:
It says resource busy when I entered the command gpt add -i 2 -b 409640 -t apfs disk0
.
gpt -r show /dev/disk0
.export LC_CTYPE="ASCII"
. If you look at the image you posted, then you will see that you enteredexport LC_TYPE="ASCII"
instead. This may have caused thedd if=/dev/disk0 count=1 bs=16 skip=13108482 | vis -cw;echo
command to output partially useless data.