You are not logged in.

#1 2024-04-21 16:06:32

Sunsper
Member
Registered: 2024-04-21
Posts: 4

[SOLVED] Need help with ESP partition

Hello, everyone! A very fresh Arch Linux newbie here.

At this moment I'm trying to experiment a bit with installing Arch Linux onto my 1TB HDD, from which I pulled all of the data stored there just for this purpose, before I'm ready to install Arch on my main NVMe drive.
And also in general I'm just practicing my manual installation skills.

I need some help/advice on how to deal with an ESP partition.
Since the Wiki as of late clearly recommends to mount ESP partition as /efi instead of /boot/efi, discouraging the latter and saying that it is no longer recommended (https://wiki.archlinux.org/title/EFI_sy … unt_points), I want to try exactly that.
I'm typing this post here because I couldn't find much information about how to actually deal with this.
I'm not going to mount ESP part. as /boot since I want to build an Arch/Windows 11 dual boot setup on the said NVMe, and I know that doing so will inevitably cause problems.

The problem is that so far after a few attempts at installation, both manually and through the archinstall script, I had no success at actually booting into the system.
That is, of course, because the /efi path always ends up empty, and pacstrap puts kernel files in /boot.

I've tried to copy vmlinuz-linux to ESP, edit the mkinitcpio preset and recreate the initramfs image there too.
I've tried to manually create bootloader entries, but with no success. My current bootloader of choice is systemd-boot.

What am I missing? Am I doing something wrong?
I want to actually understand how to make the system work with /efi ESP partition in mind.

Last edited by Sunsper (2024-04-22 23:22:00)

Offline

#2 2024-04-21 16:55:13

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,809

Re: [SOLVED] Need help with ESP partition

You're missing that systemd-boot cannot trivially read the kernel of off your root partition which is where /boot and hence the kernel is going to be located.

This will work without much trouble with GRUB or refind however.

If you actually want to share the ESP anyway, there's no inherent problem mounting it to /boot and then using systemd-boot to boot those.

What you fundamentally need to understand that the exact mount point of the ESP is completely irrelevant to the main need of the ESP -- your motherboard needs a partition it can load bootable entries from and that needs to be a VFAT variant, where you're mounting that in your linux filesystem is irrelevant to that. The only distinction for whether you use /boot or any other mount point is where your kernel images are generated to by default, hence whether kernel images will land on the ESP (because you mount it to /boot) or not (because you mount it anywhere else). To that end goal you need to select the appropriate boot loader that can read kernel images from the spot you are putting them, by default for systemd-boot that will just be the same ESP it has been installed to, for refind or GRUB you have more flexibility.

Last edited by V1del (2024-04-21 16:59:53)

Offline

#3 2024-04-21 18:10:11

Sunsper
Member
Registered: 2024-04-21
Posts: 4

Re: [SOLVED] Need help with ESP partition

V1del wrote:

You're missing that systemd-boot cannot trivially read the kernel of off your root partition which is where /boot and hence the kernel is going to be located.

So you're saying that this will not work even if I manually copy the files from /boot to /efi? I mean the Wiki page about systemd-boot says, that when you run "# bootctl install", the said bootloader will look for ESP point not only in /boot, but also /boot/efi and /efi too.

V1del wrote:

This will work without much trouble with GRUB or refind however.

I will treat this as a suggestion to try either of these. I still wonder what rEFInd is like, so I will try that one.

V1del wrote:

If you actually want to share the ESP anyway, there's no inherent problem mounting it to /boot and then using systemd-boot to boot those.

I've heard a lot of times that Windows sometimes tends to break boot for Linux installed alongside it, even though I think it is not THAT much of an issue nowadays. Still, I'd like to keep bootloaders for both systems somewhat separated to their own directories.

V1del wrote:

The only distinction for whether you use /boot or any other mount point is where your kernel images are generated to by default, hence whether kernel images will land on the ESP (because you mount it to /boot) or not (because you mount it anywhere else).

This leads me to believe that I'm indeed doing something wrong maybe, because no matter where I mount the ESP, kernel files are still generated in /boot without taking my mountpoint into consideration.
And yes, I already know that it is pretty much irrelevant where do I mount ESP since it only needs to be mounted for the booting sequence of the system and is irrelevant for the operation of the OS itself.

It's just that I'm trying to make the system work with ESP mounted at /efi, which is pretty much a recommended thing at this point, and I'm not entirely sure why it doesn't work for me. As I already mentioned, there's not that much info on this specific topic (or at least it seems so to me), not even YouTube tutorials bother to show steps of Arch installation with this exact ESP mountpoint.

Offline

#4 2024-04-21 18:27:45

Fuxino
Member
From: Slovakia
Registered: 2014-09-26
Posts: 185

Re: [SOLVED] Need help with ESP partition

Sunsper wrote:

It's just that I'm trying to make the system work with ESP mounted at /efi, which is pretty much a recommended thing at this point

You can also look into UKIs.


Arch + XMonad

Dotfiles: https://github.com/Fuxino/dotfiles

Offline

#5 2024-04-21 18:34:40

Sunsper
Member
Registered: 2024-04-21
Posts: 4

Re: [SOLVED] Need help with ESP partition

Fuxino wrote:

You can also look into UKIs.

Yeah, I had thoughts about UKI the last time I tried to install Arch the way I described. Will do.

Edit: I took a close look at UKI Wiki page and it looks very interesting and promising to me, considering my ESP mountpoint choice. I will try to utilize this.

Last edited by Sunsper (2024-04-21 18:48:17)

Offline

#6 2024-04-21 21:12:36

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,809

Re: [SOLVED] Need help with ESP partition

Sunsper wrote:

So you're saying that this will not work even if I manually copy the files from /boot to /efi? I mean the Wiki page about systemd-boot says, that when you run "# bootctl install", the said bootloader will look for ESP point not only in /boot, but also /boot/efi and /efi too.

It will work, but is something you need to actively think about, at no benefit towards the logical conclusion/end result. it sounds like you either didn't properly copy over the images, and/or in turn created incorrect entry confs for systemd, maybe post what you created there (common pitfall: you wrote /efi/vmlinuz-linux into your entry conf, while you'd have to operate from the "root" of the ESP, in which case you'd have to put /vmlinuz-linux

Sunsper wrote:

I've heard a lot of times that Windows sometimes tends to break boot for Linux installed alongside it, even though I think it is not THAT much of an issue nowadays. Still, I'd like to keep bootloaders for both systems somewhat separated to their own directories.

That will not help you, since Windows also doesn't care about your linux mount point, it will simply use the ESP for it's own bootloader. The general worst that can happen here is that you're not giving it enough size to hold both sets of tools you want/need to have on there, this becomes more of a concern if you also house the initramfs/vmlinuz since those can become quite big depending on included modules. If that is not the issue, then generally nothing bad is going to happen here, the only time Windows actively "manipulates" something that can inherently affect your ability to boot linux (outside of size constraints) is that it will override the fallback /EFI/BOOT/BOOTx64.EFI ... if your mainboard is in any way sane, then you'll have a distinct entry for distinct bootloaders and do not have to rely on that path (read, most mainboards, except for MSI...)

Sunsper wrote:

This leads me to believe that I'm indeed doing something wrong maybe, because no matter where I mount the ESP, kernel files are still generated in /boot without taking my mountpoint into consideration.

You misunderstand the "power" of the ESP. It doesn't have any. The default configuration of mkinitcpio is that it will generate kernel images into /boot -- no matter whether that's mounted somewhere else (like the ESP) or part of your root partition. You can reconfigure that in mkinitcpio presets if need be, but by default at minimal the "first" set of kernel images will land on /boot by default

Sunsper wrote:

It's just that I'm trying to make the system work with ESP mounted at /efi, which is pretty much a recommended thing at this point, and I'm not entirely sure why it doesn't work for me. As I already mentioned, there's not that much info on this specific topic (or at least it seems so to me), not even YouTube tutorials bother to show steps of Arch installation with this exact ESP mountpoint.

Where do you get the "reccommendation" from? The wiki outlines that as a potential possible option, but as mentioned, you could have your esp on /totallynotmyESP and as long as you logically understand how things are mounted you can coerce all of the relevant tools to use that. I also use /efi and you can just do a e.g. with GRUB

 grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=GRUB

which will lead to GRUB landing there

Offline

#7 2024-04-21 21:49:58

cassowary
Member
Registered: 2022-11-24
Posts: 5

Re: [SOLVED] Need help with ESP partition

Fuxino wrote:
Sunsper wrote:

It's just that I'm trying to make the system work with ESP mounted at /efi, which is pretty much a recommended thing at this point

You can also look into UKIs.

As an UEFI and Arch-UKI newbie I didn't get it to work reliably. After the first install (a dual boot Arch with Gnome+Wayland and KDE+X11 respectively) everything looked fine but the installation broke (every time) entirely after a kernel update. The Arch wiki falls a little short in explicating things imho especially when it comes to configuration details (UKI, GRUB, mkinitcpio) so I never found out what I screwed up and postponed my Arch UKI-experience to a distant future (I don't like to ask for help).

