View previous topic :: View next topic |
Author |
Message |
gardenair n00b
Joined: 05 Oct 2021 Posts: 72
|
Posted: Fri Apr 26, 2024 10:57 am Post subject: [Solved] Need guidance about efi partition. |
|
|
hi,
I am facing an ambiguity and want to learn about (UEFI systems) /efi and /boot/efi ,
So installing Gentoo for a laptop corei7 9th Generation what is the best practice for efi setup in partition ?
If I follow Gentoo handbook https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Base#Preparing_for_a_bootloader here it shows
Code: | root #mkdir /efi # May have been created in a previous step
root #mount /dev/sda1 /efi |
but in some web sites there are steps how to setup the partitions for Gentoo in which they creates separate /efi partition with fat32 and separate /boot/efi using ext4
Code: |
/dev/ sad1 100Mb # For /dev/sda2 /boot/efi
/dev/sda2 1G # For /boot
/dev/sda3 /
/dev/sda4 /home
mkdir /boot/efi
mount /dev/sda1 /boot/efi
mount /dev/sda2 /boot |
What is the logic behind it to create a separate /boot/efi and separate /boot partition ? The thing I understand is if a user need multiple operating systems then he/she may adopt separate /boot/efi and separate /boot partition. In my case I only want to install Gentoo Linux so mount /dev/sda1 /efi with size of 1G is sufficient ?
Rest partitions should be "swap"and "/ " partitions.
Last edited by gardenair on Sat Apr 27, 2024 4:45 pm; edited 1 time in total |
|
Back to top |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 4891 Location: Bavaria
|
|
Back to top |
|
|
logrusx Advocate
Joined: 22 Feb 2018 Posts: 2233
|
Posted: Fri Apr 26, 2024 1:20 pm Post subject: Re: Need guidance about efi partition. |
|
|
gardenair wrote: |
but in some web sites there are steps how to setup the partitions for Gentoo |
For Gentoo, follow only the official Gentoo documentation, namely the Handbook and the Wiki pages.
You can also use the forums (obviously) and IRC.
Using outside resources may bring confusion. Use outside resources only when you know what you're doing and Gentoo or other distribution specifics won't bother you.
Best Regards,
Georgi |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54550 Location: 56N 3W
|
Posted: Fri Apr 26, 2024 4:03 pm Post subject: |
|
|
gardenair,
Mount points and partitions are fairly separate but related concepts.
In what follows they are not related at all.
First some definitions
Partitions exist on block storage devices.
Mount points are locations in the kernel filesystem tree where filesystems, often but not always, contained an partitions may be mounted.
Mount points only exist after the kernel has started. That's important. The EFI firmware has no concept of mount points. It does not need one.
When the EFI firmware starts it does some checks then reads the partition table to find the EFI System Partition.
You may have several EFI System Partitions but don't. It will make your head hurt.
From the ./EFI directory in the EFI System Partition, the EFI firmware will load an EFI compliant program.
That can be anything. An EFI stub kernel, a boot loader ... whatever.
The firmware does this all on its own. The kernel is not yet leaded so there are no mount points yet.
Whatever gets loaded, it has to bring up the system all on its own. Calls to the EFI FIrmware are possible, but its the EFI compliant program in RAM in control.
Lets say that its a boot loader like grub.
Grub will load the rest of itself and show a menu which you interact with to load the kernel and initrd of your choosing.
There is still no filesystem tree yet.
When the kernel starts, it is told where to find the root of the filesystem tree with root=... on the kernel command line.
Once root is mounted the filesystem tree and mount points begin to exist.
The localmount service attaches more filesystems (not partitions) to the tree.
Several things follow from this.
1. The EFI System Partition need only ever mounted in the kernel filesystem tree when its contents need to be changed.
2. As long as you know where it is, it can be a different place every time.
3. The concept of a location in the kernel filesystem tree for the EFI System Partition is only a user convenience. Its the user that maintains the mapping, The system does not mind, hence my opening Quote: | In what follows they are not related at all. |
The PC Boot Process may help.
In documents like the handbook, a fixed location is required for ease of reference. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
sMueggli Guru
Joined: 03 Sep 2022 Posts: 445
|
Posted: Fri Apr 26, 2024 5:09 pm Post subject: |
|
|
The ESP is always a FAT formatted partition.
Whether you mount it to /efi or /boot/efi is your choice. If you choose Grub as a bootloader then about 99% of the guides in the internet are expecting the ESP mounted to /boot/efi (, because this is the Grub-default). If you follow the Gentoo way and you like to blindly follow instructions, you will use /efi as mountpoint (and you have to remember that you mounted the ESP to /efi and not /boot/efi). If you follow the Gentoo way and you know, what you are doing, then you can do what you want.
Using either /efi or /boot/efi, you do not need a separate /boot-partition. But if you have a separate /boot-partition and you choose /boot/efi as mountpoint for the ESP, then you need to mount first /boot and afterwards /boot/efi (you have a nested mounts and the order is important). |
|
Back to top |
|
|
gardenair n00b
Joined: 05 Oct 2021 Posts: 72
|
Posted: Fri Apr 26, 2024 5:10 pm Post subject: |
|
|
Thanks all for the detailed reply. Appreciate it. The topic is itself a book. |
|
Back to top |
|
|
|