操作系统卷显示为'FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF'类型[重复]


8

昨天,我试图删除一个Ubuntu分区。因为,我的Mac(13" ,MBPro 2014年中期)不开机现在,在Mac OS我启动复制带USB我按照这个论坛的主题不同(是这样的:。分区类型一下子FFFFFFFF-FFFF-FFFF- FFFF-FFFFFFFFFFFFFF,无法安装驱动器),并且我的卷分区从FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF更改为48465300-0000-11AA-AA11-00306543ECAC。但是我仍然无法启动...

我的/ dev / disk0

非常感谢你 !


disk0片2的正确类型可能是Sierra中的53746F72-6167-11AA-AA11-00306543ECAC(CoreStorage)或High Sierra中的7C3457EF-0000-11AA-AA11-00306543ECAC(APFS)
klanomath

我尝试了7C3457EF-0000-11AA-AA11-00306543ECAC,我可以启动了!非常感谢@klanomath!
Nicolas Lorand

@grgarside更好的问答将这个问题标记为重复:从分区中恢复显示为FFFF的数据。实际链接问答涉及一种FFFF ..类型的分区一个未连接的融合驱动器。我的回答是基于拟议的重复问答,并扩展为包括APFS分区。因此,它甚至可以独立运行(也没有任何重复)。
klanomath

@klanomath MacOS Mojave呢?(是否7C3457EF-0000-11AA-AA11-00306543ECAC仍适用于Mojave?)我目前遇到几乎相同的问题,除了它是MacBook Pro 2015年初,而且我没有遇到gpt -r show disk0在屏幕截图中生成输出的问题。
Edric '18

没关系,7C3457EF-0000-11AA-AA11-00306543ECAC应该为High Sierra和更高版本工作。(已经测试过:文件验证有效!)
Edric

Answers:


12

可引导的OS X分区(Recovery HD除外)具有用于标准OS X分区的GUID 48465300-0000-11AA-AA11-00306543ECAC,用于CoreStorage分区的GUID 53746F72-6167-11AA-AA11-00306543ECAC或GUID 7C3457EF -0000-11AA-AA11-00306543ECAC用于APFS卷。FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF是未知的分区类型(但不是像000000-0000-0000 ....这样的分区)。

可以使用gpt修改GUID。只有卸载所有相关磁盘后,才能使用gpt添加,删除和修改GUID分区表。要重新配置分区,请引导至第三方驱动器(例如Internet Recovery或OS X安装程序拇指驱动器)。

在某些情况下,必须禁用SIP才能修改GUID分区表。


  • 启动到Internet恢复模式(或第三方驱动器)。
  • 在菜单栏中的实用程序>终端中打开终端
  • 获得概述 diskutil list
  • 使用上一个命令中的磁盘标识符获得内部磁盘的概述。在下面,我假设内部磁盘的磁盘标识符为disk0(SSD)(将其替换为您在环境中找到的磁盘)。

    gpt -r show disk0
    
  • 使用以下命令卸载disk0 diskutil umountDisk disk0
  • 然后删除并重新添加具有相同大小但类型正确的第二个分区。当前已安装Sierra的SSD上disk0s2的最可能类型是53746F72-6167-11AA-AA11-00306543ECAC或已安装High Sierra的7C3457EF-0000-11AA-AA11-00306543ECAC(因为以前肯定将CoreStorage分区转换为APFS将Sierra升级为High Sierra)。

    Sierra(CoreStorage):

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

    要么

    高山脉(APFS):

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

    要么

    标准分区(HFSJ扩展):

    gpt remove -i 2 disk0
    gpt add -i 2 -b 409640 -s 431203056 -t 48465300-0000-11AA-AA11-00306543ECAC  disk0
    
  • 验证磁盘和卷:

    diskutil verifyDisk disk0
    diskutil verifyVolume disk0s2
    

引导到USB驱动器并以管理员身份登录,您必须先假装sudo才能成功执行gpt命令。


如果您忘记了系统版本或进行了一些自定义分区,您仍然可以检查disk0s2的前几个块并确定正确的GUID类型:

如果您已启动到完整的系统,则可以使用hexdump

  • 使用以下命令卸载disk0 diskutil umountDisk disk0
  • hexdump FFFF ...分区的前3个块:

    sudo dd if=/dev/disk0s2 count=3 | hexdump
    

    以下结果将其标识为普通的OS X分区:

    0000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    *
    0000400 48 2b 00 04 80 00 21 00 48 46 53 4a 00 00 01 ff
    0000410 d3 8c 77 d3 d4 33 3c b0 00 00 00 00 d3 8c 5b b3
    0000420 00 00 02 a8 00 00 00 25 00 00 10 00 00 fe b7 f6
    0000430 00 fe 1e fa 00 ed 80 00 00 01 00 00 00 01 00 00
    0000440 00 00 10 f2 00 00 5a 9d 00 00 00 00 00 00 00 01
    0000450 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0000460 00 00 00 00 00 00 00 00 7d 9d b0 3a 02 31 62 f0
    0000470 00 00 00 00 00 1f e0 00 00 1f e0 00 00 00 01 fe
    0000480 00 00 00 01 00 00 01 fe 00 00 00 00 00 00 00 00
    0000490 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    *
    00004c0 00 00 00 00 00 60 00 00 00 60 00 00 00 00 06 00
    00004d0 00 00 0a 00 00 00 06 00 00 00 00 00 00 00 00 00
    00004e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    *
    0000510 00 00 00 00 03 10 00 00 03 10 00 00 00 00 31 00
    0000520 00 03 ac 00 00 00 31 00 00 00 00 00 00 00 00 00
    0000530 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    *
    0000560 00 00 00 00 05 40 00 00 05 40 00 00 00 00 54 00
    0000570 00 00 10 00 00 00 54 00 00 00 00 00 00 00 00 00
    0000580 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    *
    0000600
    

    第一个数字是以十六进制表示的字节数:0000000:0; 0000600:1536。*表示相同的行。这意味着:前两个块(0x000-0x3ff)均为零。

    CoreStorage分区在第一个块(0x000-0x1ff)中显示一些非零值:

    0000000 0c 73 a1 a9 ff ff ff ff 01 00 10 00 07 14 d7 01
    0000010 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0000030 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0000040 00 20 c1 cc 0f 00 00 00 00 00 00 00 00 00 00 00
    0000050 00 00 00 00 00 00 00 00 43 53 01 00 00 00 04 00
    0000060 00 10 00 00 00 00 40 00 11 bc fc 00 00 00 00 00
    0000070 11 c0 fc 00 00 00 00 00 11 c4 fc 00 00 00 00 00
    0000080 11 c8 fc 00 00 00 00 00 00 00 00 00 00 00 00 00
    0000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00000a0 00 00 00 00 00 00 00 00 10 00 00 00 02 00 00 00
    00000b0 62 02 98 59 ee a9 ab 51 9b 49 23 90 2e f8 8b 43
    00000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    *
    0000130 e4 6e f8 f2 63 99 45 c1 b2 13 86 28 a5 18 46 6d
    0000140 c4 51 c0 f6 32 f9 43 ab 8e 59 42 d2 1a ef f6 50
    0000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    *
    0000400 48 2b 00 04 80 00 21 00 48 46 53 4a 00 00 01 ff
    0000410 d1 98 a4 93 d4 33 8b d5 00 00 00 00 d1 98 88 73
    0000420 00 06 07 53 00 01 82 39 00 00 10 00 00 fb 6a 00
    0000430 00 c5 1c 55 00 25 73 c7 00 01 00 00 00 01 00 00
    0000440 00 0d e2 65 00 3e a2 fb 00 00 00 00 02 20 00 fb
    0000450 00 00 00 31 00 06 b9 ef 00 00 00 00 00 00 00 00
    0000460 00 00 00 00 00 00 00 31 fb 48 1e a0 6c 47 a2 9f
    0000470 00 00 00 00 00 1f e0 00 00 1f e0 00 00 00 01 fe
    0000480 00 00 00 01 00 00 01 fe 00 00 00 00 00 00 00 00
    0000490 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    *
    00004c0 00 00 00 00 00 60 00 00 00 60 00 00 00 00 06 00
    00004d0 00 00 0a 00 00 00 06 00 00 00 00 00 00 00 00 00
    00004e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    *
    0000510 00 00 00 00 0e 40 00 00 01 30 00 00 00 00 e4 00
    0000520 00 00 10 00 00 00 e4 00 00 00 00 00 00 00 00 00
    0000530 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    *
    0000560 00 00 00 00 11 d0 00 00 01 30 00 00 00 01 1d 00
    0000570 00 02 80 00 00 00 72 00 00 13 30 97 00 00 13 00
    0000580 00 15 c5 aa 00 00 13 00 00 18 2d 23 00 00 13 00
    0000590 00 19 d8 fb 00 00 13 00 00 1b 76 cb 00 00 13 00
    00005a0 00 1c 34 70 00 00 13 00 00 1d 0e 4d 00 00 13 00
    00005b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    *
    0000600
    

    以字节0x130开头的行显示了物理卷的UUID,以字节0x140开头的行显示了逻辑卷组的UUID。

    第三块的前16个字节中的字符串48 46 53 4a(=“ HFSJ”)标识两种分区类型上的Journaled HFS +卷。

    APFS容器如下所示:

    0000000 e7 ec ab 5b a2 94 96 44 01 00 00 00 00 00 00 00
    0000010 18 0c 00 00 00 00 00 00 01 00 00 80 00 00 00 00
    0000020 4e 58 53 42 00 10 00 00 f6 37 ff 00 00 00 00 00
    0000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0000040 02 00 00 00 00 00 00 00 11 f1 5e 40 31 10 4c 20
    0000050 bb 47 53 66 7e 8b 42 d5 b9 c4 00 00 00 00 00 00
    0000060 19 0c 00 00 00 00 00 00 18 01 00 00 18 6c 00 00
    0000070 01 00 00 00 00 00 00 00 19 01 00 00 00 00 00 00
    0000080 21 00 00 00 80 5a 00 00 1f 00 00 00 02 00 00 00
    0000090 7a 5a 00 00 06 00 00 00 00 04 00 00 00 00 00 00
    00000a0 37 fd 03 00 00 00 00 00 01 04 00 00 00 00 00 00
    00000b0 00 00 00 00 64 00 00 00 02 04 00 00 00 00 00 00
    00000c0 06 04 00 00 00 00 00 00 08 04 00 00 00 00 00 00
    00000d0 66 a4 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    *
    00003d0 00 00 00 00 00 00 00 00 16 21 06 00 00 00 00 00
    00003e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    *
    00004f0 00 00 00 00 00 00 00 00 91 3d 0f 00 00 00 00 00
    0000500 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0000510 78 f4 09 00 00 00 00 00 01 00 00 00 00 00 00 00
    0000520 01 00 04 00 08 00 00 00 00 00 00 00 00 00 00 00
    0000530 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    

    第一个块中以字节0x020开头的字符串4e 58 53 42(=“ NXSB”)是APFS容器超级块的魔术字符串,并将其标识为APFS容器。容器的UUID从0x48开始(此处:11 f1 5e 40 ...)

如果您仅限于(Internet)恢复模式或安装程序引导驱动器(仅具有基本系统且不包含hexdump的安装程序引导驱动器),则仍可以使用vis

  • 使用以下命令卸载disk0 diskutil umountDisk disk0
  • 相对于FFFF ...分区的前3个块:

    dd if=/dev/disk0s2 count=3 | vis -c
    

    如果以前有标准分区,则前1024个字节仅包含不可打印的(零):\0\0\0\0\0\0... 〜1030个字节之后,您将看到以下顺序:\ 0HFSJ \ 0

    如果您有CoreStorage分区,则会在前512个字节...\0CS\^A...中显示一些非零值,并显示字符串CS():

    \^U\^D\^A\M-s\M^?\M^?\M^?\M^?\^A\0\^P\0\0\0\M-W\^A\a\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\^B\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\M^Pu\M-\7\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0CS\^A\0\0\0\^D\0\0\^P\0\0\0\0@\0X\M-7}\^C\0\0\0\0X\M-;}\^C\0\0\0\0X\M-?}\^C\0\0\0\0X\M-C}\^C\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\^P\0\0\0\^B\0\0\0006j v\^R\M-+\^U\M^[\f\M^CdG\M-y\^]...
    

    如果您具有APFS分区,则字符串NXSB(...\0NXSB\0\^P...)会显示在前几个字节中:

    ??[?\M^T\M^VD\^A\0\0\0\0\0\0\0\^X\f\0\0\0\0\0\0\^A\0\0\M^@\0\0\0\0NXSB\0\^P\0\0?7?\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\^B\0\0\0\0\0\0\0\^Q?^@1\^PL ?GSf~\M^KBչ?\0\0\0\0\0\0\^Y\f\0\0\0\0\0\0\^X\^A\0\0\^Xl\0\0\^A\0\0\0\0\0\0\0\^Y\^A\0\0\0\0\0\0!\0\0\0\M^@Z\0\0\^_\0\0\0\^B\0\0\0zZ\0\0\^F\0\0\0\0\^D\0\0\0\0\0\0007?\^C\0\0\0\0\0\^A\^D\0\0\0\0\0\0\0\0\0\0d\0\0\0\^B\^D\0\0\0\0\0\0\^F\^D\0\0\0\0\0\0\b\^D\0\0\0\0\0\0f?\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
    

我只是想向您介绍这个悬赏问题,以防您未曾看过。它指的是您的回答,因此以为您可以提供帮助。
Monomeeth

这篇文章帮助我为Linux分区磁盘后解决了问题。非常感谢。我有一个问题。在diskutil verifyVolume(xattr?)期间我收到了很多警告,但最后它说还可以,而且还可以。这些警告是否正常?
pixelomer

当我查看您的答案时,我不知道为什么vis -c某些用户发布的输出是可逆的,而其他输出包含许多?字符,这使得该输出不可逆。在Mac上,我必须先输入export LC_CTYPE="ASCII"才能使用vis -cwvis -cfw创建可逆输出。
大卫·安德森

@DavidAnderson“ ...某些用户发布的输出是可逆的...”您可以链接相应的问题,答案或评论,或者这是一个现实问题吗?
klanomath

这是关于这个问题这个问题的。在第一个问题中,我能够反转vis -c输出以获取分区大小。在第二个问题中,我不能,因为输出包含问号(?)字符。这促使我研究如何使输出可逆。
大卫·安德森
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.