Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
UEFI handbook issue
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
andrewwalker27
l33t
l33t


Joined: 27 Jun 2005
Posts: 660

PostPosted: Mon Jun 15, 2020 2:41 pm    Post subject: UEFI handbook issue Reply with quote

I'm trying to follow the manual to install Gentoo but I've hit a problem. The handbook appears to omit the creation of the fat32 ESP partition in the 'Creating File Systems' section.
It does refer to it much earlier in the 'What is the EFI System Partition (ESP)?' section, which I think is probably the wrong place for it, but when I try to create the filesystem I get the following error,
Code:
 fred@Ryzen7:/mnt$ sudo mkfs.fat -F 32 /dev/nvme1n1p1
mkfs.fat 4.1 (2017-01-24)
WARNING: Not enough clusters for a 32 bit FAT!
fred@Ryzen7:/mnt$

I gave the partition 2M of space as per docs, is this a fatal error?
I also notice that it mentions in 'Mounting the Root Partition' mounting other partitions, I assume I need to mount /boot partition as /mnt/gentoo/boot but what do I do with the EFI partition? It mentions later about grub2 needing it mounted but where do I mount it in my file system?
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7711
Location: Saint Amant, Acadiana

PostPosted: Mon Jun 15, 2020 3:49 pm    Post subject: Reply with quote

This 2 MB partition is for legacy boot using Grub2. Not needed for UEFI. IMHO Grub2 is also not needed for UEFI, there are better ways to boot Gentoo than this bloated and overly complex Grub2.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3487

PostPosted: Mon Jun 15, 2020 4:34 pm    Post subject: Re: UEFI handbook issue Reply with quote

andrewwalker27 wrote:
... The handbook appears to omit the creation of the fat32 ESP partition in the 'Creating File Systems'

it is there
https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Disks#Creating_the_partitions wrote:
(parted) mkpart primary 3 131
(parted) name 2 boot

And it even includes the
Quote:
Note
On an UEFI installation, the boot and esp flags will show up on the boot partition.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 46087
Location: 56N 3W

PostPosted: Mon Jun 15, 2020 5:03 pm    Post subject: Reply with quote

andrewwalker27,

There are three things to untangle here.

1, The 2M partition is for use by grub directly, Its not yours, you don't mount at any time and any filesystem you create here will be destoyed by grub.

2. If you will use UEFI booting, the 2MB partition is not used, but you must have an EFI partition that is formatted FAT32.
The UEFI firmware will read this filesystem to load EFI compliant programs.

3. The EFI filesytem may be (does not need to be) home to your kernels and initrd files.
As the handbook does not create separate EFI and boot partitions, it assumes that boot will serve both purposes.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7711
Location: Saint Amant, Acadiana

PostPosted: Mon Jun 15, 2020 6:12 pm    Post subject: Reply with quote

Maybe you expect too much from the Handbook? I do not think of it as a holy writeup which must be followed to the letter. For me it has always been a reference, a guide. In other words, I know what I'm doing and I read the Handbook to get useful tips, make sure I haven't forgotten anything and maybe learn a piece of knowledge I didn't have before.
Maybe NeddySeagoon here can shed some light on this, what exactly is the Handbook?
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
GDH-gentoo
Guru
Guru


Joined: 20 Jul 2019
Posts: 458
Location: South America

PostPosted: Mon Jun 15, 2020 6:43 pm    Post subject: Reply with quote

Also worth noting, because people apparently miss it, that the partioning scheme and the partition's filesystems shown in the Handbook are examples.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 46087
Location: 56N 3W

PostPosted: Mon Jun 15, 2020 7:51 pm    Post subject: Reply with quote

Jaglover,

The handbook is supposed to be enough detail for a new user to install Gentoo.

The partitioning and filesystems sections try to cover BIOS and EFI installs. As a result, those parts are can be difficult to to follow.
With most users using EFI today, there are plans to refactor the partitioning and filesystems sections.
The proposal is that the handbook cover EFI installs only with BIOS users being pointed at an annex.
That will make those sections of the handbook eaiser to follow.

As one of those who spoke up against the total removal of BIOS support from the handbook, I had to offer to generate the annex :)
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
andrewwalker27
l33t
l33t


