Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Installing Gentoo
  • Search

Dualboot Gentoo from 2nd disk (UEFI)

Having problems with the Gentoo Handbook? If you're still working your way through it, or just need some info before you start your install, this is the place. All other questions go elsewhere.
Post Reply
Advanced search
20 posts • Page 1 of 1
Author
Message
Olis
Apprentice
Apprentice
Posts: 177
Joined: Wed Sep 29, 2004 7:54 pm
Location: Germany

Dualboot Gentoo from 2nd disk (UEFI)

  • Quote

Post by Olis » Sat Jun 15, 2019 7:12 pm

Hello,

I'm setting up a new system. It uses an X470 chipset. Windows 10 is installed on the 1st disk (SATA SSD), I want to install Gentoo on the 2nd disk (NVMe SSD).

All dualboot installation instructions I found describe how to install everything on one disk. Can I use the same instructions to install Gentoo on the 2nd disk? What partitions do I need for UEFI?

Regards,
Oliver
Top
aidanjt
Veteran
Veteran
User avatar
Posts: 1118
Joined: Sun Feb 20, 2005 2:44 pm
Location: Rep. of Ireland

  • Quote

Post by aidanjt » Sun Jun 16, 2019 1:01 am

You only *need* one ESP (type ef00) partition on any disk to install the EFI chainloader for your OS's boot loader, to get the firmware to handle the filesystem that your bootloader lives on, just enough to read the bootloader programme and run it. You can set the default UEFI entry with efibootmgr, if, say, Windows bumps off grub at some point. That said, your UEFI firmware should be able to manage multiple disks with their own ESP partitions, though, if you need your Linux system to be more portable, for e.g..
juniper wrote:you experience political reality dilation when travelling at american political speeds. it's in einstein's formulas. it's not their fault.
Top
alamahant
Advocate
Advocate
Posts: 4032
Joined: Sat Mar 23, 2019 12:12 pm

  • Quote

Post by alamahant » Sun Jun 16, 2019 10:11 pm

Have you read all this literature about windows 10,secure boot,dual booting with Linux?
Maybe you need to disable secure boot from your efi menus--if it is indeed enabled...
Or even better just ditch the windows....
:)
No one is going to mourn its loss unless maybe you need to play games.
Now your EFI partition should be vfat(mkfs.vfat) maybe 200M.A Boot partition of around 1 Gig would also be nice.
If you like the flexibility of lvm maybe you could consider this also in advance.
I dont know what kind of ESP windows uses but if I were you--as they already advised you I would create a new ESP on disk2.
And when you later install grub it will take over also your win10 installation.
If you need to manually create efi entries use something like
efibootmgr -c -l \\EFI\\Gentoo\\grubx64.efi -L "Gentoo" -p <number> -d /dev/sdx ###The device and partition where your ESP resides
I dont know what windows uses.
Then you can use something like

Code: Select all

efibootmgr -n xxxx ####to choose your next boot..
:)
Top
tuggbuss
Apprentice
Apprentice
User avatar
Posts: 222
Joined: Mon Mar 20, 2017 1:18 pm

  • Quote

Post by tuggbuss » Mon Jun 17, 2019 7:13 pm

alamahant wrote:Have you read all this literature about windows 10,secure boot,dual booting with Linux?
Maybe you need to disable secure boot from your efi menus--if it is indeed enabled...
Or even better just ditch the windows....
:)
No one is going to mourn its loss unless maybe you need to play games.
Now your EFI partition should be vfat(mkfs.vfat) maybe 200M.A Boot partition of around 1 Gig would also be nice.
If you like the flexibility of lvm maybe you could consider this also in advance.
I dont know what kind of ESP windows uses but if I were you--as they already advised you I would create a new ESP on disk2.
And when you later install grub it will take over also your win10 installation.
If you need to manually create efi entries use something like
efibootmgr -c -l \\EFI\\Gentoo\\grubx64.efi -L "Gentoo" -p <number> -d /dev/sdx ###The device and partition where your ESP resides
I dont know what windows uses.
Then you can use something like

Code: Select all

efibootmgr -n xxxx ####to choose your next boot..
:)
Or you can have EFi on /boot :) No n e e d for a separate EFI. I've used a 512 MB /boot last couple of years.
Top
charles17
Advocate
Advocate
Posts: 3686
Joined: Sun Mar 02, 2008 3:20 pm

Re: Dualboot Gentoo from 2nd disk (UEFI)

  • Quote

Post by charles17 » Tue Jun 18, 2019 6:25 am

