Gentoo Archives: gentoo-user

From: Michael <confabulate@××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Dual booting with Windows 10
Date: Mon, 24 May 2021 15:15:07
Message-Id: 1829103.taCxCBeP46@lenovo.localdomain
In Reply to: Re: [gentoo-user] Dual booting with Windows 10 by Peter Humphrey
1 On Monday, 24 May 2021 14:11:00 BST Peter Humphrey wrote:
2 > On Friday, 21 May 2021 20:06:25 BST Michael wrote:
3 > > On Friday, 21 May 2021 15:42:01 BST peter@××××××××××××.uk wrote:
4 > > > Hello list,
5 > > >
6 > > > Mynew machine has Win-10 installedon /dev/nvme0n1 with the ESP as
7 > > > partition
8 > > > 1. I want to install Gentoo on /dev/nvme1n1. So far I haven't found a
9 > > > way
10 > > > to set up a working boot arrangement. I've tried mounting the ESP on
11 > > > /efi,
12 > > > on /EFI and on /boot/EFI. Efibootmgr seems to write a boot entry in some
13 > > > of
14 > > > those cases, and it's still there after a reboot - but it isn't visible
15 > > > to
16 > > > the BIOS.
17 > > >
18 > > > Can anyone offer some enlightenment, please?
19 > >
20 > > If your ESP is on /dev/nvme0n1 and you are using vmlinuz symlinks, you can
21 > > use /boot/EFI as the mountpoint for the ESP VFAT partition. Your
22 > > kernels/config/ System.map/initrd.img files will go into /boot, which will
23 > > be on the same fs as / on /dev/nvme1, using a fs which supports symlinks.
24 > >
25 > > The efibootmgr '--loader' option should/could be used to specify the path
26 > > to your bootloader image, or if you are not using a bootloader image to
27 > > chainload your kernel with, point it directly to the path of your kernel;
28 > > e.g.
29 > >
30 > > efibootmgr --create --disk /dev/nvme0n1 --part 1 --label "gentoo-5.10.27"
31 > > \
32 > > --loader "\EFI\gentoo\gentoo-5.10.27.efi"
33 > >
34 > > The BIOS/UEFI menu should be able to list entries of bootable *.efi
35 > > images,
36 > > as long as they are within the subdirectory of /boot/EFI on the ESP, but
37 > > if
38 > > you are using a bootloader, then it is the bootloader image which will run
39 > > and chainload your OSs and their kernels.
40 >
41 > Thanks Michael. I've finally got it booting, by resorting to the same hack
42 > as I did on my previous machine.
43 >
44 > Using efibootmgr to add a UEFI boot record does create it, but selecting it
45 > in the BIOS fails and it just drops to the next in line: Windows 10. No
46 > adjustments to the --create command resulted in a bootable system, so I had
47 > to run bootctl-install as well and then remove the hex-numbered directory
48 > and restore my own loader.conf. I spent days wrestling with this.
49 >
50 > It's clear that I just don't understand UEFI booting. It sounds simple
51 > enough, but it clearly isn't. I've read everything I could find on the
52 > subject, to no avail.
53
54 Peter, what efibootmgr stanza do you use to create your UEFI boot records? It
55 seems the UEFI firmware fails to process what you provided and proceeds to the
56 next bootable option (Windows 10).
57
58 Typically you would either run efibootmgr to inform the UEFI firmware of your
59 OSs kernels directly, or you would engage the services of a boot manager to
60 list and boot your chosen OS. In the former, the UEFI firmware will boot the
61 OS directly. In the latter, the UEFI firmware will load the boot manager and
62 then the boot manager will select and boot the OS.
63
64 The process for updating the UEFI boot menu with available kernel images using
65 the efibootmgr command, is different to updating the boot menu of a 3rd party
66 boot manager. The two are not related, other than ultimately loading the
67 selected kernel/initrd.
68
69 Something you should note is unlike 3rd party boot managers, the UEFI firmware
70 cannot boot directly symlinked vmlinuz and initrd.gz files. This is because
71 the UEFI parses the contents of the ESP, which is formatted in VFAT - a
72 filesystem which does not support symlinks. In this case, a 3rd party boot
73 manager will be launched by the UEFI firmware from within the ESP, which will
74 be in possession of required 'os-prober' and filesystem drivers to access and
75 launch the OS kernel/initrd image from your root partition.
76
77 You can contact me off list if you want to work through the detail of
78 configuring your system with and without a boot manager. I think once it
79 clicks, you'll be able to apply your preferred solution without much trouble
80 in the future.

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] Dual booting with Windows 10 Peter Humphrey <peter@××××××××××××.uk>