You are not logged in.

#1 2017-04-29 15:14:45

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

[SOLVED] UEFI newbie - Directory structure on EFI System Partition?

I'm installing Arch Linux on my first new computer in almost nine years. Which means I now have the pleasure of learning all about UEFI! Yay! big_smile

But now I'm so confused. sad

So, by following the instructions on the Arch Wiki page, I successfully:

  1. Created a 512 MiB partition on a new drive (the rest is EXT4).

  2. Formatted it to FAT32.

  3. Set the flags to "boot" and "esp".

  4. I plan to use EFISTUB.

I kind of get the hint that the ESP is supposed to have a very specific directory structure. My main question is... How is that directory structure created? Just "mkdir"?

Is this information in the Arch Wiki somewhere?

Thank you!

Last edited by drcouzelis (2017-05-02 13:51:20)

Offline

#2 2017-04-29 15:23:32

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,610

Re: [SOLVED] UEFI newbie - Directory structure on EFI System Partition?

There's not really a specific dir structure needed. If you need a default loader (like when telling the firmware to just boot from this drive without an NVRAM entry), it's in /EFI/Boot/, but that's about it.

Offline

#3 2017-04-29 15:44:20

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [SOLVED] UEFI newbie - Directory structure on EFI System Partition?

Ok... So I guess I'll just generally follow what's here, and plan to do this:

  1. Mount the ESP to "/esp".

  2. "mkdir -p /esp/EFI/arch

  3. Bind mount "/esp/EFI/arch" to "/boot" in "/etc/fstab", so Arch Linux will just treat it like the place to keep my Linux kernel installation.

  4. Tell my motherboard... something?

Does that look right? Sorry, I'm just kinda freaking out because I want to try to get it right the first time! tongue

Offline

#4 2017-04-29 15:45:53

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,610

Re: [SOLVED] UEFI newbie - Directory structure on EFI System Partition?

Yeah, that will work fine. Usually easier to just mount the ESP to /boot, but I can understand wanting to keep distros separate.

Offline

#5 2017-04-29 15:52:42

Alber
Member
From: Spain - España
Registered: 2011-11-11
Posts: 227

Re: [SOLVED] UEFI newbie - Directory structure on EFI System Partition?

If mother-board does not have a bootloader determined it searches automatically for:  $esp/efi/boot/bootx64.efi

Maybe this would be the next step?
    https://wiki.archlinux.org/index.php/systemd-boot

Edit:
To select what to launch there will be options to chose in the mother board's UEFI(BIOS).
Edit2:
It will look in the ESP partition for EFI executables.

Last edited by Alber (2017-04-29 16:13:03)


Because not all of us are native English speakers, try no to use slang or abbreviations, thank you.

Offline

#6 2017-04-29 16:09:37

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [SOLVED] UEFI newbie - Directory structure on EFI System Partition?

Scimmia wrote:

Yeah, that will work fine. Usually easier to just mount the ESP to /boot, but I can understand wanting to keep distros separate.

That's all I need to do??? I guess that makes sense... If the directory structure doesn't even matter, and I only plan on having Arch Linux installed, then I will just mount the ESP to "/boot" and get on with my life. tongue

Offline

#7 2017-04-29 16:22:36

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,610

Re: [SOLVED] UEFI newbie - Directory structure on EFI System Partition?

Yep, mount it to /boot and add the NVRAM entry, nothing more to it. People overcomplicate UEFI; all it really does is look at the NVRAM entries (similar to bootloader entries you're familiar with) and run the executable it finds there with the arguments given.

Offline

#8 2017-05-01 02:56:23

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [SOLVED] UEFI newbie - Directory structure on EFI System Partition?

Ok, I'm making "progress"... and also going insane. big_smile

I "add the NVRAM entry" by using "efibootmgr", correct? And I can only do that if my computer has already been started using EFI, correct?

So, I threw the latest Arch Linux ISO onto a USB drive, started my computer in a live Arch Linux environment using EFI, and used these "efibootmgr" instructions and used this command:

efibootmgr -d /dev/nvme0n1 -p 1 -c -L "Arch Linux" -l /vmlinuz-linux -u "root=/dev/nvme0n1p2 rw initrd=/initramfs-linux.img"

I then verify the change with this command:

efibootmgr

And I see my entry for "Arch Linux". I then reboot and...

The entry for Arch Linux is now gone.

Is there something obvious I'm doing wrong?? sad

Offline

#9 2017-05-01 14:05:36

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,610

Re: [SOLVED] UEFI newbie - Directory structure on EFI System Partition?

If it's there, then not there, it sounds like your system firmware just sucks. Unfortunately, not an uncommon situation. You likely won't be able to set things up the way you're wanting to; I would suggest systemd-boot. It's a simple menu that just runs other UEFI executables, so instead of just running the kernel, you'll run this which will then run the kernel. The advantage is that it will install itself as the default UEFI loader, so it will hopefully boot. If it doesn't and your firmware is hard-coded to look for the Windows loader, you can also copy the systemd-boot executable to that location.

THIS is what makes UEFI complicated, horrible firmware.

Offline

#10 2017-05-01 14:20:20

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

Re: [SOLVED] UEFI newbie - Directory structure on EFI System Partition?

Some UEFI also only allow new entries to be added from their own interface, so looking through your UEFI menu for an option add new entries might also be a possibility.

Offline

#11 2017-05-02 13:51:01

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [SOLVED] UEFI newbie - Directory structure on EFI System Partition?

The issue is solved! smile

I decided to use systemd-boot "bootctl", and everyone is right, it really is super simple.

One strange thing is, after I used bootctl and successfully booted using UEFI, what did I find? My original EFISTUB Arch Linux entry in UEFI! tongue Whatever. It was so easy and simple to use bootctl, I decided to stick with it and just remove the old entry for EFISTUB.

Anyway, I'm now booting a fresh Arch Linux installation using UEFI on my new NVMe drive, and it is FAST! smile

Thank you, everyone!

Offline

Board footer

Powered by FluxBB