Olis wrote:I'm setting up a new system. It uses an X470 chipset. Windows 10 is installed on the 1st disk (SATA SSD), I want to install Gentoo on the 2nd disk (NVMe SSD).

All dualboot installation instructions I found describe how to install everything on one disk. Can I use the same instructions to install Gentoo on the 2nd disk? What partitions do I need for UEFI?
Olis
Why not test it yourself:
  • Create an EFI bootable USB stick (Any Linux, FreeBSD, Windows, ..)
  • Insert it to your computer
  • Reboot the computer to the EFI loader (or whatever it's called)
  • Check the possible boot entries
  • Select your Gentoo boot entry and boot it
  • After login, run blkid, lsblk, parted, whatever, to inspect what's on the EFI bootable USB stick
Top
OldTango
l33t
l33t
User avatar
Posts: 739
Joined: Sat Feb 21, 2004 5:08 pm
Contact:
Contact OldTango
Website

Re: Dualboot Gentoo from 2nd disk (UEFI)

  • Quote

Post by OldTango » Tue Jun 18, 2019 7:10 pm

Olis wrote:Hello,

I'm setting up a new system. It uses an X470 chipset. Windows 10 is installed on the 1st disk (SATA SSD), I want to install Gentoo on the 2nd disk (NVMe SSD).

All dualboot installation instructions I found describe how to install everything on one disk. Can I use the same instructions to install Gentoo on the 2nd disk? What partitions do I need for UEFI?

Regards,
Oliver
Its not to difficult to do at all. I have been dual booting windows and linux for several years now on UEFI systems. I have always kept them on separate drives. I do NOT use GRUB for booting. I build a linux stub-kernel (self booting) and let the built in UEFI boot manager handle the boot process. I always install my Gentoo OS first than install windows. Than I fix the (boot time out) that windows always screws with. Windows will usually set the boot time out to "0" making it impossible to bring up the UEFI boot manager before windows starts to boot. Efibootmanger can be used to set (fix) the boot time out.

My Process is to create GTP formatted disks with the following partitions and create the files systems I need or intend to use.
/dev/sda1 >=512MB vFAT32. This is for the ESP and its directories. Large enough to store the windows boot files and a few linux kernels.
/dev/sda2 = LINUX SWAP 2GB if system ram is <=32GB. I omit the swap partition on systems with more than 32GBram as it never gets used.
/dev/sda3 = /root
/dev/sdb1 = /home
Install my Gentoo OS make sure it is bootable than install windows.
I use a single ESP for all OS's

If you install linux first windows will find and by default install to the existing ESP assuming the ESP is present on the system. If installing windows first it will create the ESP and it may or may not be large enough to suit your needs.

Multiple ESP's are supported by the UEFI standard so you should have no problems creating a second ESP for your linux install on modern hardware. I can't help with GRUB and have no idea how it would work with multiple ESP's.
Top
Tony0945
Watchman
Watchman
Posts: 5127
Joined: Tue Jul 25, 2006 12:19 am
Location: Illinois, USA

Re: Dualboot Gentoo from 2nd disk (UEFI)

  • Quote

Post by Tony0945 » Tue Jun 18, 2019 7:24 pm

OldTango wrote:This system does not control DNS for the “tonysegredo.com” domain. Contact the person responsible for the “ns2.webhostinghub.com” and “ns1.webhostinghub.com” nameservers and request that they update the “SPF” record with the following:
I believe reFind will dual boot both Windows and Linux. There are ebuilds in the tree. I use it but only to select between Linux kernels, usb, and DVD. Grub is yesterday.

For Windows I now use Virtualbox as there ate only a few programs that I use that require Windows (TurboTax, MsMoney, APC Powerchute)
If you use software for work, Windows development, or gaming, that may be different, but I point out that you can have an awfully large virtual drive for Windows.
Top
OldTango
l33t
l33t
User avatar
Posts: 739
Joined: Sat Feb 21, 2004 5:08 pm
Contact:
Contact OldTango
Website

Re: Dualboot Gentoo from 2nd disk (UEFI)

  • Quote

Post by OldTango » Tue Jun 18, 2019 11:11 pm

Tony0945 wrote:
OldTango wrote:This system does not control DNS for the “tonysegredo.com” domain. Contact the person responsible for the “ns2.webhostinghub.com” and “ns1.webhostinghub.com” nameservers and request that they update the “SPF” record with the following:
I believe reFind will dual boot both Windows and Linux. There are ebuilds in the tree. I use it but only to select between Linux kernels, usb, and DVD. Grub is yesterday.

For Windows I now use Virtualbox as there ate only a few programs that I use that require Windows (TurboTax, MsMoney, APC Powerchute)
If you use software for work, Windows development, or gaming, that may be different, but I point out that you can have an awfully large virtual drive for Windows.
WOW! Where did you find that Quote...........LOL

Yes reFind can dual boot almost any system and would be my preferred tool if I had a need for additional ways to boot my systems. However I see no need to install/maintain extra applications to do a job modern UEFI systems can handle on there own.

I also use Virtualbox in my main Gentoo linux install for the same reasons as you, but hardware emulation is useless for modern gaming. While WINE can work, it almost always requires a lot of extra work to make the games I play run. So until recently I would just Dual boot a Gentoo/Windows 10 install to play the 4 or 5 games I own that can't or won't run in linux. The only use I have for a windows OS for gaming, nothing else and that is all I do in windows. But I got tired of dual booting.

So to "KISS" the problem and owning several different systems and hardware. I updated one of my systems and set it up as a windows only machine. Then connected both my Gentoo/Windows 10 and Windows 10 only machines to a ATEN 4K KVM. Both systems say booted 24/7 and switching from one to the other takes less than 2 secs.
Top
Tony0945
Watchman
Watchman
Posts: 5127
Joined: Tue Jul 25, 2006 12:19 am
Location: Illinois, USA

  • Quote

Post by Tony0945 » Wed Jun 19, 2019 12:19 am

I didn't even look when I pasted. My bad. That quote was supposed to be pasted into an e-mail to webhostinghub.com support. It's the error message I get when I try to update my SPF (?) records as they request. I'll have to check and see if your post went to webhostinghub support!

To each his own. I don't like stub kernel because I run multiple kernels and update often (Is kernel.org still running to "stable release of the week" contest?)
With reFind I just build the kernel and it boots next time. If I have a problem just "touch" and older kernel and reboot. I used to hate building a kernel and then forgetting to edit grub.conf.

As you can see my short list of Windows programs spend most of their time waiting for keyboard input or are not time-critical like a game. The only games I play are the old card games that came with old Windows, but those run on WINE as well.

That's what makes Gentoo great! No one size fits all answers! At least until profile 17.1
Top
Olis
Apprentice
Apprentice
Posts: 177
Joined: Wed Sep 29, 2004 7:54 pm
Location: Germany

  • Quote

Post by Olis » Fri Jun 28, 2019 9:27 pm

alamahant wrote:Have you read all this literature about windows 10,secure boot,dual booting with Linux?
Maybe you need to disable secure boot from your efi menus--if it is indeed enabled...
Or even better just ditch the windows....
:)
No one is going to mourn its loss unless maybe you need to play games.
Now your EFI partition should be vfat(mkfs.vfat) maybe 200M.A Boot partition of around 1 Gig would also be nice.
If you like the flexibility of lvm maybe you could consider this also in advance.
I dont know what kind of ESP windows uses but if I were you--as they already advised you I would create a new ESP on disk2.
And when you later install grub it will take over also your win10 installation.
If you need to manually create efi entries use something like
efibootmgr -c -l \\EFI\\Gentoo\\grubx64.efi -L "Gentoo" -p <number> -d /dev/sdx ###The device and partition where your ESP resides
I dont know what windows uses.
Then you can use something like

