我的 ASRock FM2A75 Pro4 的 UEFI 固件无法识别我的 SATA 硬盘的 GPT 分区表,如map
EFI shell 命令所示:
Device mapping table
fs0 :Removable HardDisk - Alias hd15f0b blk0
PciRoot(0x0)/Pci(0x13,0x2)/USB(0x5,0x0)/HD(1,MBR,0x599b0b48,0x800,0x771800)
blk0 :Removable HardDisk - Alias hd15f0b fs0
PciRoot(0x0)/Pci(0x13,0x2)/USB(0x5,0x0)/HD(1,MBR,0x599b0b48,0x800,0x771800)
blk1 :HardDisk - Alias (null)
PciRoot(0x0)/Pci(0x11,0x0)/Sata(0x1,0x0)/HD(1,MBR,0x00000000,0x1,0xffffffff)
blk2 :HardDisk - Alias (null)
PciRoot(0x0)/Pci(0x11,0x0)/Sata(0x2,0x0)/HD(1,MBR,0x00000000,0x1,0xffffffff)
blk3 :BlockDevice - Alias (null)
PciRoot(0x0)/Pci(0x11,0x0)/Sata(0x0,0x0)
blk4 :BlockDevice - Alias (null)
PciRoot(0x0)/Pci(0x11,0x0)/Sata(0x1,0x0)
blk5 :BlockDevice - Alias (null)
PciRoot(0x0)/Pci(0x11,0x0)/Sata(0x2,0x0)
blk6 :Removable BlockDevice - Alias (null)
PciRoot(0x0)/Pci(0x13,0x2)/USB(0x5,0x0)
hd15f0b :Removable HardDisk - Alias fs0 blk0
PciRoot(0x0)/Pci(0x13,0x2)/USB(0x5,0x0)/HD(1,MBR,0x599b0b48,0x800,0x771800)
第一个磁盘开头的转储是:
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001c0 01 00 ee fe ff ff 01 00 00 00 ff ff ff ff 00 00 |................|
000001d0 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 55 aa |..............U.|
00000200 45 46 49 20 50 41 52 54 00 00 01 00 00 02 00 00 |EFI PART........|
00000210 fc 8c f5 67 00 00 00 00 01 00 00 00 00 00 00 00 |...g............|
00000220 af d9 30 46 02 00 00 00 00 08 00 00 00 00 00 00 |..0F............|
00000230 8e d9 30 46 02 00 00 00 4d a7 05 30 c3 6b 10 4a |..0F....M..0.k.J|
00000240 b3 de d9 8b 01 7f bd 45 02 00 00 00 00 00 00 00 |.......E........|
00000250 80 00 00 00 80 00 00 00 e2 cd 84 66 00 00 00 00 |...........f....|
00000260 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000400 28 73 2a c1 1f f8 d2 11 ba 4b 00 a0 c9 3e c9 3b |(s*......K...>.;|
00000410 f2 68 35 6f f8 53 5f 40 b4 91 e5 eb e1 76 6a f9 |[email protected].|
00000420 00 08 00 00 00 00 00 00 ff 27 03 00 00 00 00 00 |.........'......|
00000430 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000480 79 d3 d6 e6 07 f5 c2 44 a2 3c 23 8f 2a 3d f9 28 |y......D.<#.*=.(|
00000490 ea e7 0d a6 47 50 84 48 ab 8a 73 3e b3 99 e3 a8 |....GP.H..s>....|
000004a0 00 28 03 00 00 00 00 00 8e d9 30 46 02 00 00 00 |.(........0F....|
000004b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00100000 eb 3c 90 6d 6b 66 73 2e 66 61 74 00 02 04 01 00 |.<.mkfs.fat.....|
磁盘使用 util-linux 的 cfdisk 进行分区,并且可以在 Linux 上正常运行。
输出sgdisk -v /dev/sda
为:
No problems found. 0 free sectors (0 bytes) available in 0
segments, the largest of which is 0 (0 bytes) in size.
答案1
在将行为与我以前使用的 parted 进行比较后,似乎有缺陷的 UEFI 拒绝了标头长度为 512 的分区表,而标准允许该长度:
GPT Header 的大小(以字节为单位)。HeaderSize 必须大于或等于 92,并且必须小于或等于逻辑块大小。
修改 util-linux 以使用 92 的头大小并使用 fdisk 重新创建我的分区后,UEFI 现在可以识别我的分区。
答案2
它在最近的 util-linux 中被“修复”了(截至 2.26-rc1):
Kay 报告说安装的 Windows 8.1 无法识别 libfdisk 创建的 GPT,但 parted 可以按预期工作。
看起来(根据标头十六进制转储)问题出在 HeaderSize GPT 字段,其中 libfdisk 使用 512(标头 + 保留区域),但 parted 使用 92。根据当前的 EFI 标准,两者都非常有效,但 92 可能更向后兼容。
我还发现代码中 libfdisk gpt 驱动程序不一致的地方,有时使用所有扇区,有时仅使用 sizeof(gpt_header)。正确的解决方案是读取所有扇区(放入零内存中),然后将所有扇区再次写入设备。