How to know the proper amount of needed disk space for EFI partition
Solution 1:
You cannot know the exact size unless:
- you plan on never updating the OS
- you perform a preliminary test installation, then use that information to recreate the partitions during another OS installation
Using my own machines as a reference, the EFI partitions on the daily workhorses are 1GB in size. The partitions exist on a storage device that is at least 512GB in size. Currently none of the EFI partitions exceed 1.8% utilisation, or 180MB (the lowest is 97MB).
Having been burned by excessively small EFI partitions in the past, I allowed the Ubuntu installation wizard choose the size of its EFI partition and have had exactly 0 issues since then.
Additional Notes:
Microsoft recommends 100 MB for its operating systems, while many Linux forums suggest more for Linux based operating systems or for any dual boot or multi booting situations.
The author of gdisk suggests 550 MiB.
As per the Arch Linux wiki, to avoid potential problems with some EFIs, ESP size should be at least 512 MiB. 550 MiB is recommended to avoid MiB/MB confusion and accidentally creating FAT16.
So, most common size guideline for EFI System Partition is between 100 MB to 550 MB. One of the reason behind this is it is difficult to resize later as it is the first partition on the drive. EFI partition may contain languages, fonts, BIOS firmware, other firmware related stuffs. There are some firmware/software that are installed into the the EFI partition instead of the data drive.
As it may be difficult to enlarge the size of the EFI partition in the future, and because many storage devices measure in the hundreds of gigabytes, it makes sense to go with something that is not the absolute minimum unless the plan is to install the OS, disconnect the device from the Internet, and run it without updates until the end of time.
Solution 2:
The space required depends on the boot method used and what other operating systems are installed.
GRUB installs its first and second stage bootloader only, which is fairly small, and then uses its own file system drivers to load the kernel and initrd through the EFI interface for block device access. You get away with a few megabytes for that.
The systemd bootloader and Windows copy both their kernel and an initial ramdisk containing drivers into the ESP, which requires a bit of space -- how much exactly depends on the drivers included in the initial ramdisk.
Windows selects only the bare minimum drivers, analogous to selecting MODULES=dep
in initramfs.conf, so they get away with a few megabytes, but fail to boot if the hardware changes too much (e.g. when you move the harddisk from an internal SATA port to an add-on card).
Ubuntu, to my knowledge, defaults to MODULES=most
, so it copies a few megabytes of drivers into the initramfs. This is robust, but requires additional space.
Ubuntu typically keeps the last two kernel versions installed, so there needs to be enough space for two versions of the initramfs, plus one extra during upgrades (where the new one is copied to the ESP before the old one is deleted).
So:
If you use GRUB only and do not plan to (ever) switch, you get away with 10 MB.
If you dual-boot into Windows and use GRUB, Windows's default of 100 MB is good.
If you plan to use systemd-boot, leave enough space for at least three copies of the initramfs, which is around 30-40 MB at this time and will likely grow in future releases. 200 MB should be safe, typical installations use 500 MB because with modern harddisk sizes, it doesn't matter.