Code: Select all

efibootmgr -n xxxx ####to choose your next boot..
:)
Thanks for all the answers. Well, I guess I didn't read everything about UEFI. I tried to learn about it as my current system is 7 years old and doesn't know anything about UEFI, but I wouldn't call myself an UEFI expert now ;-).

I'm still confused what I really need and on which disk it should be. When I look at the Gentoo Installation Handbook it says to create
  • * a 2 MB "BIOS boot partition"
    * a 128 MB "Boot partition"
In addition I want to use a fixed size root fs (~50G) on 2nd disk (/dev/nvme0n1) and everything else will be set up with LVM (/var, /opt and /home).

When I installed Win10 on the first disk it created a 580 MB boot partition and a 2nd partition for Windows itself (both NTFS). I can remove these partitions and install Win10 later again.

As I understand it this 2 MB "BIOS boot partition" is required for grub(2) (although I haven't decided yet if I should use grub2 or reFind, which I don't know at all. As I understand it reFind will not need the small "BIOS boot partition" but installs to /boot/efi/EFI/refind). The handbook doesn't say anything about the file system for this partition. If grub2 has to write to this partition it should have a filesystem, I guess?

The "Boot partition" should probably be larger than 128 MB (eg. the 580 MB Windows created), it should be formatted with vFAT and it should be mounted to /boot/efi