Joined: 27 Jun 2005
Posts: 660

PostPosted: Mon Jun 15, 2020 10:02 pm    Post subject: Reply with quote

Sorry, I didn't explain it correctly, I meant the formatting of the fat32 partition wasn't mentioned in the 'Applying a filesystem to a partition'. I mention it because it's pretty essential for it to boot. I know the info is explained earlier in the manual but would be better placed in the 'Applying a filesystem to a partition' section.
I realise it is a guide but as NeddySeagoon stated,
Quote:
The handbook is supposed to be enough detail for a new user to install Gentoo.

I haven't installed Gentoo on a UEFI system before and it's been a lot of years since I last installed it so I'm a bit rusty.
I think that the handbook needs to allow a newbie to end up with a basic working system from the examples, it's not the easiest thing in the world to learn. I don't intend to be critical, just think that the manual could be clearer and if the section gets updated maybe this could be looked at.
Thanks to all for your help.
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 4006
Location: Illinois, USA

PostPosted: Mon Jun 15, 2020 11:32 pm    Post subject: Reply with quote

IMHO, the handbook should fork at two points - partioning UEFI/BIOS and again at OpenRc/Systemd.
Presenting it all linearly is confusing.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3487

PostPosted: Tue Jun 16, 2020 6:22 am    Post subject: Reply with quote

andrewwalker27 wrote:
Sorry, I didn't explain it correctly, I meant the formatting of the fat32 partition wasn't mentioned in the 'Applying a filesystem to a partition'. I mention it because it's pretty essential for it to boot.

Fully agree. There is a discussion already on the Talk page where I think you should add your point.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 46087
Location: 56N 3W

PostPosted: Tue Jun 16, 2020 10:49 am    Post subject: Reply with quote

andrewwalker27,

Join in the fun on the talk page.


Tony0945,

That's a part of the driver to split the BIOS/UEFI parts out.
Legacy BIOS support on new hardware is getting more and more broken, so BIOS is only recommended on older equipment.
I still don't have any UEFI systems.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7711
Location: Saint Amant, Acadiana

PostPosted: Tue Jun 16, 2020 11:05 am    Post subject: Reply with quote

NeddySeagoon wrote:
The handbook is supposed to be enough detail for a new user to install Gentoo.


Then this is really simple, methinks. I consider myself an average Gentoo user. I did not need any help with partitioning when I installed Gentoo first time, 16 years ago. Because there is nothing Gentoo specific about partitioning. NeddySeagoon, if your statement is to be taken seriously then there is no need to cover partitioning in Gentoo installation Handbook. Letting new users to know Gentoo has no special partitioning needs will suffice.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 46087
Location: 56N 3W

PostPosted: Tue Jun 16, 2020 1:41 pm    Post subject: Reply with quote

Jaglover,

Maybe I should have said "new user to Linux"
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 4006
Location: Illinois, USA

PostPosted: Tue Jun 16, 2020 2:04 pm    Post subject: Reply with quote

NeddySeagoon wrote:
I still don't have any UEFI systems.

I have two and I'll be building a third if parts ever get back in stock, the US government having sent me $2400 to stimulate China's economy.
I have two currently active BIOS systems and will be installing two more, a cheap case bought last year and drives bought on sale last year and a recycled motherboard and converting my wife's nne year old Win7 laptop. Both of those are k10 CPU's as is this computer. Last night pre-dawn I was dreaming of how to clone the existing k10 system without emerge -e @world. I'll post that in "Tips and tricks" after I actually do it. The actual cloning is applicable to both BIOS and UEFI, only installation of boot code differs.

But I'm veering off subject.


Last edited by Tony0945 on Wed Jun 17, 2020 12:45 am; edited 1 time in total
Back to top
View user's profile Send private message
joanandk
Tux's lil' helper
Tux's lil' helper


Joined: 12 Feb 2017
Posts: 120

PostPosted: Tue Jun 16, 2020 6:27 pm    Post subject: Reply with quote

@andrewwalker27: If you have an UEFI implementation, your partition scheme must look like this:
/dev/sda1, fat32, 200MB - 250MB declared as EFI System partition.
/dev/sda2, on a dual system, this would be Windows NTFS partition. Otherwise it can be swap or root or anything you want.
/dev/sda3, on a dual system, this would be the hidden Windows Recovery partition. Otherwise can be used for anything you want.
...

