无法格式化我的 EFI 分区 (FAT32)

BMW*_*MWW 4 uefi fat32

格式化 EFI 分区时,出现此错误:

Not enough clusters for a 32 bit FAT!" 
Run Code Online (Sandbox Code Playgroud)

我的磁盘使用 4096 扇区大小。

#mkfs.fat -v -F 32 -S 4096 /dev/sde1

mkfs.fat 4.1 (2017-01-24)
WARNING: Not enough clusters for a 32 bit FAT!
/dev/sde1 has 255 heads and 63 sectors per track,
hidden sectors 0x4000;
logical sector size is 4096,
using 0xf8 media descriptor, with 67584 sectors;
drive number 0x80;
filesystem has 2 32-bit FATs and 8 sectors per cluster.
FAT size is 16 sectors, and provides 8440 clusters.
There are 32 reserved sectors.
Volume ID is 05deb9f7, no volume label.
Run Code Online (Sandbox Code Playgroud)

我的磁盘分区:

gdisk -l /dev/sde
GPT fdisk (gdisk) version 1.0.1

Partition table scan:
   MBR: protective
   BSD: not present
   APM: not present
   GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sde: 244190646 sectors, 931.5 GiB
Logical sector size: 4096 bytes
Disk identifier (GUID): D0BA102E-86C5-4379-B314-9534F873C377
Partition table holds up to 128 entries
First usable sector is 6, last usable sector is 244190640
Partitions will be aligned on 256-sector boundaries
Total free space is 244123051 sectors (931.3 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048           69631   264.0 MiB   0700  EFI_FAT32
Run Code Online (Sandbox Code Playgroud)

fsck.fat给出以下内容:

#fsck.fat -v /dev/sde1
fsck.fat 4.1 (2017-01-24)
Checking we can access the last sector of the filesystem
Warning: Filesystem is FAT32 according to fat_length and fat32_length fields,
  but has only 8440 clusters, less than the required minimum of 65525.
  This may lead to problems on some systems.
Boot sector contents:
System ID "mkfs.fat"
Media byte 0xf8 (hard disk)
      4096 bytes per logical sector
     32768 bytes per cluster
        32 reserved sectors
First FAT starts at byte 131072 (sector 32)
         2 FATs, 32 bit entries
     65536 bytes per FAT (= 16 sectors)
Root directory start at cluster 2 (arbitrary size)
Data area starts at byte 262144 (sector 64)
      8440 data clusters (276561920 bytes)
63 sectors/track, 255 heads
     16384 hidden sectors
     67584 sectors total
Checking for unused clusters.
Checking free cluster summary.
/dev/sde1: 1 files, 1/8440 clusters
Run Code Online (Sandbox Code Playgroud)

Joh*_*éen 6

FAT32 文件系统有一个最小大小:它应该包含至少 65525 个簇。簇大小是扇区大小的倍数。在您的情况下,扇区大小为 4096,并且mkfs.vfat每个集群的扇区数使用了默认的 8 倍数。用于-s 1为每个簇指定一个扇区:

mkfs.fat -v -F 32 -S 4096 -s 1 /dev/sde1
Run Code Online (Sandbox Code Playgroud)

这导致集群大小为 4096,该大小应该足够小以容纳 264 MiB 分区中 65525 个集群的最小值。

  • 对于 FreeBSD,它不是“-s”,而是“-c”,如“newfs_msdos -F32 -S 4096 -c 1 -L boot02 /dev/ada0p1”。 (2认同)