You are not logged in.

#1 2022-08-18 01:49:07

eleanor
Member
Registered: 2022-08-18
Posts: 4

2MiB EFI System Partition Gotchas

I tried to install Arch yesterday. The point was to have a system with less cruft, so when it came time to create the EFI System Partition, I saw that the Wiki said it could be as small as 2MiB. My awkward setup meant I did not also see that a partition that small would only work with FAT12. There were also apparently some EFI entries left over from previous distro-hops, which together meant rEFInd straight up refused to install and my system was left unbootable.

Anyways that whole experience and recovering from it was painful (I had to read the Wiki off an iPad because I didn't have another device and then had to borrow my neighbours' computer to reflash my n00b distro), so as you can imagine I'm not keen to repeat it. I'm wondering if the whole idea of a 2MiB ESP is stupid/I should just install Gentoo if I care, or if not, what else I should be aware of so as not to run into this problem again. (It'll be a while before I try again because I'm a bit soured now of course, but for future reference.)

Offline

#2 2022-08-18 02:03:37

Scimmia
Fellow
Registered: 2012-09-01
Posts: 9,822

Re: 2MiB EFI System Partition Gotchas

efi entries left over won't cause refind to fail. What was the actual problem? Without knowing that, there's not much we can say.

Online

#3 2022-08-18 05:53:39

eleanor
Member
Registered: 2022-08-18
Posts: 4

Re: 2MiB EFI System Partition Gotchas

`refind-install` "completed" with errors because there was "No space left on device". It put some files in place but not all. Reboot went straight to a boot select screen, with either rEFInd or [name of my system]. Either one simply flickered the screen.
There's an old thread about this problem that to my memory didn't reach a consensus on the issue. They thought it might be a problem with NVRAM being full, hence the idea to remove boot entries.

Offline

#4 2022-08-18 07:28:47

schard
Member
From: Hannover
Registered: 2016-05-06
Posts: 1,557
Website

Re: 2MiB EFI System Partition Gotchas

Don't paraphrase. Show us the actual error message.
Also show us

# ls -l /path/to/efi/partition
# df -h

Солідарність з Україною

Offline

#5 2022-08-18 08:19:53

eleanor
Member
Registered: 2022-08-18
Posts: 4

Re: 2MiB EFI System Partition Gotchas

I can't, the system has been nuked. I reflashed my old distro because I only have the one machine and having it usable is more important to me than having Arch on it.

Offline

#6 2022-08-18 08:24:05

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,632

Re: 2MiB EFI System Partition Gotchas

'No space left' on which device? The EFI partition or the NVRAM?


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#7 2022-08-18 11:13:17

eleanor
Member
Registered: 2022-08-18
Posts: 4

Re: 2MiB EFI System Partition Gotchas

It didn't say. I would have assumed the ESP because I guessed the script was trying to write there, but the other thread said the NVRAM, so I just don't know.

Offline

#8 2022-08-18 11:57:20

schard
Member
From: Hannover
Registered: 2016-05-06
Posts: 1,557
Website

Re: 2MiB EFI System Partition Gotchas

Well, since you wiped the system and are apparently no longer using Arch, it is futile to speculate, what the actual error message could have been.


Солідарність з Україною

Offline

#9 2022-08-31 02:12:28

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 6,823

Re: 2MiB EFI System Partition Gotchas

Unless you have a very niche use-case, the only reason I can think of to make the EFI smaller than 512M is if you want to test your firmware or enjoy making life difficult for yourself. Personally, I would never make it as small as 300M unless installing to a USB key or something.

That said, you could have booted your system using the install media and chrooted in. Just because it wouldn't boot independently doesn't mean it wasn't usable.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#10 2022-08-31 07:44:42

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 17,668

Re: 2MiB EFI System Partition Gotchas

If you aren't going to use the ESP to store kernel images you can definitely make it as small if you use a bootloader that takes up relevantly little space, I'd also say 2MiB cuts it quite short (though at least all relevant GRUB space "would" fit here) I'd say chances that your mainboard might throw a fit with something that small/they don't properly supporting FAT12

Offline

#11 2022-08-31 09:29:52

sabroad
Member
Registered: 2015-05-24
Posts: 242

Re: 2MiB EFI System Partition Gotchas

eleanor wrote:

The point was to have a system with less cruft, so when it came time to create the EFI System Partition, I saw that the Wiki said it could be as small as 2MiB. My awkward setup meant [...]

A 2MiB ESP seems unnecessarily complicated.

cruft - badly designed, unnecessarily complicated, or unwanted code or software


--
saint_abroad

Offline

#12 2022-08-31 16:42:40

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 18,890

Re: 2MiB EFI System Partition Gotchas

sabroad wrote:
eleanor wrote:

The point was to have a system with less cruft, so when it came time to create the EFI System Partition, I saw that the Wiki said it could be as small as 2MiB. My awkward setup meant [...]

A 2MiB ESP seems unnecessarily complicated.

cruft - badly designed, unnecessarily complicated, or unwanted code or software

Very well.  You could do this (and I mean this seriously).
First, use efistub and load the kernel directly from the EFI firmware (often mistakenly called BIOS).  No intermediate bootloader required.
Build a new kernel.  You can start with the normal Arch Linux kernel using the kernel configuration found in /proc/config.gz when booted into Arch.  Before you rebuild that kernel, use the kernel build tools (like make menuconfig) and disable all the "cruft" that is not applicable to your system.  Generally there will be all manner of drivers enabled as modules for things like video cards and network controllers you don't have.  This is actually not all that necessary as my goal is to have you not have any form of  initramfs.   What you do need to do is identify every module that is essential to your system and turn then from modules to 'enabled' so that they get baked into your kernel.  You can find what you need by booting up without any non-essential peripherals attached (things like thumb drives, or USB printers) then looking at the output of lsmod.  Find those modules in the configuration and promote them to 'enabled'.

Build your kernel and place it on your EFI partition.  Configure your EFI firmware to load and start it.  If you have built your kernel without the need for external modules required for boot, you will need no initrd parameters in your command line.  All you really need is a root invocation. 

You mentioned Gentoo.  Well, the process I outlined pretty much came from the Gentoo Handbook (or at least this was in there last time I read it).  The difference being that the file system (aside from EFI) is all Arch and is maintained as an Arch system.  It becomes incumbent on you, however, to keep your kernel updated.

Lastly, your kernel may need access to kernel modules for those things that might not be present or needed at boot time.  Again. things like external drives, USB headsets, game controllers, etc...  If you keep you kernel name the same and keep it up to date, your kernel should be able to use the modules for the Arch kernel.  The proper thing to do is rename your kernel and install the modules for your kernel under  /lib/modules. 

And, really lastly, you will probably *not* want to have your EFI partition mounted on boot so that when pacman does update the kernel, the files do not get written to the EFI partition; a partition that should be practically full.

Last edited by ewaller (2022-08-31 16:43:44)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB