4

I have installed Debian 11.5 on thin client. It has relatively small 16GB eMMC memory for storage.

During installation partitioner in "standard" mode created 3 partitions: EFI (508MB), root (14.2GB) and swap (1GB). After installation when I check disk space (df -h) I see this:

Filesystem      Size  Used Avail Use% Mounted on
udev            1.9G     0  1.9G   0% /dev
tmpfs           376M  2.3M  374M   1% /run
/dev/mmcblk0p2   14G  1.7G   12G  13% /
tmpfs           1.9G     0  1.9G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
/dev/mmcblk0p1  511M  3.5M  508M   1% /boot/efi
tmpfs           376M     0  376M   0% /run/user/1000

It looks like only 3.5M is used of 508M on /boot/efi partition.

Does it mean I can change it's size during installation to something like 16-32M, or it has to be as it is?

Can it grow somehow (assuming I will not change operating system or upgrade Debian distribution)?

Kamil
  • 719
  • 1
  • 8
  • 24

2 Answers2

2

There is no size limitation of the EFI system partition in the standard. The only restriction is it must be FAT32. However some system firmware can read FAT16 partitions.

Microsoft recommends 100 MB. The Linux recommendation of 550 MB to prevent accidentally creating a FAT16 filesystem likely originated here.

The minimum size of a FAT32 partition is 65,527 clusters, which works out to about 9216 bytes less than 32 megabytes. This will be fine if your boot loader is small. Keep in mind, you may need twice as much to have temporary space for upgrades.

Does it mean I can change it's size during installation to something like 16-32M, or it has to be as it is?

Re-run your install and manually create your partitions. I'd use 100 megabytes for the EFI partition. This should be a safe amount for most boat loaders.

Can it grow somehow?

It is possible, but very difficult. It will always be best to make your EFI partition about 220% of the minimum your boot loaders require to allow for maintenance.

James Risner
  • 1,143
  • 2
  • 4
  • 18
  • The UEFI specification requires that the firmware must be able to understand FAT32, but if your device's firmware also understand other filesystem types like FAT16, you can use them. If your bootloader does not require much space, you are free to use a smaller `/boot/efi`. FAT32 has a minimum size requirement of 65 527 clusters: at 1 blocks/cluster and a block size of 512 bytes, this works out to a minimum size of 33 549 824 bytes, or a bit over 31 MiB. – telcoM Oct 25 '22 at 22:13
  • Really? Creating 100x bigger partition for such "weak" reason? – Kamil Oct 25 '22 at 22:58
  • @telcoM Thanks for the math, I’ll update the answer with that detail later. – James Risner Oct 25 '22 at 23:35
  • @Kamil comes from this quote “I recommend creating an ESP that's 550MiB in size.“ here: http://www.rodsbooks.com/linux-uefi/ – James Risner Oct 25 '22 at 23:39
  • @Kamil On normal PCs, there is often so much disk space that parceling it out in smaller-than-gigabyte units starts to look like micro-managing. Microsoft’s recommendation considers only a single-OS installation with a Windows bootloader, and allows some space for UEFI firmware update capsules and similar boot time utilities. But a thin client is a special case: I would argue that standard recommendations are not necessarily a good fit for this use case, and some further customization might be a good idea. – telcoM Oct 25 '22 at 23:48
  • @telcoM Thank you for very useful information with sources. I understand that, we live in 2022, but when you type "Debian" in google you will see that Debian supposed to be "The Universal Operating System". Assuming something like "On normal PCs storage is cheap and there is no need to care about few hundred megabytes" is not the best idea. However on the other side - if something uses EFI - it can be assumed that this is "normal PC", and you can turn off EFI and use traditional bootloader. Unless you have very modern computer without old bootloader support (just EFI, like in my Wyse 5070). – Kamil Oct 28 '22 at 15:42
  • @Kamil A system with EFI may not necessarily be an x86 system - it might be ARM-based too. An ARM system with EFI might well be EFI-only, just like a very modern x86 system. But Debian claims to be the "universal operating system" *precisely because it can be adjusted to fit almost all circumstances* - not because "one size fits all". And since the OP specifically mentioned the target is a thin client, it is certain to have much less disk space than even an old "average x86" system, so sizing of the ESP should definitely be adjusted (to as small as possible) for that role. – telcoM Oct 28 '22 at 17:19
1

for what it's worth, I have been running RHEL 7, and CentOS 7, since version ~7.6 and have updated to 7.9 (the latest currently).

When I install RHEL/CentOS 7 from dvd and make disk partitions I always make /boot with a size of 1GB and /boot/efi with a size of 100MB and have never had a space problem.

One of my existing servers, which has been yum update'd numerous times over the last 3 years, here is its current disk size

/dev/sda3       3.5T  302G  3.2T   9% /
/dev/sda2       950M  249M  702M  27% /boot
/dev/sda1        95M   10M   85M  11% /boot/efi

so Does Debian 11.5 really need 500MB+ partition for EFI?

no, I don't think any linux does certainly not for the EFI partition.

under /boot if you wanted to keep an unlimited amount of past kernels versus the default 5 then you might consider upping /boot greater than 1gb. Here is what I have currently to give you an idea of what makes /boot for me 27% full of a 1gb size; this is RHEL 7.9 :

[root@server:/boot] : du -sh *
152K    config-3.10.0-1160.66.1.el7.x86_64
152K    config-3.10.0-1160.71.1.el7.x86_64
152K    config-3.10.0-1160.76.1.el7.x86_64
11M     efi
0       grub2
76M     initramfs-0-rescue-63a38dc3982544d5adc1c46384d7d1a5.img
35M     initramfs-3.10.0-1160.66.1.el7.x86_64.img
35M     initramfs-3.10.0-1160.71.1.el7.x86_64.img
35M     initramfs-3.10.0-1160.76.1.el7.x86_64.img
316K    symvers-3.10.0-1160.66.1.el7.x86_64.gz
316K    symvers-3.10.0-1160.71.1.el7.x86_64.gz
316K    symvers-3.10.0-1160.76.1.el7.x86_64.gz
3.5M    System.map-3.10.0-1160.66.1.el7.x86_64
3.5M    System.map-3.10.0-1160.71.1.el7.x86_64
3.5M    System.map-3.10.0-1160.76.1.el7.x86_64
6.5M    vmlinuz-0-rescue-63a38dc3982544d5adc1c46384d7d1a5
6.5M    vmlinuz-3.10.0-1160.66.1.el7.x86_64
6.5M    vmlinuz-3.10.0-1160.71.1.el7.x86_64
6.5M    vmlinuz-3.10.0-1160.76.1.el7.x86_64

my recommendation if you wanted to make /boot/efi as small as possible I would go 20MB; for /boot as small as possible I think 500MB would be safe and going to 300MB would be as far as I would push it. The EFI partition /boot/efi is always lean, because it points up and out into /boot for where the real boot (kernel) files reside which has significant size. The convention I'm used to seeing is /boot as XFS and /boot/efi as a vfat type file system; you don't have a specific /boot partition because debian choose a different convention and just has it under the main root partition which is fine and inherently solves any kind of potential space problem so all you have to worry about is the size of /boot/efi not being large enough.

ron
  • 5,749
  • 7
  • 48
  • 84