2

I have a MacBook Air 11 inch which I recently tried to install Linux on with a swap partition and a root partition. In my stupidity I used the “disks” program under “try ubuntu now” to delete the Linux partitions and then extend the Mac partition. As a result the partition ended up having the filetype “FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF”. I searched around on Google and came across this:

macOS partition startup Volume type FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF

I tried to use this to fix the error but have not been able to. This is what I’ve done:

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

From here it flagged up the error: “gpt add: disk0: error: no space available on device” but I moved on to the second section because the guy in that post said that it solved his problem.

diskutil list
gpt -r show disk1

(I do no have the pictures for these)

diskutil umountDisk disk0
gpt destroy disk0
gpt create -f disk0

gpt add -i 1 -b 40 -s 409600 -t C12A7328-F81F-11D2-BA4B-00A0C93EC93B disk0
gpt add -i 2 -b 409640 -s 372637568 -t 7C3457EF-0000-11AA-AA11-00306543ECAC disk0

I only did the first two as the diskutil list only showed two.The first was created fine but the second flagged up the error: “gpt add: disk0: error: no space available on device”. Even still I went ahead and rebooted to see if anything happened and obviously nothing did.

From here I am apprenhensive to go on with the things I have seen from searches. Here is what ”diskutil list” shows now:

enter image description here

Strangely the internet recovery seems to have flipped to disk0 while the mac drive is now on disk1. Here’s what “gpt -r show disk1” returns:

enter image description here

I am not very terminal-savvy and I would hate to lose this data as it isn’t backed up and is important. Is it still viable to try to make this bootable or is it time to hand it to professional data recovery for estimates and just get the files that might be left over at this point?


Update 1

So this is the hexdump which was retrieved using the other computer below:

hexdump -Cv /Volumes/MYFAT/disk0.bin
00000000  67 09 20 65 04 d9 06 58  01 00 00 00 00 00 00 00  |g. e...X........|
00000010  fb d8 02 00 00 00 00 00  01 00 00 80 00 00 00 00  |................|
00000020  4e 58 53 42 00 10 00 00  c8 d1 5a 01 00 00 00 00  |NXSB......Z.....|
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  10 11 96 f5 cf 27 4a 3c  |.............'J<|
00000050  a8 30 3e 64 32 d4 08 e6  c7 a6 04 00 00 00 00 00  |.0>d2...........|
00000060  fc d8 02 00 00 00 00 00  18 01 00 00 18 6c 00 00  |.............l..|
00000070  44 f8 01 00 00 00 00 00  f8 83 01 00 00 00 00 00  |D...............|
00000080  32 00 00 00 85 10 00 00  30 00 00 00 02 00 00 00  |2.......0.......|
00000090  73 10 00 00 12 00 00 00  39 a5 04 00 00 00 00 00  |s.......9.......|
000000a0  3e 6c 05 00 00 00 00 00  01 04 00 00 00 00 00 00  |>l..............|
000000b0  00 00 00 00 64 00 00 00  03 04 00 00 00 00 00 00  |....d...........|
000000c0  20 04 00 00 00 00 00 00  22 04 00 00 00 00 00 00  | .......".......|
000000d0  45 a5 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |E...............|
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  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000210  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000220  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000230  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000240  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000250  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000260  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000270  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000280  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000290  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000002a0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000002b0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000002c0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000002d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000002e0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000002f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000300  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000310  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000320  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000330  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000340  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000350  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000360  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000370  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000380  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000390  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000003a0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000003b0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000003c0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000003d0  00 00 00 00 00 00 00 00  ff f5 a4 00 00 00 00 00  |................|
000003e0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000003f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000400  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000410  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000420  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000430  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000440  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000450  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000460  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000470  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000480  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000490  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000004a0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000004b0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000004c0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000004d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000004e0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000004f0  00 00 00 00 00 00 00 00  23 c2 20 01 00 00 00 00  |........#. .....|
00000500  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000510  94 c2 20 01 00 00 00 00  01 00 00 00 00 00 00 00  |.. .............|
00000520  01 00 04 00 08 00 00 00  00 00 00 00 00 00 00 00  |................|
00000530  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000540  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000550  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000560  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000570  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000580  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000590  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000005a0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000005b0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000005c0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000005d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000005e0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000005f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000600
  • 1
    What a painful title and experience. I think you haven't caused the data blocks to change, so I'd get quotes from data recovery. Many show you what you'll get before you have to pay (or you only pay a diagnosis fee to know the situation if you don't approve the estimate). There are good related links of DR options, so let's see if someone can help you "repair" things here. – bmike Mar 7 at 21:40
  • @bmike Thanks for editing my post, I should have probably said that at the end. That said, if possible I would definitely like to see if someone knows how it could be made bootable again, especially considering I’ll have to send the whole laptop away as the SSD is soldered in and I have some worries about putting all my data in the hands of a third party. – Mcvith Mar 7 at 22:20
  • Oh yes - your points are very well taken. I sure hope someone like @klanomath or David Anderson have advice. They are wizards / technical experts on these sorts of questions and I always learn a lot when they answer. – bmike Mar 7 at 22:22
  • @bmike Yeah it would be great if one of them could answer, but unfortunately klanomath seems to have not been on this site since May of last year. Hopefully David Anderson or someone similar would have some input though. – Mcvith Mar 7 at 22:43
  • 1
    For the record: the reason the second gpt command failed ("error: no space available on device”) is that the partition size (-s 372637568) was bigger than the drive. The first partition's parameters and the beginning sector number of the second partition are pretty standard, but the second partition's size will vary depending on the size of the drive and how it's partitioned. Your drive is a different size than the one in the linked question, and also partitioned differently, so that parameter will not work on your system. – Gordon Davisson Mar 8 at 0:17
2

You need to post a hexadecimal dump of a few sectors of the internal drive. I need to see this before determining if a fix can be found. Unfortunately, Internet Recovery does not provide a hexadecimal dump utility. Therefore, I propose you do the following. Let me know if you have any problems.

The next step would be for you to post a hexdump of the first 3 sectors following the first partition. Below are the steps I would use to accomplish this task. These steps will not change the internal drive.

  1. Using the working Mac, format a flash drive for a single FAT32 volume labeled MyFat. The flash drive probably should be MBR partitioned, but I believe GPT partitioning will also work.
  2. Boot the broken Mac to Recovery Mode.
  3. Open a Terminal application window.
  4. Insert the flash drive into a USB port on the Mac.
  5. Enter the command given below. This will write out a binary copy of the first three 512 bytes sectors following disk0s1.

    Note: I assume the internal drive is disk0. If not, make the appropriate substitutions.

    dd if=/dev/disk0 count=3 skip=409640 of=/Volumes/MyFat/disk0.bin
    
  6. Shutdown the Mac.

  7. Insert the flash drive in the working Mac.

  8. Enter the command given below in a Terminal application window.

    hexdump -Cv /Volumes/MyFat/disk0.bin
    
  9. Post the output to your question. I would prefer you copy and paste the text to your question. An image (picture) is very inconvenient.

Once you have provided this dump, I will be able to determine how to proceed.

Update #1

The third line, in the output you posted, shows the letters NXSB. This is a good indication that a APFS partition once resided at offset 409640. The hexadecimal sequence c8 d1 5a 01 00 00 00 00 appears on the same line. One can enter, into the Calculator application, these hexadecimal pairs in reverse order, as shown below.

This value can be converted to decimal by clicking on the 10 button. The result is shown below.

Next, one can click on the x8= buttons to multiply by 8. The result is shown below. This is the value you should have used for the partition size instead of 372637568.

Note: This step was required because your sector size is 512 bytes. This step can be skipped when the sector size is 4096 bytes.

This what you entered:

diskutil umountDisk disk0
gpt add -i 2 -b 409640 -s 372637568 -t 7C3457EF-0000-11AA-AA11-00306543ECAC disk0

This is what you should have entered:

diskutil umountDisk disk0
gpt add -i 2 -b 409640 -s 181833280 -t 7C3457EF-0000-11AA-AA11-00306543ECAC disk0

References

Apple File System Reference, dated 2019-02-07, page 25.

  • Ok so I have updated the question with the hexdump info. I am new to this website so I don’t know how to format it but hopefully that isn’t a problem. – Mcvith Mar 8 at 12:44
  • @Mcvith: I updated my answer. – David Anderson Mar 8 at 13:44
  • So from there I just go on to verify it with“diskutil list” “diskutil verifyDisk disk0” “diskutil verifyVolume disk0s1” “diskutil verifyVolume disk0s2” right? – Mcvith Mar 8 at 16:00
  • That is what @klanomath posted to do. There should be no damage, unless you left something out in your question. – David Anderson Mar 8 at 16:14
  • Thank you so much! When I tried the command “diskutil verifyVolume disk0s2” it came up with the error “unrecognised file system” but I risked rebooting and it started up perfectly fine and booted with everything working. You have my gratitude for saving it without having to take it to Data Recovery. – Mcvith Mar 8 at 19:41

You must log in to answer this question.

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