These 2 partitions should be on disk 1, everything else (root fs and LVM filesystems) on disk 2.

Is this correct so far?
Top
tuggbuss
Apprentice
Apprentice
User avatar
Posts: 222
Joined: Mon Mar 20, 2017 1:18 pm

  • Quote

Post by tuggbuss » Fri Jun 28, 2019 10:04 pm

Olis wrote:
alamahant wrote:Have you read all this literature about windows 10,secure boot,dual booting with Linux?
Maybe you need to disable secure boot from your efi menus--if it is indeed enabled...
Or even better just ditch the windows....
:)
No one is going to mourn its loss unless maybe you need to play games.
Now your EFI partition should be vfat(mkfs.vfat) maybe 200M.A Boot partition of around 1 Gig would also be nice.
If you like the flexibility of lvm maybe you could consider this also in advance.
I dont know what kind of ESP windows uses but if I were you--as they already advised you I would create a new ESP on disk2.
And when you later install grub it will take over also your win10 installation.
If you need to manually create efi entries use something like
efibootmgr -c -l \\EFI\\Gentoo\\grubx64.efi -L "Gentoo" -p <number> -d /dev/sdx ###The device and partition where your ESP resides
I dont know what windows uses.
Then you can use something like

Code: Select all

efibootmgr -n xxxx ####to choose your next boot..
:)
Thanks for all the answers. Well, I guess I didn't read everything about UEFI. I tried to learn about it as my current system is 7 years old and doesn't know anything about UEFI, but I wouldn't call myself an UEFI expert now ;-).

I'm still confused what I really need and on which disk it should be. When I look at the Gentoo Installation Handbook it says to create
  • * a 2 MB "BIOS boot partition"
    * a 128 MB "Boot partition"
In addition I want to use a fixed size root fs (~50G) on 2nd disk (/dev/nvme0n1) and everything else will be set up with LVM (/var, /opt and /home).

When I installed Win10 on the first disk it created a 580 MB boot partition and a 2nd partition for Windows itself (both NTFS). I can remove these partitions and install Win10 later again.

As I understand it this 2 MB "BIOS boot partition" is required for grub(2) (although I haven't decided yet if I should use grub2 or reFind, which I don't know at all. As I understand it reFind will not need the small "BIOS boot partition" but installs to /boot/efi/EFI/refind). The handbook doesn't say anything about the file system for this partition. If grub2 has to write to this partition it should have a filesystem, I guess?

The "Boot partition" should probably be larger than 128 MB (eg. the 580 MB Windows created), it should be formatted with vFAT and it should be mounted to /boot/efi

These 2 partitions should be on disk 1, everything else (root fs and LVM filesystems) on disk 2.

Is this correct so far?
Naah, on EFI/GPT you can skip the "bios" partition and just go for a /boot or where ever you like to place EFI
Top
Tony0945
Watchman
Watchman
Posts: 5127
Joined: Tue Jul 25, 2006 12:19 am
Location: Illinois, USA

  • Quote

Post by Tony0945 » Fri Jun 28, 2019 11:12 pm

tuggbuss wrote:Naah, on EFI/GPT you can skip the "bios" partition and just go for a /boot or where ever you like to place EFI
Second that! I don't dual boot but here is my reFind /etc/fstab

Code: Select all

LABEL=CT500MX_EFI       /boot/efi        vfat           relatime        1 2
LABEL=CT500MX_PART2  /                    ext4          relatime        0 1
LABEL=SAGE_VIDEO       /video            ext4          auto,relatime   0 1
/dev/sr0                         /mnt/cdrom    auto          user,noauto,nofail      0 0
tmpfs                   /var/tmp/portage tmpfs          nr_inodes=1M,size=12G 0 0
devpts                  /dev/pts         devpts         defaults        0 0

Code: Select all

  # df -h  /boot/efi
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1        99M  2.2M   97M   3% /boot/efi
No separate /boot. that's a relic of old BIOS's that couldn't read a full disk.
I don't store kernels there on vfat either. reFind looks for them and finds them on the root partition.


Preserving windows??? I was never bothered by that. Can't help you there. But this is a good Linux layout.

Code: Select all

 # fdisk -l /dev/sda
Disk /dev/sda: 465.8 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
I've read various things about the minimum size of the /boot/efi partition. This is working fine on an MSI Arctic white Tomahawk B350.

