0

Result of internet recovery mode boot, attempt to remove disk0 and add.

enter image description here

Permission denied :

enter image description here

Result of sudo dd if=/dev/disk0s2 skip=64 count=3 bs=16 | hexdump -Cv and sudo dd if=/dev/disk0s2 skip=4 count=2 bs=16 | hexdump -Cv

enter image description here

Result of sudo dd if=/dev/disk0s2 skip=64 count=3 bs=16 | hexdump -Cv

enter image description here

enter image description here

Result of sudo dd if=/dev/disk0s2 skip=4 count=2 bs=16 | hexdump -Cv

enter image description here

enter image description here

Hexdump for disk0 hexdump

Result of Diskutil list, looks like something is amiss. enter image description here

When trying to chose the startup disk, there is no Disk , until yesterday , I could see one. choose startup diskError from First Aid done on APFS drive on Mac using Disk Utility

Error from Disk utility Error while trying to run first AidApparently, this seems to be issue with corrupt boot partition/sector, but I am not sure how to fix. Please help. I have lot of data on this machine.

@Tetsujin : I followed what was mentioned in the link, here is how far I could get .

Ran following commands

  1. diskutil list (output below in image)

    enter image description here

  2. gpt -r show disk0 (output below)

    enter image description here

  3. Since mine is APFS (High Sierra, 10.13.6), I followed appropriate commands.

    gpt remove -i 2 disk0
    gpt add -i 2 -b 409640 -s 878658168 -t 7C3457EF-0000-11AA-AA11-00306543ECAC  disk0
    
  4. Then I ran diskutil verifyDisk disk0 and received the error in last exhibit. I am stuck, please help.

    enter image description here

Sorry for images, not sure how to get better ones for all of you to see and advise.

25
1

The output you posted indicates disk0s2 is using Core Storage. Below is the part of the image you posted showing this. This image also shows the size of the partition should be 0x68be84f000 bytes, which is 878,658,168 sectors at 512 bytes per sector.

enter image description here

In your question, you stated you entered the commands shown below. This was the wrong solution. The results, from entering these commands, caused you to incorrectly believe disk0s2 was APFS formatted.

gpt remove -i 2 disk0
gpt add -i 2 -b 409640 -s 878658168 -t 7C3457EF-0000-11AA-AA11-00306543ECAC disk0

According to klanomath's answer, you should have entered the commands given below.

gpt remove -i 2 disk0
gpt add -i 2 -b 409640 -s 878658168 -t 53746F72-6167-11AA-AA11-00306543ECAC disk0

According to Wikipedia, Core Storage was introduced by Apple to Mac OS X Lion. So there is a chance making the correction will allow the volume you desire to mount. I do not think making the correction will allow you to boot High Sierra. I state this because disk0s3 appears to have the wrong partition type stored in the GPT.

Note: You will not be able to use the gpt command to make the correction while booted to Lion. You could use either boot the Mac as you did when entering the incorrect correction or the macOS Recovery that Tetsujin requested.

Update 1

Evidentially, when the OP entered the incorrect correction, there were no volumes that automatically mounted on the drive with the identifier disk0. However, since then the OP has installed Lion, which created a new volume that automatically mounts on the partition with the identifier disk0s4. Therefore, the commands to enter would be the following.

diskutil unmountdisk disk0
gpt remove -i 2 disk0
diskutil unmountdisk disk0
gpt add -i 2 -b 409640 -s 878658168 -t 53746F72-6167-11AA-AA11-00306543ECAC disk0

Note: The diskutil unmountdisk disk0 command has be repeated because disk0s4 will be automatically mounted after the gpt remove -i 2 disk0 command completes.

12
  • I get this error, -- permission denied when I try to remove the disk0 based on your command. Oct 2 '21 at 22:39
  • My answer posted what you should have entered when you entered the wrong command. I suppose if you are now booted to Lion, then you may need to put a sudo before the gpt command. However, adding sudo will probably produce to an unable to open device 'disk0': Resource busy error message. The early versions of the gpt command require full access to write to disk0, which can not happen because you are booted to Lion which is installed on disk0. Can you boot the Mac as you did when entering the incorrect correction or the macOS Recovery that Tetsujin requested? Oct 2 '21 at 23:24
  • I did what you suggested, pls see the screen shot at top. Oct 3 '21 at 2:07
  • I added Update 1 to my answer. I admit I should have seen that error in my answer. If @klanomath was still posting here at Ask Different, then the error would have be caught by klanomath right away. Also, I suppose if klanomath was still posting, then you would not have had to wait 3 days for an answer. Oct 3 '21 at 4:55
  • Cool, I figured that out. read Klanomath's Answer in detail and followed those steps(before looking at ur update)- diskutil umountDisk disk0 gpt destroy disk0 gpt create -f disk0 and thereafter re-added all previous partitions visible in the last gpt -r show disk0 output: Now I can see my big 499 GB drive but still can't boot my High Sierra (10.13) , please advise on this last bit. selecting 499 GB partition as boot disk leads again to that GNU GRUB screen , this should be straightforward, I would assume , kindly advise. Oct 3 '21 at 5:23

Not the answer you're looking for? Browse other questions tagged .