pc-amd64-gadget icon indicating copy to clipboard operation
pc-amd64-gadget copied to clipboard

increase ESP partition for compatibility

Open tsunghanliu opened this issue 1 month ago • 0 comments

When the ESP partition is 256MB and the disk is using 4K sector size, mkfs.fat will prompt:

WARNING: Number of clusters for 32 bit FAT is less than suggested minimum.

Based on the implementation, the data area (i.e., without FAT32 header, reserved sectors and alignments/offset) should be larger than 65525 sectors. Therefore, 256MB is not enough for disks using 4K sector size.

Use truncate -s $((65696*4096)) part.bin; mkfs.fat -F 32 -S 4096 -v part.bin to verify if the sector number is enough. By giving different FAT settings, the necessary size might by changed.

For better compatibility and increasing 4MB doesn't consume a lot of disk space, it'd be good to have a bigger ESP partition.

Reference: [1] mkfs.fat - https://github.com/dosfstools/dosfstools/blob/master/src/mkfs.fat.c [2] https://superuser.com/questions/1702331/what-is-the-minimum-size-of-a-4k-native-partition-when-formatted-with-fat32

tsunghanliu avatar Jan 16 '25 07:01 tsunghanliu