On my first UEFI install, a Gigabyte board:

Code: Select all

 # fdisk -l /dev/sda
Disk /dev/sda: 232.9 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

Code: Select all

 # df -h /boot/efi
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1      1022M  2.3M 1020M   1% /boot/efi
I was way too conservative on that one. As you can see, I like an SSD for the system and a big fast HDD for data. I even put /home on the SSD. If I need something big on /home , I can always symlink it to the HDD.
Top
Olis
Apprentice
Apprentice
Posts: 177
Joined: Wed Sep 29, 2004 7:54 pm
Location: Germany

  • Quote

Post by Olis » Sun Jun 30, 2019 9:16 am

I'm making progess...

I'm using reFind and at least reFind starts upon boot and offers to start Gentoo Linux. Only problem now is that I get an

Code: Select all

Starting kernel
Using load options 'root=PARTUUID=018ff9eb-01 initrd=/boot/initramfs rw add_efi_memmap dobtrfs'
Invalid loader file!
Error: Not Found while loading kernel
ESP is on SATA SSD (dev/sda1), fs is vfat.
/boot is a directory on /, which is a primary partition on NVMe SSD, fs is btrfs.

ESP is mounted to /boot/efi

Partitions:

Code: Select all

NAME              MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                 8:0    0 232,9G  0 disk 
└─sda1              8:1    0   610M  0 part /boot/efi
sr0                11:0    1   287M  0 rom  
nvme0n1           259:0    0 931,5G  0 disk 
├─nvme0n1p1       259:1    0    50G  0 part /
└─nvme0n1p2       259:2    0 881,5G  0 part 
  ├─systemvg-var  252:0    0    30G  0 lvm  /var
  ├─systemvg-opt  252:1    0     3G  0 lvm  /opt
  ├─systemvg-swap 252:2    0    16G  0 lvm  
  └─systemvg-home 252:3    0   400G  0 lvm  /home
blkid:

Code: Select all

/dev/nvme0n1p1: LABEL="root" UUID="c94c2700-9a6e-4702-99f7-fc1857e01559" UUID_SUB="c27beb2f-db70-49e9-924b-abde94f46586" TYPE="btrfs" PARTUUID="018ff9eb-01"
/dev/nvme0n1p2: UUID="zNubYc-rvxo-XgqY-38ps-1lVR-Ip4r-3gk83c" TYPE="LVM2_member" PARTUUID="018ff9eb-02"
/dev/sda1: UUID="6027-490C" TYPE="vfat" PARTLABEL="boot" PARTUUID="c4a4a7ec-a407-4548-a987-150a34757c8c"
efibootmgr -v

Code: Select all

BootCurrent: 0000
Timeout: 10 seconds
BootOrder: 0000,0004,0002,0003,0001,0005,0006
Boot0000* rEFInd Boot Manager   HD(1,GPT,c4a4a7ec-a407-4548-a987-150a34757c8c,0x800,0x131000)/File(\EFI\refind\refind_x64.efi)
Boot0001* UEFI:CD/DVD Drive     BBS(129,,0x0)
Boot0002* Hard Drive    BBS(HD,,0x0)..GO..NO........q.S.a.m.s.u.n.g. .S.S.D. .9.7.0. .E.V.O. .P.l.u.s. .1.T.B....................A...........................%8S..L......4..Gd-.;.A..MQ..L.S.4.E.W.N.F.0.M.3.2.3.1.6.9.B........BO..NO........u.S.a.m.s.u.n.g. .S.S.D. .8.6.0. .E.V.O. .2.5.0.G.B....................A.................................>..Gd-.;.A..MQ..L.3.S.J.Y.X.N.K.0.2.B.9.6.8.7. .W. . . . ........BO
Boot0003* CD/DVD Drive  BBS(CDROM,,0x0)..GO..NO........u.D.R.W.-.2.4.D.5.M.T....................A.................................>..Gd-.;.A..MQ..L.L.K.I.K.L.B.4.A.5.4. .2. . . . . . . . ........BO
Boot0004* UEFI: DRW-24D5MT      PciRoot(0x0)/Pci(0x1,0x3)/Pci(0x0,0x1)/Sata(1,65535,0)/CDROM(1,0x30,0x3270)..BO
Boot0005* UEFI:Removable Device BBS(130,,0x0)
Boot0006* UEFI:Network Device   BBS(131,,0x0)
/boot/efi/EFI/refind/refind.conf

Code: Select all