So maybe keep that in mind if you want to play around with UKI.

hth and have a nice day.

Offline

#8 2024-04-22 23:21:39

Sunsper
Member
Registered: 2024-04-21
Posts: 4

Re: [SOLVED] Need help with ESP partition

I GOT IT! I SOLVED THE PUZZLE!

With help and advice from you guys in this very topic, through rigorous reading of Arch Wiki and through trial and error I believe I finally figured this all out and I was finally able to manually build Arch and successfully boot into it!
Also shoutout to Walian and both of his tutorials:
https://www.youtube.com/watch?v=Ov8qPrjDaj8
https://www.youtube.com/watch?v=xUlB5p3aTl0
https://www.walian.co.uk/arch-install-w … mages.html
Parts of his installation script have also helped me figure this stuff out.

Just like I wanted, I made /efi path my ESP partition, I opted in to using UKIs instead of regular kernel files to boot the system and systemd-boot is working for me really good. I'll see I'll manage to setup a dual boot system on my main drive and smoothly boot into both Arch and Windows from one bootloader.

All of that was a bit of a massive headache for me for the last few days, but I'm glad that I solved this. With that being said, I'm marking this topic as solved.
If anyone wants any details from me — please let me know.

Last edited by Sunsper (2024-04-23 11:54:04)

Offline

Board footer

Powered by FluxBB