Bug 1170625 - UEFI: ESP Partition is formatted with FAT16 instead of FAT32
UEFI: ESP Partition is formatted with FAT16 instead of FAT32
Status: RESOLVED WORKSFORME
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: YaST2
Current
Other Other
: P5 - None : Normal (vote)
: ---
Assigned To: E-mail List
Jiri Srain
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-04-27 18:39 UTC by Dominik Platz
Modified: 2021-01-14 16:35 UTC (History)
4 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dominik Platz 2020-04-27 18:39:06 UTC
A fresh installation of a UEFI machine creates an ESP partition with FAT16 as boot filesystem:

# parted
GNU Parted 3.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sda: 68.7GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system     Name  Flags
 1      1049kB  525MB   524MB   fat16                 boot, esp
 2      525MB   66.6GB  66.0GB  btrfs
 3      66.6GB  68.7GB  2149MB  linux-swap(v1)        swap

According to the UEFI specification it should be FAT32.
https://uefi.org/specifications
"EFI encompasses the use of FAT32 for a system partition, and FAT12 or FAT16 for removable media."

Although UEFI firmware must handle FAT12, FAT16 and FAT32 file systems, I recommend to use FAT32. (Just to follow the rules. I don't expect any error cases with FAT16. It just looks like an error.)
Comment 1 Stefan Hundhammer 2020-05-11 08:03:38 UTC
AFAIK we don't do anything special when creating the filesystem for that partition; we simply rely on the defaults of the mkfs.vfat command. That command uses the partition size to determine the FAT type.

Smaller FAT types have limitations for the maximum filesystem size; it depends on the cluster size and the partition size. But FAT16 can create up to 2 GB, and you only have 524 MB (parted uses 1000-based units AFAIK, so it's 500 MiB); so FAT16 is a reasonable choice.

https://en.wikipedia.org/wiki/Design_of_the_FAT_file_system
https://www.win.tue.nl/~aeb/linux/fs/fat/fatgen103.pdf

We just tried, and mkfs.vfat does create FAT32 from 524 MiB on.
As long as your UEFI BIOS can boot from that partition, you are fine.

Please reopen if you cannot boot with this configuration.
Comment 2 Steffen Winterfeldt 2020-05-11 08:24:10 UTC
The cutover to FAT32 is 512 MiB. We're actually just below that by a slim margin.

IMHO the 500 MiB are just arbitrary and a case could be made to go for 512 MiB
as ESP size:

https://github.com/yast/yast-storage-ng/blob/master/src/lib/y2storage/volume_specification_builder.rb#L98-L114

Ancor, what do you think?
Comment 3 Ancor Gonzalez Sosa 2020-06-05 10:53:07 UTC
(In reply to Steffen Winterfeldt from comment #2)
> The cutover to FAT32 is 512 MiB. We're actually just below that by a slim
> margin.
> 
> IMHO the 500 MiB are just arbitrary and a case could be made to go for 512
> MiB
> as ESP size:
> 
> https://github.com/yast/yast-storage-ng/blob/master/src/lib/y2storage/
> volume_specification_builder.rb#L98-L114
> 
> Ancor, what do you think?

Well, maybe it's time to revisit the min, desired and max sizes for this. Taking into account that:

- The minimum size YaST considers correct is 256MiB, due to the limitations of FAT32 in 4K disks. But if we are creating a FAT16 filesystem for such small partitions, maybe the whole concern about FAT32 and 4K is pointless and we can reduce the minimum (something already requested in the past).

- The maximum looks indeed a bit arbitrary (I didn't find any strong reason to make it 500 instead of 512) and it has the FAT16 vs FAT32 implication already explained in this bug.

I have created this card: https://trello.com/c/kCiF61ap/4149-re-check-sizes-of-proposed-boot-efi.
Comment 4 Felix Miata 2020-10-19 16:02:02 UTC
(In reply to Ancor Gonzalez Sosa from comment #3)
> I have created this card:
> https://trello.com/c/kCiF61ap/4149-re-check-sizes-of-proposed-boot-efi.

This URL is not accessible even after logging in.
Comment 5 Ancor Gonzalez Sosa 2020-11-04 12:39:41 UTC
Behavior adapted as explained at
https://github.com/yast/yast-storage-ng/pull/1159

Available with yast2-storage-ng >= 4.3.18

Submit request for Tumbleweed
https://build.opensuse.org/request/show/845964

Submit request for SLE-15-SP3 (and, thus, Leap 15.3)
https://build.suse.de/request/show/229894