timeout 20
menuentry "Gentoo Linux" {
        icon    /EFI/refind/icons/os_gentoo.png
        volume  018ff9eb-01
        loader  /boot/kernel
        options "root=PARTUUID=018ff9eb-01 initrd=/boot/initramfs rw add_efi_memmap dobtrfs"
        submenuentry "Boot using old kernel image" {
                volume  018ff9eb-01
                loader  /boot/kernel.old
        }
}
Contents of /boot:

Code: Select all

lrwxrwxrwx 1 root root       42 29. Jun 22:37 System.map -> System.map-genkernel-x86_64-4.19.52-gentoo
-rw-r--r-- 1 root root  3474270 29. Jun 22:37 System.map-genkernel-x86_64-4.19.52-gentoo
-rw-r--r-- 1 root root  3244119 29. Jun 21:12 System.map-genkernel-x86_64-4.19.52-gentoo.old
lrwxrwxrwx 1 root root       46 29. Jun 22:37 System.map.old -> System.map-genkernel-x86_64-4.19.52-gentoo.old
drwxr-xr-x 3 root root     4096  1. Jan 1970  efi
lrwxrwxrwx 1 root root       41 29. Jun 22:43 initramfs -> initramfs-genkernel-x86_64-4.19.52-gentoo
-rw-r--r-- 1 root root 89250460 29. Jun 22:43 initramfs-genkernel-x86_64-4.19.52-gentoo
lrwxrwxrwx 1 root root       38 29. Jun 22:37 kernel -> kernel-genkernel-x86_64-4.19.52-gentoo
-rw-r--r-- 1 root root  7451520 29. Jun 22:37 kernel-genkernel-x86_64-4.19.52-gentoo
-rw-r--r-- 1 root root  6484640 29. Jun 21:12 kernel-genkernel-x86_64-4.19.52-gentoo.old
lrwxrwxrwx 1 root root       42 29. Jun 22:37 kernel.old -> kernel-genkernel-x86_64-4.19.52-gentoo.old
-rwxr-xr-x 1 root root      267 30. Jun 10:47 refind_linux.conf
Is it ok to use SymLinks to point reFind to my actual kernel?

Anything else I'm doing wrong?
Top
Tony0945
Watchman
Watchman
Posts: 5127
Joined: Tue Jul 25, 2006 12:19 am
Location: Illinois, USA

  • Quote

Post by Tony0945 » Sun Jun 30, 2019 5:50 pm

I don't use an initramfs so I don't know.

Try adding something to /boot/refind_linux.conf or /boot/efi/EFI/BOOT/refind.conf

Instead of symlinks, let reFind find your kernels.
Here are the non-commented out lines in my refind.conf:

Code: Select all

timeout 10

showtools shell, gdisk, memtest, about, reboot, exit, firmware

scanfor internal,optical,manual

dont_scan_volumes CT250MX_EFI,WD5001_PART2

fold_linux_kernels false

default_selection vmlinuz
Not scanning the EFI partition doesn't really save any time. The second disk in this system is bootable so I don't want it scanned.
I think "fold_linux_kernels false" is the relevant one.
Top
Olis
Apprentice
Apprentice
Posts: 177
Joined: Wed Sep 29, 2004 7:54 pm
Location: Germany

  • Quote

Post by Olis » Mon Jul 01, 2019 5:25 pm

Tony0945 wrote:I don't use an initramfs so I don't know.

Try adding something to /boot/refind_linux.conf or /boot/efi/EFI/BOOT/refind.conf

Instead of symlinks, let reFind find your kernels.
Here are the non-commented out lines in my refind.conf:

Code: Select all

timeout 10

showtools shell, gdisk, memtest, about, reboot, exit, firmware

scanfor internal,optical,manual

dont_scan_volumes CT250MX_EFI,WD5001_PART2

fold_linux_kernels false

default_selection vmlinuz
Not scanning the EFI partition doesn't really save any time. The second disk in this system is bootable so I don't want it scanned.
I think "fold_linux_kernels false" is the relevant one.
I guess this will only work if he kernel is on my ESP? I have my kernel files in /boot (part of / on a btrfs file system). Does reFind scan a not mounted btrfs filesystem? ESP is mounted to /boot/efi.

If I only have a /boot/efi/EFI/BOOT/refind.conf reFind complains about not finding its refind.conf. The file has to be in /boot/efi/EFI/refind here. I'm using reFind 0.10.4-r2 (current stable version).
Top
Tony0945
Watchman
Watchman
Posts: 5127
Joined: Tue Jul 25, 2006 12:19 am
Location: Illinois, USA

  • Quote