If you have a BIOS implementation, there is no need for an EFI system partition. As the boot-loader (Lilo and GRUB are able to read any Linux partitions), you are free in partitioning.

@NeddySeagoon: It is more than fine to address "new user to Linux". I was in that situation in 1995. I have had very hard time getting into Linux.

@Jaglover: You are correct, there is no Gentoo specific partitioning. But Gentoo is by far the best distribution to get to know how Linux works under the hood. I have stared around 1995 with Redhat, changed to Debian and came to Gentoo. Thanks to the installation guide, I was able to get started with Gentoo and stay with Gentoo.
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 4006
Location: Illinois, USA

PostPosted: Wed Jun 17, 2020 12:51 am    Post subject: Reply with quote

joanandk wrote:
/dev/sda1, fat32, 200MB - 250MB declared as EFI System partition.

Waste of disk space.
Code:
 # fdisk -l /dev/sda
Disk /dev/sda: 465.78 GiB, 500107862016 bytes, 976773168 sectors
Disk model: CT500MX500SSD1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 3EE9432E-169D-4EC5-A9EC-7F932FBDCD61

Device      Start       End   Sectors   Size Type
/dev/sda1    2048    206847    204800   100M EFI System
/dev/sda2  206848 976773134 976566287 465.7G Linux filesystem
 #  df -h|grep sda
/dev/sda1         99M  2.0M   97M   3% /boot/efi

I only used 100M because that's what Windows uses so I could be sure that the mobo supported it. As you see, most of that is waste also.
Back to top
View user's profile Send private message
Anon-E-moose
Advocate
Advocate


Joined: 23 May 2008
Posts: 4784
Location: Dallas area

PostPosted: Wed Jun 17, 2020 9:29 am    Post subject: Reply with quote

I did away with the old boot partition when I put the new system together, but I went ahead and put the same size partition for ESP that the old boot partition had.

Code:
Filesystem      Size  Used Avail Use% Mounted on
/dev/nvme0n1p1  2.0G  457M  1.6G  23% /boot


I use ~1/4 of the 2 gig, part of that is that's where I keep the squasfs for the admincd which makes it easy to boot into that from the boot prompt and faster that a usb stick.

Even if the space is wasted, I'm using 2g out of 500g, hardly worth me being overly parsimonious.
_________________
PRIME x570-pro, 3700x, RX 550 & 560 - 5.8 zen kernel
Acer E5-575 (laptop), i3-7100u - i965 - 5.5 zen kernel
---both---
gcc 9.3.0, profile 17.1 (no-pie & modified) amd64-no-multilib, eudev, openrc, openbox, palemoon
Back to top
View user's profile Send private message
pietinger
Guru
Guru


Joined: 17 Oct 2006
Posts: 313
Location: Bavaria

PostPosted: Wed Jun 17, 2020 10:32 am    Post subject: Reply with quote

joanandk wrote:
/dev/sda1, fat32, 200MB - 250MB declared as EFI System partition.

It depends what you want to store in it.
UEFI spec. recommends 128 MB.
This would be too much for one linux stub kernel (no dual boot) and it can be to less if you are using initramfs/initrd.
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 4006
Location: Illinois, USA

PostPosted: Wed Jun 17, 2020 3:01 pm    Post subject: Reply with quote

pietinger wrote:
It depends what you want to store in it.

I refuse to store anything more than the minimum required on FAT. The rEFInd executable is there. That's it. Everything else is on ext4.
Back to top
View user's profile Send private message
pietinger
Guru
Guru


Joined: 17 Oct 2006
Posts: 313
Location: Bavaria

PostPosted: Wed Jun 17, 2020 5:01 pm    Post subject: Reply with quote

Tony0945 wrote:
I refuse to store anything more than the minimum required on FAT. The rEFInd executable is there. That's it. Everything else is on ext4.

Me too. In my efi there is only one linux stub kernel.
Back to top
View user's profile Send private message
Gentobobbyuk
Tux's lil' helper
Tux's lil' helper


Joined: 23 May 2020
Posts: 142

PostPosted: Sun Jun 21, 2020 9:16 pm    Post subject: Reply with quote

Jaglover wrote:
NeddySeagoon wrote:
The handbook is supposed to be enough detail for a new user to install Gentoo.


Then this is really simple, methinks. I consider myself an average Gentoo user. I did not need any help with partitioning when I installed Gentoo first time, 16 years ago. Because there is nothing Gentoo specific about partitioning. NeddySeagoon, if your statement is to be taken seriously then there is no need to cover partitioning in Gentoo installation Handbook. Letting new users to know Gentoo has no special partitioning needs will suffice.


Disagree ive been having problems for days

setting up mbr i can follow from the hand book and im dyslexic
Setting up GPT UEFI in vmware works fine using the handbook again easy
Setting up GPT UEFI on a main machine ive had days of issues yet the answer was so simple,but from the handbook id never have got it .
Remember people understand things in different ways,
Without the help of multiple users over the last few days id never have understood it .


It really is as simple as
for uefi based systems using a basic layout partition this creates for partitions

the first one i still dont understand but just make it. its 1 to 3 mb this actually now appears in my bios as a seprate drive no idea why.

the second one is used by grub or grub install its self here or reads efi info here it does something like that.

third is swap
fourth is root

when using sda drives and these partitions
make sure the correct kernel stuff is there

parted -a optimal /dev/sda
mklabel gpt
unit mib
mkpart primary 1 3
name 1 grub
set 1 bios_grub on
print
mkpart primary 3 131
name 2 boot
mkpart primary 131 16515
name 3 swap
mkpart primary 16515 -1
name 4 rootfs
set 2 boot on

use the correct file systems
remember no file system needs to be applied to the first
make sure u set the 1 and 2

create the correct file systems
make sure the /boot is vfat -F 32
when you chroot make sure /boot is mounted to /dev/sda2
make sure when you compile your kernel /dev/sda2 is mounted to boot (Not actually necessary yet)
make sure fstab is correct
install grub make sure your make.conf has the GRUB_PLATFORMS part added mentioned in handbook else grub will compile wrong
i think its GRUB_PLATFORMS="efi-64"

use
grub-install --target=x86_64-efi --efi-directory=/boot
if that all works

grub-mkconfig -o /boot/grub/grub.cfg

then your done

if u get errors here it means that the drive is not formatted correctly for either uefi
make sure its defiantly formatted right
umount /dev/sda2
mkfs.vfat -F 32 /dev/sda2
mount /dev/sds2 /boot
cd /usr/src/linux
make install
next
grub-install --target=x86_64-efi --efi-directory=/boot
grub-mkconfig -o /boot/grub/grub.cfg


thats how ive fixed it


Last edited by Gentobobbyuk on Sun Jun 21, 2020 9:19 pm; edited 1 time in total
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 4006
Location: Illinois, USA

PostPosted: Sun Jun 21, 2020 10:06 pm    Post subject: Reply with quote

TWO partitionds, not four. You can have a hundred if you like but TWO are sufficient!
Code:
 # fdisk -l /dev/sda
Disk /dev/sda: 232.91 GiB, 250059350016 bytes, 488397168 sectors
Disk model: Crucial_CT250MX2
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: B71B8547-F661-4A0E-A610-5FE0BDF75913

Device       Start       End   Sectors   Size Type
/dev/sda1     2048   2099199   2097152     1G EFI System
/dev/sda2  2099200 488392703 486293504 231.9G Linux filesystem
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 46087
Location: 56N 3W

PostPosted: Sun Jun 21, 2020 10:10 pm    Post subject: Reply with quote

Tony0945,

I like a small non essential swap near the start of the drive so I can install DOS.
Just for old times sake. :)
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pietinger
Guru
Guru


Joined: 17 Oct 2006
Posts: 313
Location: Bavaria

PostPosted: Sun Jun 21, 2020 10:14 pm    Post subject: Reply with quote

Tony0945 wrote:
TWO partitionds, not four. You can have a hundred if you like but TWO are sufficient!

Nope. I can top this: ONE partition !

Because I have also no swap partition and I (uefi-) boot my notebook from a usb-stick.
This stick contains a monolitihic stub kernel, doing also dm-crypt. My whole partition on ssd is an encrypted root partition.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum