缘由:游戏用的台式机坏掉了。

去年底配了一台 ITX,GIGABYTE AORUS X570 I PRO WIFI 大概是这个型号的主板,在一次 BIOS 升级之后无法进入 POST,配件 LED 都显示正常,风扇正常。于是按照官方说明,准备重刷 BIOS:

  • 一张闪存盘格式化为 FAT32
  • 固件改名为 GIGABYTE.BIN 放在根目录下
  • 插在 BIOS USB 接口,接通电源但不开机的情况下按 Q Flash Plus 开始刷机

但是按下之后并没有描述的橙色灯亮,只看到闪存盘的存取 LED 快速闪了几下就没了动静。

一度以为文件有问题,或者闪存盘有问题,或者格式化有问题。于是拆了一个新的闪迪的闪存盘,重新下载保存固件,依然没有效果。

对着文档回顾一次操作顺序以免有疏漏,然后发现了蹊跷。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
~> sudo fdisk /dev/sdb
Welcome to fdisk (util-linux 2.36.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): o
Created a new DOS disklabel with disk identifier 0x5f576f17.

Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1):
First sector (2048-15137279, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-15137279, default 15137279):

Created a new partition 1 of type 'Linux' and of size 7.2 GiB.

Created a new partition 1 of type ‘Linux’ and of size 7.2 GiB.

嗯?

Partition Type 是 Linux。这会是读取失败的原因么?于是列出所有的文件系统

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Command (m for help): l

00 Empty 24 NEC DOS 81 Minix / old Lin bf Solaris
01 FAT12 27 Hidden NTFS Win 82 Linux swap / So c1 DRDOS/sec (FAT-
02 XENIX root 39 Plan 9 83 Linux c4 DRDOS/sec (FAT-
03 XENIX usr 3c PartitionMagic 84 OS/2 hidden or c6 DRDOS/sec (FAT-
04 FAT16 <32M 40 Venix 80286 85 Linux extended c7 Syrinx
05 Extended 41 PPC PReP Boot 86 NTFS volume set da Non-FS data
06 FAT16 42 SFS 87 NTFS volume set db CP/M / CTOS / .
07 HPFS/NTFS/exFAT 4d QNX4.x 88 Linux plaintext de Dell Utility
08 AIX 4e QNX4.x 2nd part 8e Linux LVM df BootIt
09 AIX bootable 4f QNX4.x 3rd part 93 Amoeba e1 DOS access
0a OS/2 Boot Manag 50 OnTrack DM 94 Amoeba BBT e3 DOS R/O
0b W95 FAT32 51 OnTrack DM6 Aux 9f BSD/OS e4 SpeedStor
0c W95 FAT32 (LBA) 52 CP/M a0 IBM Thinkpad hi ea Linux extended
0e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a5 FreeBSD eb BeOS fs
0f W95 Ext'd (LBA) 54 OnTrackDM6 a6 OpenBSD ee GPT
10 OPUS 55 EZ-Drive a7 NeXTSTEP ef EFI (FAT-12/16/
11 Hidden FAT12 56 Golden Bow a8 Darwin UFS f0 Linux/PA-RISC b
12 Compaq diagnost 5c Priam Edisk a9 NetBSD f1 SpeedStor
14 Hidden FAT16 <3 61 SpeedStor ab Darwin boot f4 SpeedStor
16 Hidden FAT16 63 GNU HURD or Sys af HFS / HFS+ f2 DOS secondary
17 Hidden HPFS/NTF 64 Novell Netware b7 BSDI fs fb VMware VMFS
18 AST SmartSleep 65 Novell Netware b8 BSDI swap fc VMware VMKCORE
1b Hidden W95 FAT3 70 DiskSecure Mult bb Boot Wizard hid fd Linux raid auto
1c Hidden W95 FAT3 75 PC/IX bc Acronis FAT32 L fe LANstep
1e Hidden W95 FAT1 80 Old Minix be Solaris boot ff BBT

Aliases:
linux - 83
swap - 82
extended - 05
uefi - EF
raid - FD
lvm - 8E
linuxex - 85

好家伙,看到一个 0b W95 FAT32。直接把分区类型改为 0b 再重新格式化,放入文件,插回 BIOS USB 接口,按下 Q Flash Plus,瞬间电源启动,橙色 LED 开始闪烁,说明已经开始刷写。

查了 Wikipedia,看到这么一段话:

Lists of assigned partition types to be used in the partition table in the MBR were originally maintained by IBM and Microsoft internally. When the market of PC operating systems and disk tools grew and liberated, other vendors had a need to assign special partition types to their products as well. As Microsoft neither documented all partition types already assigned by them nor wanted to maintain foreign assignments, third parties started to simply assign partition types on their own behalf in a mostly uncoordinated trial-and-error manner. This led to various conflictive double-assignments sometimes causing severe compatibility problems between certain products.([1])[http://msdn.microsoft.com/en-us/windows/hardware/gg463525.aspx]

所以也就有了 Partition Type 这样一个细节导致刷写任务失败,原因是 GIGABYTE 在开发 Q Flash Plus 的时候没有考虑过不同厂家、设备、操作系统所建立的 FAT32 分区类型的不同,文档中也没有提及这个问题。顺带又看到了同样有很多 GIGABYTE 主板的用户在网络上表示他们没有办法通过这种方式刷写 BIOS,也难怪会让人困惑了。

再顺便,使用闪迪出厂自带的 FAT32 文件系统无法正常被 Q Flash Plus 识别,是不是也说明了闪迪的闪存盘在出厂时建立的文件系统类型并不是 0b W95 FAT32

总之:

  1. 我的主板终于修好了。
  2. 开发任何功能时要考虑好对不同硬件、系统、环境的兼容性。
  3. 下次买主板,还是乖乖选败家之眼 ASUS ROG 吧(笑