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.

  • @klanomath, please see I am close to fix with your resolution, https://apple.stackexchange.com/questions/307780/macos-partition-startup-volume-type-ffffffff-ffff-ffff-ffff-ffffffffffff/307787#307787 – rahul kumar Sep 29 '21 at 08:19
  • https://apple.stackexchange.com/questions/307780/macos-partition-startup-volume-type-ffffffff-ffff-ffff-ffff-ffffffffffff/307787#307787 @klanomath I followed this but could not crack. Please help. – rahul kumar Sep 29 '21 at 08:21
  • What have you tried (specific steps), where are you stuck? – nohillside Sep 29 '21 at 08:35
  • @nohillside these are the steps I did in nut shell.gpt remove -i 2 disk0 diskutil umountDisk disk0 gpt add -i 2 -b 409640 -s 372637568 -t 7C3457EF-0000-11AA-AA11-00306543ECAC disk0. Stil I end up on the black screen on my Mac – rahul kumar Sep 29 '21 at 08:48
  • I suspect I have jacked up the whole disk and partitions along with boot sector. Please if someone can help me . I would need specific steps of removing and re-adding the Partitions to boot my mac – rahul kumar Sep 29 '21 at 09:01
  • What OS was on the Mac before this happened? Your pictures show skeuomorphic design, which hasn't been seen since 2014 Yosemite, macOS 10.10 If the previous OS was High Sierra or later, then you could be trying to diagnose a disk containing APFS formatting, which earlier OSes cannot recognise. – Tetsujin Sep 29 '21 at 09:39
  • When the OP enters a command (gpt add -i 2 -b 409640 -s 372637568 -t 7C3457EF-0000-11AA-AA11-00306543ECAC disk0), where the size value (372637568) was taken from the referenced answer, you know the OP is hopelessly lost. – David Anderson Sep 29 '21 at 10:37
  • Tetsujin, This is MBP 2011 with high Sierra on it ,David my bad, the size value used above was - 878658168. Can I still recover my data ? – rahul kumar Sep 29 '21 at 13:17
  • The images are categorically not from High Sierra. You need to boot from something else that understands APFS. Try Internet Recovery using Cmd/Opt/R at boot. For some reason it looks like the local Recovery partition never got updated. The easiest way to tell is the 3 coloured dots at the top left of each window should be a solid, flat colour, not kind of 3D-looking. Like - https://i.stack.imgur.com/lIMJ9.png – Tetsujin Sep 29 '21 at 15:17
  • @Tetsujin: Your comments confuse me. Why are you focused the the version of Recovery? Any version of Recovery designed for the Mac can be used to make the repair. I would have focused on whether the disk0 is a HDD or SSD and whether disk0s2 is encrypted or not. – David Anderson Sep 29 '21 at 16:40
  • @DavidAnderson - because any surviving APFS can't be seen as it stands. – Tetsujin Sep 29 '21 at 16:41
  • @Tetsujin: In the many answers klanomath posted regarding partitioning, focus was placed on the contents of the header to determine the partition type. The latest answer (I can find) where klanomath addressed this is given here. Any corrections were then tested by trying to boot the Mac. You seem to be focused on the output from diskutil list, which I guess would be OK, if the partition type was known to be APFS before becoming ffffffff-ffff-ffff-ffff-ffffffffffff. – David Anderson Sep 29 '21 at 18:11
  • Thanks @ David Anderson : I tried the stuff mentioned in your link and updated my screen prints. I am stuck at point where the problems with partition was found- exhibit shown above. kindly help – rahul kumar Sep 29 '21 at 22:32
  • Adding one more screenshot in my question to give you all better insight into my issue and help me navigate and fix the issue. – rahul kumar Sep 30 '21 at 01:25
  • Is your internal drive a HDD or SSD? Was the boot volume encrypted? – David Anderson Sep 30 '21 at 02:00
  • @DavidAnderson: SSD, Volume encrypted ?-- > lame excuse , I am not sure :( ......But now I see nothing is Encrypted. and just to let you know , I recall it was never APFS , not sure what I did in last 24 hrs which resulted in format getting changed. – rahul kumar Sep 30 '21 at 02:25
  • Can anyone confirm if I would have inadvertently changed the format of the partition of my SSD, and then ended up making this partition inaccessible. I am loss here , I have lot of data which I can't afford losing – rahul kumar Sep 30 '21 at 16:25
  • Reset NVRAM, reinstalled lion , ... But now SSD partition disk0s2 inaccessible. – rahul kumar Oct 01 '21 at 04:31
  • Boot to Lion and open a Terminal application window. When you enter the command sudo dd if=/dev/disk0s2 skip=32 count=16 bs=1 | hexdump -Cv, does hexdump produce the output shown in this image? – David Anderson Oct 02 '21 at 07:38
  • @DavidAnderson : Attached the results , I even added the diskutil list yet again , which certainly would help you to steer me right direction. – rahul kumar Oct 02 '21 at 16:32
  • The partition with the identifier disk0s2 is not APFS formatted. Post the output from 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 to see if the format is "Mac OS Extended (Journaled)" or "Core Storage". – David Anderson Oct 02 '21 at 18:39
  • @DavidAnderson I added the results of the commands at the opt of the post/question, please glance – rahul kumar Oct 02 '21 at 20:56
  • You did not enter the commands posted in my previous comment. You need to review the commands you entered to see your mistakes. You posted your location as Princeton, NJ. I see there is an Apple Store nearby. At this point, you might consider visiting the store for more professional help. – David Anderson Oct 02 '21 at 21:20
  • my bad, I shared the results, please take a look – rahul kumar Oct 02 '21 at 21:30
  • 1
    This question is a duplicate of OS volume shows as type 'FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF', even though the OP did not exactly use the accepted answer. In other words, the accepted answer would have worked in this case. – David Anderson Oct 05 '21 at 15:46

1 Answers1

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.

  • I get this error, -- permission denied when I try to remove the disk0 based on your command. – rahul kumar Oct 02 '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? – David Anderson Oct 02 '21 at 23:24
  • I did what you suggested, pls see the screen shot at top. – rahul kumar Oct 03 '21 at 02: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. – David Anderson Oct 03 '21 at 04: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. – rahul kumar Oct 03 '21 at 05:23
  • If you can access your important data from Lion, then I would advise backup the data to an external drive. Since your disk0 is a SSD, I would boot to the High Sierra version of macOS Recovery over the Internet, format (erase) disk0s2 using the APFS format and install High Sierra. Later you can remove Lion and add the free space back to disk0s2. – David Anderson Oct 03 '21 at 07:31
  • FYI, GRUB is stored in disk0s1. If you wish, we can discuss using Lion to remove GRUB. – David Anderson Oct 03 '21 at 07:36
  • Cool, backed up data. Now I don't have high Sierra OS with me(Except on SSD) Since you already have a nice peek into my Mac, Can you please summarize what steps should I take to boot into Sierra. – rahul kumar Oct 03 '21 at 15:51
  • the reason I am still looking for answers here is, before coming to this forum I did visit Apple store, where they confirmed my SSD is fried which was not very convincing and finally I ended up fixing the partition. thank you @David Anderson. would appreciate , if you can let me know the way to format my drive and install fresh high sierra. – rahul kumar Oct 04 '21 at 01:02
  • Sierra or High Sierra? Your previous comment was for Sierra. You posted a image where the output from diskutil list produced the Apple_APFS type for disk0s2. I thought you booted from High Sierra macOS Recovery over the internet. If not, then what were you booted to? If so, then why can you not installed High Sierra from there? – David Anderson Oct 04 '21 at 02:28
  • I booted into Lion , I had high Sierra (10.13) prior to all this mess up. Now since my all data is backed up , I would just want to make this 2011 MBP with fresh install of High Sierra. I am little oblivious to these fresh installs, bootable disk , etc. – rahul kumar Oct 04 '21 at 04:05
  • I suppose I would use Lion to download and install El Capitan to an erased disk0s2. Afterwards, use El Capitan to download a High Sierra installer application. Transfer the High Sierra installer to a flash drive. Boot from the flash drive, erase disk0s2 (or all of disk0) and install High Sierra. User @Tetsujin has posted an question and answer explaining how to get older versions of OS X/macOS. – David Anderson Oct 04 '21 at 07:59