Tried to fix filesystem type: FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF and probably made it worse
-
29-04-2021 - |
题
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:
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:
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
解决方案
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.
- 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. - Boot the broken Mac to Recovery Mode.
- Open a Terminal application window.
- Insert the flash drive into a USB port on the Mac.
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
Shutdown the Mac.
Insert the flash drive in the working Mac.
Enter the command given below in a Terminal application window.
hexdump -Cv /Volumes/MyFat/disk0.bin
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.