Post by Tony0945 » Mon Jul 01, 2019 6:12 pm

No! I don't put the kernels in the ESP!
Olis wrote: Does reFind scan a not mounted btrfs filesystem?
Two questions there.

1. Does reFind recognize btrfs? There is a btrfs use flag. Did you apply it in package.use?
It's not a default like ext4.

Code: Select all

 # eix -e refind
[I] sys-boot/refind
     Available versions:  0.10.4-r2 (~)0.11.2 (~)0.11.3 {btrfs -custom-cflags doc +ext2 +ext4 -gnuefi hfs +iso9660 ntfs reiserfs}
     Installed versions:  0.11.3(08:01:26 PM 09/03/2018)(doc ext2 ext4 gnuefi iso9660 ntfs -btrfs -custom-cflags -hfs -reiserfs)
     Homepage:            https://www.rodsbooks.com/refind/
     Description:         The UEFI Boot Manager by Rod Smith
Here's my flags:

Code: Select all

[ebuild   R    ] sys-boot/refind-0.10.4-r2::gentoo  USE="ext2 ext4 (gnuefi) iso9660 -btrfs (-custom-cflags) -doc -hfs -ntfs -reiserfs"
The straight defaults. I really don't use ext2 anymore but it's a default. If you use btrs or reiserfs you should put those flages in package.use.

2. Does reFind scan a not mounted filesystem? Ans. It must. How else could it find the kernels?
Olis wrote:I'm using reFind 0.10.4-r2 (current stable version).
I have 0.10.4-r2 on one system and 0.11.3 on 5the other (haven't updated yet). I better try rebooting the newest one.

I think the btrfs flag being missing may be your problem. Try re-emerging with it applied. If that's not it, pastebin /boot/refind_linux.conf and
/boot/efi/EFI/refind/refind.conf and post the links.
Top
Olis
Apprentice
Apprentice
Posts: 177
Joined: Wed Sep 29, 2004 7:54 pm
Location: Germany

  • Quote

Post by Olis » Mon Jul 01, 2019 7:50 pm

Tony0945 wrote:No! I don't put the kernels in the ESP!
Olis wrote: Does reFind scan a not mounted btrfs filesystem?
Two questions there.

1. Does reFind recognize btrfs? There is a btrfs use flag. Did you apply it in package.use?
It's not a default like ext4.
Good point. It wasn't build with btrfs support :-(. I added the btrfs USE flag and rebuilt reFind, then did another "refind-install --usedefault /dev/sda1":

Code: Select all

chroot) livecd / # eix refind
[I] sys-boot/refind
     Verfügbare Versionen:   0.10.4-r2 ~0.11.2 ~0.11.3 {btrfs -custom-cflags doc +ext2 +ext4 -gnuefi hfs +iso9660 ntfs reiserfs}
     Installierte Versionen: 0.10.4-r2(21:30:21 01.07.2019)(btrfs ext2 ext4 gnuefi iso9660 -custom-cflags -doc -hfs -ntfs -reiserfs)
     Startseite:             https://www.rodsbooks.com/refind/
     Beschreibung:           The UEFI Boot Manager by Rod Smith
I now have btrfs_x64.efi in EFI/BOOT/drivers_x64/

But still no go on reboot. It just detects the LiveCD.

/boot/efi/EFI/refind/refind.conf:

Code: Select all

timeout 10
showtools shell, gdisk, memtest, about, reboot, exit, firmware
scanfor internal,optical,manual
#dont_scan_volumes CT250MX_EFI,WD5001_PART2
fold_linux_kernels true
default_selection kernel 
/boot/refind_linux.conf:

Code: Select all

"Boot with standard options"    "root=PARTUUID=018ff9eb-01 rw add_efi_memmap quiet splash" 
"Boot to single-user mode"    "root=PARTUUID=018ff9eb-01 rw add_efi_memmap quiet splash single"
"Boot with minimal options"   "ro root=UUID=c94c2700-9a6e-4702-99f7-fc1857e01559"
blkid:

Code: Select all

/dev/nvme0n1p1: LABEL="root" UUID="c94c2700-9a6e-4702-99f7-fc1857e01559" UUID_SUB="c27beb2f-db70-49e9-924b-abde94f46586" TYPE="btrfs" PARTUUID="018ff9eb-01"
/dev/nvme0n1p2: UUID="zNubYc-rvxo-XgqY-38ps-1lVR-Ip4r-3gk83c" TYPE="LVM2_member" PARTUUID="018ff9eb-02"
/dev/sda1: UUID="6027-490C" TYPE="vfat" PARTLABEL="boot" PARTUUID="c4a4a7ec-a407-4548-a987-150a34757c8c"
Contents of /boot:

Code: Select all

lrwxrwxrwx 1 root root       42 29. Jun 22:37 System.map -> System.map-genkernel-x86_64-4.19.52-gentoo
-rw-r--r-- 1 root root  3474270 29. Jun 22:37 System.map-genkernel-x86_64-4.19.52-gentoo
-rw-r--r-- 1 root root  3244119 29. Jun 21:12 System.map-genkernel-x86_64-4.19.52-gentoo.old
lrwxrwxrwx 1 root root       46 29. Jun 22:37 System.map.old -> System.map-genkernel-x86_64-4.19.52-gentoo.old
drwxr-xr-x 3 root root     4096  1. Jan 1970  efi
lrwxrwxrwx 1 root root       41 29. Jun 22:43 initramfs -> initramfs-genkernel-x86_64-4.19.52-gentoo
-rw-r--r-- 1 root root 89250460 29. Jun 22:43 initramfs-genkernel-x86_64-4.19.52-gentoo
lrwxrwxrwx 1 root root       38 29. Jun 22:37 kernel -> kernel-genkernel-x86_64-4.19.52-gentoo
-rw-r--r-- 1 root root  7451520 29. Jun 22:37 kernel-genkernel-x86_64-4.19.52-gentoo
-rw-r--r-- 1 root root  6484640 29. Jun 21:12 kernel-genkernel-x86_64-4.19.52-gentoo.old
lrwxrwxrwx 1 root root       42 29. Jun 22:37 kernel.old -> kernel-genkernel-x86_64-4.19.52-gentoo.old
-rwxr-xr-x 1 root root      267 30. Jun 10:47 refind_linux.conf
Top
Olis
Apprentice
Apprentice
Posts: 177
Joined: Wed Sep 29, 2004 7:54 pm
Location: Germany

  • Quote

Post by Olis » Tue Jul 02, 2019 5:37 am

Success! I booted from disk for the first time using reFind!

I copied my kernel (kernel-genkernel-x86_64-4.19.52-gentoo) from /boot to /boot/efi/EFI/gentoo/. Using the minimal refind.conf from my previous post reFind finds the kernel and successfully starts it!

Still no idea why it doesn't find it on /boot.

I also get an error message when Gentoo is mounting local filesystems saying that it doesn't find /dev/sda1 (my ESP with vfat filesystem). However, after boot completes I can issue a "mount -a" and /dev/sda1 is successfully mounted to /boot/efi.
Top
Tony0945
Watchman
Watchman
Posts: 5127
Joined: Tue Jul 25, 2006 12:19 am
Location: Illinois, USA

  • Quote

Post by Tony0945 » Tue Jul 02, 2019 1:36 pm

I wonder if reFind has a problem reading the NVMe SSD?
I'd like to continue pursuing this as I plan to build an NVMe system in the near future.
Top
Tony0945
Watchman
Watchman
Posts: 5127
Joined: Tue Jul 25, 2006 12:19 am
Location: Illinois, USA

  • Quote

Post by Tony0945 » Thu Jul 04, 2019 2:47 am

This looks promising:
Btrfs—Samuel Liao contributed this driver, which is based on the rEFIt/rEFInd driver framework and algorithms from the GRUB 2.0 Btrfs driver. I've tested this driver with simple one-partition filesystems on several installations, and with a filesystem that spans two physical devices on one (although I've made no attempt to ensure that the driver can actually read files that span both devices). Samuel Liao has used the driver with a compressed Btrfs volume. The driver will handle subvolumes, but you may need to add kernel options if you're booting a Linux kernel directly from a filesystem that uses subvolumes. For instance, when booting Ubuntu from Btrfs, also_scan_dirs + @/boot must be set in refind.conf and rootflags=subvol=@ must be added to the kernel options in refind_linux.conf. Without the first of these options, rEFInd can not locate the kernel; and without the second, the boot fails with a message to the effect that the initial RAM disk could not find /sbin/init. rEFInd 0.10.0 adds @/boot as a standard option to also_scan_dirs, and its refind-install and mkrlconf scripts should pick up the root flags, assuming the system is booted into the regular installation. These additions make it easier to set up rEFInd to work with Btrfs.
Top
Post Reply

20 posts • Page 1 of 1

Return to “Installing Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic