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

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

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

Not enough clusters for a 32 bit FAT!" 

我的磁盘使用 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.

我的磁盘分区:

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

fsck 文件给出以下内容:

#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

答案1

FAT32 文件系统有一个最小大小:它应包含至少 65525 个簇*。簇大小是扇区大小的倍数。在你的例子中,扇区大小是 4096 并且mkfs.vfat每个簇的扇区数使用默认倍数 8。用于-s 1为每个簇指定一个扇区:

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

这导致簇大小为 4096,该大小应该足够小,足以容纳 264 MiB 分区中至少 65525 个簇。


*来自 Windows 文档基于 UEFI/GPT 的硬盘分区:

对于高级格式 4K 本机驱动器(每扇区 4 KB)驱动器,由于 FAT32 文件格式的限制,最小大小为 260 MB。 FAT32 驱动器的最小分区大小计算为扇区大小 (4KB) x 65527 = 256 MB。

高级格式 512e 驱动器不受此限制的影响,因为它们的模拟扇区大小为 512 字节。 512 字节 x 65527 = 32 MB

相关内容