Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] grub-install on both UEFI and Legacy BIOS
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
Vieri
l33t
l33t


Joined: 18 Dec 2005
Posts: 886

PostPosted: Sun Feb 12, 2017 10:01 am    Post subject: [SOLVED] grub-install on both UEFI and Legacy BIOS Reply with quote

Hi,

I'm booting a liveUSB with SysRescCD with UEFI (because Gentoo's minimal install ISO can't boot with UEFI).

My goal is to install Gentoo on a HDD so that the system on the hard disk can then be booted with or without UEFI.

I have 2 disks in RAID1.
So I did:

Code:

Disk /dev/sda: 228937MiB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start     End        Size       File system     Name    Flags
 1      1.00MiB   3.00MiB    2.00MiB                    bios    bios_grub
 2      3.00MiB   515MiB     512MiB                     uefi    boot, esp
 3      515MiB    1027MiB    512MiB     ext2            boot    raid
 4      1027MiB   37193MiB   36166MiB   linux-swap(v1)  swap    raid
 5      37193MiB  228836MiB  191643MiB  ext4            rootfs  raid

(same for sdb)

Code:

Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md5 : active raid1 sdb5[1] sda5[0]
      196241920 blocks [2/2] [UU]
      bitmap: 0/2 pages [0KB], 65536KB chunk

md4 : active raid1 sdb4[1] sda4[0]
      37033920 blocks [2/2] [UU]
     
md3 : active raid1 sdb3[1] sda3[0]
      524224 blocks [2/2] [UU]
     
md2 : active raid1 sdb2[1] sda2[0]
      524224 blocks [2/2] [UU]
     
md1 : active raid1 sdb1[1] sda1[0]
      1984 blocks [2/2] [UU]
     
unused devices: <none>


Code:

/dev/md5 on /mnt/gentoo type ext4 (rw,relatime,data=ordered)
/dev/md3 on /mnt/gentoo/boot type ext2 (rw,relatime,errors=continue,user_xattr,acl)
/dev/md2 on /mnt/gentoo/boot/efi type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)


When I go into the jail root, I run the following commands:

Code:

grub_uefi="--target=x86_64-efi --efi-directory=/boot/efi"
# First, I want grub to install for Legacy BIOS boot (is it necessary?)
grub-install /dev/sda
grub-install /dev/sdb
# Then I want grub to install for UEFI boot
grub-install ${grub_uefi} /dev/sda
grub-install ${grub_uefi} /dev/sdb
# Hopefully this means that I should be able to boot my HDD with or without UEFI.


However, whether I run grub-install with or without ${grub_uefi}, I always get the following message:

Code:

Installing for x86_64-efi platform.
efibootmgr: option requires an argument -- 'd'
efibootmgr version 14
usage: efibootmgr [options]
        -a | --active         sets bootnum active
        -A | --inactive       sets bootnum inactive
        -b | --bootnum XXXX   modify BootXXXX (hex)
        -B | --delete-bootnum delete bootnum
        -c | --create         create new variable bootnum and add to bootorder
        -C | --create-only      create new variable bootnum and do not add to bootorder
        -D | --remove-dups      remove duplicate values from BootOrder
        -d | --disk disk       (defaults to /dev/sda) containing loader
        -r | --driver         Operate on Driver variables, not Boot Variables.
        -e | --edd [1|3|-1]   force EDD 1.0 or 3.0 creation variables, or guess
        -E | --device num      EDD 1.0 device number (defaults to 0x80)
        -g | --gpt            force disk with invalid PMBR to be treated as GPT
        -i | --iface name     create a netboot entry for the named interface
        -l | --loader name     (defaults to \EFI\redhat\grub.efi)
        -L | --label label     Boot manager display label (defaults to "Linux")
        -m | --mirror-below-4G t|f mirror memory below 4GB
        -M | --mirror-above-4G X percentage memory to mirror above 4GB
        -n | --bootnext XXXX   set BootNext to XXXX (hex)
        -N | --delete-bootnext delete BootNext
        -o | --bootorder XXXX,YYYY,ZZZZ,...     explicitly set BootOrder (hex)
        -O | --delete-bootorder delete BootOrder
        -p | --part part        (defaults to 1) containing loader
        -q | --quiet            be quiet
        -t | --timeout seconds  set boot manager timeout waiting for user input.
        -T | --delete-timeout   delete Timeout.
        -u | --unicode | --UCS-2  pass extra args as UCS-2 (default is ASCII)
        -v | --verbose          print additional information
        -V | --version          return version and exit
        -w | --write-signature  write unique sig to MBR if needed
        -y | --sysprep          Operate on SysPrep variables, not Boot Variables.
        -@ | --append-binary-args file  append extra args from file (use "-" for stdin)
        -h | --help             show help/usage
Installation finished. No error reported.


I'm not sure I know what this means:

Code:

option requires an argument -- 'd'


Does it have to do with --disk?

What am I doing wrong?

Thanks,

Vieri


Last edited by Vieri on Tue Feb 14, 2017 7:59 am; edited 1 time in total
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3846
Location: Austro Bavaria

PostPosted: Sun Feb 12, 2017 12:44 pm    Post subject: Reply with quote

Quote:
I have 2 disks in RAID1.


You usually can not boot from FAKE raids.

Pleaae check if the requirements are met from your bootloader with your hardware.

--

usually you can boot from partitions or devices which are not in a fake-raid

--

Code:
/dev/md2 on /mnt/gentoo/boot/efi type vfat


I have never used those md things.

I suggest you remove that for boot, and set that partition active, as noted in the gentoo handbook
Back to top
View user's profile Send private message
Fitzcarraldo
Advocate
Advocate


Joined: 30 Aug 2008
Posts: 2036
Location: United Kingdom

PostPosted: Sun Feb 12, 2017 6:20 pm    Post subject: Reply with quote

Roman_Gruber wrote:
You usually can not boot from FAKE raids.

Oh yes you can. It is often done with BIOS firmware; see e.g. How to install Linux Ubuntu server 16.04 with software RAID 1. I've done it myself in the past with Ubuntu.

I've never used RAID with a UEFI-firmware machine, though. Apparently booting is achieveable but far more difficult than with a BIOS-firmware machine:

Arch Linux Wiki - EFI System Partition wrote:
ESP on RAID

It is possible to make the ESP part of a RAID1 array, but doing so brings the risk of data corruption, and further considerations need to be taken when creating the ESP. See [3] and [4] for details.

See also Ubuntu Bug #1466150 - grub-install breaks when ESP is on raid

With my BIOS-GPT server, I put /boot on an internal microSD card and boot from that (/etc/fstab is configured to not mount /boot), with all the other partitions on RAID1. Were it an UEFI-firmware server, I would put the ESP and /boot on an internal microSD card (or USB pen drive) and boot from that, with all the other partitions on RAID1. Someone I know with a UEFI-firmware machine, installed a small HDD and put the ESP and /boot on that, which is essentially the same approach.

[off-topic]The more I learn about UEFI, the more I dislike it.[/off-topic]
_________________
Clevo W230SS: amd64, VIDEO_CARDS="intel modesetting nvidia".
Compal NBLB2: ~amd64, xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC systemd-utils[udev] elogind KDE on both.

My blog
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3846
Location: Austro Bavaria

PostPosted: Sun Feb 12, 2017 6:31 pm    Post subject: Reply with quote

Fitzcarraldo wrote:


With my BIOS-GPT server, I put /boot on an internal microSD card and boot from that


Basically you boot from non Raid, just an ordinary block device. Says everything

I use linux for quite a while, 2.0.x kernel days. and usually you do not boot from fake raids. Hardware raids are a different issue. I do not get the need for raids anyway these days => backups + SSDS, thats it

totally off topic:
i would not focus on non uefi boxes anymore.
i read a datasheet from a harddrive. Uefi can access hdd bigger as 2.2 TB. Old bios is dead because they have hit the biggest lba number adressable.

new: uefi + gpt
old: obsolete

--

back to topic:

Quote:
What am I doing wrong?


90 percent: you boot from a fake raid, which is not supported, or not correctly set up (if its possible) => boot partition
Back to top
View user's profile Send private message
Fitzcarraldo
Advocate
Advocate


Joined: 30 Aug 2008
Posts: 2036
Location: United Kingdom

PostPosted: Sun Feb 12, 2017 10:27 pm    Post subject: Reply with quote

Roman_Gruber,

Yes, but my first point in my previous post was that it is possible to boot from a RAID1 boot partition (as evidenced by the links I gave), whereas you stated it was not possible. Also, putting aside the debate on the wisdom of that approach, it is quite common for people to include /boot on RAID1, as quite a few videos on YouTube attest. In my opinion it is not a good idea to do so, though, so at least I can agree with you on that score.

Roman_Gruber wrote:
i read a datasheet from a harddrive. Uefi can access hdd bigger as 2.2 TB. Old bios is dead because they have hit the biggest lba number adressable.

Furthermore, I don't just read datasheets on large HDDs; I actually use large HDDs. For example, my home server has 4 x 3TB HDDs (two RAID1 arrays) and there is no problem at all using the full 3TB in each array with BIOS-GPT (not BIOS-MBR). I'm not trying to convince the OP (or you) to use BIOS, just pointing out that your posts are factually incorrect. End of.


Vieri,

Have you considered putting the ESP on a non-RAID partition (possibly on a separate SSD, USB pen drive or microSD Card) to avoid all the hassle described in the Arch Linux Wiki?
_________________
Clevo W230SS: amd64, VIDEO_CARDS="intel modesetting nvidia".
Compal NBLB2: ~amd64, xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC systemd-utils[udev] elogind KDE on both.

My blog
Back to top
View user's profile Send private message
Vieri
l33t
l33t


Joined: 18 Dec 2005
Posts: 886

PostPosted: Mon Feb 13, 2017 12:40 pm    Post subject: Reply with quote

Whether doing RAID1 for /boot is a good idea or not is another issue. However, I can say that you can boot off a raid1 set - no issues at all.

I haven't had any problems with Linux Software RAID1 on all partitions (bios and boot). On another system I have:

Code:

md127 : active raid1 sda1[0] sdb1[1]
      1984 blocks [2/2] [UU]

md2 : active raid1 sdb2[1] sda2[0]
      131008 blocks [2/2] [UU]

md3 : active raid1 sdb3[1] sda3[0]
      6213568 blocks [2/2] [UU]

md4 : active raid1 sdb4[1] sda4[0]
      970311296 blocks [2/2] [UU]
      bitmap: 4/8 pages [16KB], 65536KB chunk



Code:

/dev/md2                /boot           ext2            noauto,noatime  1 2
/dev/md4                /               ext4            noatime         0 1
/dev/md3                none            swap            sw              0 0


In any case, I'd like to know what the drawbacks might be if I boot from a RAID1 set?

I guess I have all of my partitions in RAID1 for simplicity - I don't have to worry about sync'ing data between partitions when I update, etc.

Maybe the only real issue here is trying to set up a RAID1 on the EFI fat32 partition. Some people mention "possible data corruption" in special cases (which should be improbable unless you access EFI shell). It might also be (correct me if I'm wrong) that EFI firmware in the Mobo might not boot an EFI HDD because it might not recognize the EFI partition type as it will only see a RAID type (this behavior may vary according to the manufacturer's EFI firmware).

Let's put the EFI part on-hold just a minute. Why would putting /dev/sd{a,b}1 and /dev/sd{a,b}3 (bios & /boot) on RAID1 not be a good idea?

Now back to EFI... (I'm starting to hate it)

I believe the error I'm seeing with grub-install is a Grub2 issue/bug. I even tried 2.02_rc1 which is currently ~ (will not try 9999). It seems that grub is not telling efibootmgr which disk to install to (it's probably passing a blank string).

So, even if I don't like it, I tried using efibootmgr directly taking some parts form the Gentoo handbook (https://wiki.gentoo.org/wiki/Handbook:AMD64/Full/Installation#Alternative_2:_efibootmgr).

So I ran:

Code:

# mkdir -p /boot/efi/boot

(I think there's another mistake in the Handbook as it might have to be /boot/efi/EFI/boot but I'm not sure)

I use genkernel and here's what I have:

Code:

# ls /boot/*genkernel*
/boot/System.map-genkernel-x86_64-4.8.17-hardened-r2
/boot/initramfs-genkernel-x86_64-4.8.17-hardened-r2
/boot/kernel-genkernel-x86_64-4.8.17-hardened-r2


According to https://wiki.gentoo.org/wiki/EFI_stub_kernel:
Quote:

It should be noted that EFI stub kernels can not load an initramfs if it is specified in CONFIG_CMDLINE. Check out efibootmgr, CONFIG_INITRAMFS_SOURCE, or separate bootloaders like (gummiboot or GRUB2) if an initramfs is a must-have.


As I understand it, some EFI mobo firmwares are capable of booting a Linux kernel in an EFI partition directly, without the need of any other bootloader (no GRUB2, nothing).
However, that requires several things: hard-coding the root partition address in the kernel via CONFIG_CMDLINE and including the initramfs in the kernel.
I can avoid the latter by using efibootmgr like this:

Code:

# cp /boot/initramfs-genkernel-x86_64-4.8.17-hardened-r2 /boot/efi/EFI/boot/bootx64.efi
# cp /boot/kernel-genkernel-x86_64-4.8.17-hardened-r2 /boot/efi/EFI/boot/initramfs.img
# efibootmgr --create --disk /dev/sda --part 2 --label "Gentoo" --loader '\efi\EFI\boot\bootx64.efi' -u initrd='\efi\EFI\boot\initramfs.img'
# efibootmgr --create --disk /dev/sdb --part 2 --label "Gentoo" --loader '\efi\EFI\boot\bootx64.efi' -u initrd='\efi\EFI\boot\initramfs.img'


But it is unclear to me if I still need to hardcode the root device within the kernel.
Also, I'm guessing the correct kernel config name is CONFIG_CMDLINE_PARTITION - not CONFIG_CMDLINE.

In the jail root:
Code:

# grep CONFIG_CMDLINE /usr/src/linux/.config
# CONFIG_CMDLINE_PARTITION is not set
# CONFIG_CMDLINE_BOOL is not set

# grep CONFIG_INITRAMFS /usr/src/linux/.config
CONFIG_INITRAMFS_SOURCE=""

# grep EFI /usr/src/linux/.config
CONFIG_EFI_PARTITION=y
CONFIG_EFI=y
CONFIG_EFI_STUB=y
# CONFIG_EFI_MIXED is not set
CONFIG_FB_EFI=y
CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK=y
# EFI (Extensible Firmware Interface) Support
CONFIG_EFI_VARS=y
CONFIG_EFI_ESRT=y
CONFIG_EFI_FAKE_MEMMAP=y
CONFIG_EFI_MAX_FAKE_MEM=8
CONFIG_EFI_RUNTIME_WRAPPERS=y
CONFIG_EFI_BOOTLOADER_CONTROL=y
CONFIG_EFI_CAPSULE_LOADER=y
# CONFIG_CACHEFILES is not set
CONFIG_EFIVAR_FS=y
# CONFIG_EARLY_PRINTK_EFI is not set
# CONFIG_EFI_PGT_DUMP is not set


Well, I ran efibootmgr on both disks and I'm getting a warning here:

Code:

# efibootmgr --create --disk /dev/sdb --part 2 --label "Gentoo" --loader '\efi\EFI\boot\bootx64.efi' -u initrd='\efi\EFI\boot\initramfs.img'
efibootmgr: ** Warning ** : Boot0000 has same label Gentoo
BootCurrent: 0003
Timeout: 0 seconds
BootOrder: 0005,0000,0003,0001,0004,0002
Boot0000* Gentoo
Boot0001* Hard Drive
Boot0002* Network Card
Boot0003* UEFI: TOSHIBA TransMemory
Boot0004* Removable Drive
Boot0005* Gentoo


Code:

# efibootmgr -v
BootCurrent: 0003
Timeout: 0 seconds
BootOrder: 0005,0000,0003,0001,0004,0002
Boot0000* Gentoo        HD(2,GPT,eba2e443-fd4d-4894-961b-12f0060dfa4d,0x1800,0x100000)/File(\efi\EFI\boot\bootx64.efi)i.n.i.t.r.d.=.
\.e.f.i.\.E.F.I.\.b.o.o.t.\.i.n.i.t.r.a.m.f.s...i.m.g.
Boot0001* Hard Drive    BBS(HD,,0x0)AMGOAMNO........o.O.C.Z.-.A.G.I.L.I.T.Y.3...........
.........A...........................>..Gd-.;.A..MQ..L
.C.O.-.Z.W.I.D.5.D.V.E.8.3.X.0.V.E.6.N.H......AMBOAMNO........
o.O.C.Z.-.A.G.I.L.I.T.Y.3....................A...........................>..Gd-.;.A..MQ..L.C.O.-.Z.2.L
.0.M.Y.O.7.X.J.N.S.J.6.U.0.8......AMBO
Boot0002* Network Card  BBS(Network,,0x0)AMGOAMNO........q.I.B.A. .G.E. .S.l
.o.t. .0.5.0.0. .v.1.3.2.1.........................rN.D+..,.\...........B..Gd-.;.A..MQ..L.I.B.A. .G.E.
.S.l.o.t. .0.5.0.0. .v.1.3.2.1......AMBOAMNO........q.I.B.A. .G.E. .S.l.o.t. .0.7.0.0. .v.1
.3.2.1.........................rN.D+..,.\...........B..Gd-.;.A..MQ..L.I.B.A. .G.E. .S.l.o.t. .0.7.0.0. .v
.1.3.2.1......AMBOAMNO........k.R.e.a.l.t.e.k. .P.X.E. .B.0.A. .D.0.0.........................rN
.D+..,.\...........<..Gd-.;.A..MQ..L.R.e.a.l.t.e.k. .P.X.E. .B.0.A. .D.0.0......AMBO
Boot0003* UEFI: TOSHIBA TransMemory     PciRoot(0x0)/Pci(0x15,0x2)/Pci(0x0,0x0)/USB(2,0)AMBO
Boot0004* Removable Drive       BBS(Floppy,,0x0)AMGOAMNO........o.T.O.S.H.I.B.A. .T.r.a.n.s.M.e.m.o.r.y....................A.............................<..Gd-.;.A..MQ..L.T.O.S.H.I.B.A. .T.r.a.n.s.M.e.m.o.r.y......AMBO
Boot0005* Gentoo        HD(2,GPT,4a4d2b95-1b34-40df-91eb-2235899958a6,0x1800,0x100000)/File(\efi\EFI\boot\bootx64.efi)i.n.i.t.r.d.=.\.e.f.i.\.E.F.I.\.b.o.o.t.\.i.n.i.t.r.a.m.f.s...i.m.g.


Now, if I reboot and tell my UEFI BIOS to boot from HDD, I'm expecting to see the UEFI boot menu with the "Gento" menu entry, even if I didn't hard-code ROOT in the kernel yet.
So I rebooted, pressed F8 to see the boot menu and I saw several entries for the HDD:
Code:

P0: OCZ-AGILITY3
P0: OCZ-AGILITY3
Gentoo (P1: OCZ-AGILITY3)
Gentoo (P2: OCZ-AGILITY3)
UEFI OS (P1: OCZ-AGILITY3)
UEFI OS (P2: OCZ-AGILITY3)


None of them work. When I select them, the boot process skips to the next boot device.
I'm not sure if the problem is that ROOT isn't hardcoded in the kernel but I don't think so because I would've seen some kind of kernel error message, I suppose.
So it could be because my EFI partitions on both disks are in RAID1.
However, note the following:

Code:

# fdisk -l /dev/sda
Disk /dev/sda: 223.6 GiB, 240057409536 bytes, 468862128 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 8ECDD071-71E2-4B80-804F-B5446A1232F9

Device        Start       End   Sectors   Size Type
/dev/sda1      2048      6143      4096     2M BIOS boot
/dev/sda2      6144   1054719   1048576   512M EFI System
/dev/sda3   1054720   2103295   1048576   512M Linux RAID
/dev/sda4   2103296  76171263  74067968  35.3G Linux RAID
/dev/sda5  76171264 468655279 392484016 187.2G Linux RAID

# fdisk -l /dev/sdb
Disk /dev/sdb: 223.6 GiB, 240057409536 bytes, 468862128 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: A880BF51-F482-49E7-AAD0-B7B4C2FE20D8

Device        Start       End   Sectors   Size Type
/dev/sdb1      2048      6143      4096     2M BIOS boot
/dev/sdb2      6144   1054719   1048576   512M EFI System
/dev/sdb3   1054720   2103295   1048576   512M Linux RAID
/dev/sdb4   2103296  76171263  74067968  35.3G Linux RAID
/dev/sdb5  76171264 468655279 392484016 187.2G Linux RAID


I chrooted into the new system again and removed the entries:

Code:

# efibootmgr -b 0 -B
# efibootmgr -b 5 -B
BootCurrent: 0008
Timeout: 0 seconds
BootOrder: 0006,0007,0008,0001,0009,0002
Boot0001* Hard Drive
Boot0002* Network Card
Boot0006* UEFI OS
Boot0007* UEFI OS
Boot0008* UEFI: TOSHIBA TransMemory
Boot0009* Removable Drive


I decided to try gummiboot as described in https://wiki.gentoo.org/wiki/Gummiboot but found out it's been renamed to
sys-boot/systemd-boot

Hmmm... Gentoo was known for its excellent documentation (and still is) but it seems to be hard to keep everything updated...

I'm using openrc, not systemd but anyway, I gave it a shot.

Guessing here:
Code:

# mkdir /boot/efi/EFI/systemd-boot
# cp /usr/lib/systemd/boot/efi/systemd-bootx64.efi /boot/efi/EFI/systemd-boot/


Since the following fails (as stated in the arch linux guide):

Code:

# bootctl --path /boot/efi install
Failed to probe partition scheme "/boot/efi": Input/output error

# fdisk /dev/sda
[...]
Command (m for help): i
Partition number (1-5, default 5): 2

         Device: /dev/sda2
          Start: 6144
            End: 1054719
        Sectors: 1048576
           Size: 512M
           Type: EFI System
      Type-UUID: C12A7328-F81F-11D2-BA4B-00A0C93EC93B
           UUID: EBA2E443-FD4D-4894-961B-12F0060DFA4D
           Name: uefi

# mount | grep efi
/dev/md2 on /boot/efi type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)


... then I tried to use efibootmgr directly:

Code:

# efibootmgr --create --disk /dev/sda --part 2 --label "Gentoo" --loader '\efi\EFI\systemd-boot\systemd-bootx64.efi'
# efibootmgr --create --disk /dev/sdb --part 2 --label "Gentoo 2" --loader '\efi\EFI\systemd-boot\systemd-bootx64.efi'
# mkdir -p /boot/efi/loader/entries
# echo "title          Gentoo Linux" > /boot/efi/loader/entries/gentoo.conf
# echo "linux         /boot/bootx64.efi" >> /boot/efi/loader/entries/gentoo.conf
# echo "initrd        /boot/initramfs.img" >> /boot/efi/loader/entries/gentoo.conf
# echo "options     root=/dev/md5 rw" >> /boot/efi/loader/entries/gentoo.conf

(/boot/bootx64.efi and /boot/initramfs.img are copies of the genkernel-generated files as mentioned earlier)

However, when I reboot to HDD, I don't get the "Gentoo Linux" menu entry supposedly generated by systemd-boot.
When I select the UEFI HDD device to boot, nothing shows up and I'm back in the UEFI/BIOS boot menu.

This whole thing is starting to be a PITA and I'm sorry to flood this forum topic with all this info.

So I guess I'm left with either booting Legacy BIOS with GPT and forget UEFI, or trying to use UEFI on non-RAID partitions.
In the latter case, I believe grub-install will work.

Moderator edit: Added some arbitrary line breaks to improve forum formatting. — JRG
Back to top
View user's profile Send private message
Fitzcarraldo
Advocate
Advocate


Joined: 30 Aug 2008
Posts: 2036
Location: United Kingdom

PostPosted: Mon Feb 13, 2017 2:16 pm    Post subject: Reply with quote

My suggestion would be to stick with UEFI but put the ESP on a non-raid partition. If you have a professional server with an internal SD Card slot and/or internal USB pen drive port, that would be a good place to put the ESP.
_________________
Clevo W230SS: amd64, VIDEO_CARDS="intel modesetting nvidia".
Compal NBLB2: ~amd64, xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC systemd-utils[udev] elogind KDE on both.

My blog
Back to top
View user's profile Send private message
Vieri
l33t
l33t


Joined: 18 Dec 2005
Posts: 886

PostPosted: Mon Feb 13, 2017 4:19 pm    Post subject: Reply with quote

I'll have to reboot tomorrow because I'm at a remote location right now. The installation process from the SysRescCD liveUSB system has finished and grub-install didn't complain when writing to non-RAIDed /dev/sd{a,b}2.

I'm wondering if I will still be able to boot the HDD even with Legacy BIOS, not just UEFI.
I suppose so.

BTW this is all I see within EFI after grub-install:

Code:
sysresccd grub # ls /boot/efi/
EFI
sysresccd grub # ls /boot/efi/EFI       
gentoo
sysresccd grub # ls /boot/efi/EFI/gentoo
grubx64.efi


and in "boot":

Code:

sysresccd grub # ls /boot/grub
fonts  grub.cfg  grubenv  locale  themes  x86_64-efi

sysresccd grub # ls /boot/grub/x86_64-efi
acpi.mod              cpio.mod        fshelp.mod              hashsum.mod               macbless.mod     part_amiga.mod       scsi.mod            ufs2.mod
adler32.mod           cpio_be.mod     functional_test.mod     hdparm.mod                macho.mod        part_apple.mod       search.mod          uhci.mod
affs.mod              cpuid.mod       gcry_arcfour.mod        hello.mod                 mdraid09.mod     part_bsd.mod         search_fs_file.mod  usb.mod
afs.mod               crc64.mod       gcry_blowfish.mod       help.mod                  mdraid09_be.mod  part_dfly.mod        search_fs_uuid.mod  usb_keyboard.mod
ahci.mod              crypto.lst      gcry_camellia.mod       hexdump.mod               mdraid1x.mod     part_dvh.mod         search_label.mod    usbms.mod
all_video.mod         crypto.mod      gcry_cast5.mod          hfs.mod                   memdisk.mod      part_gpt.mod         serial.mod          usbserial_common.mod
aout.mod              cryptodisk.mod  gcry_crc.mod            hfsplus.mod               memrw.mod        part_msdos.mod       setjmp.mod          usbserial_ftdi.mod
appleldr.mod          cs5536.mod      gcry_des.mod            hfspluscomp.mod           minicmd.mod      part_plan.mod        setjmp_test.mod     usbserial_pl2303.mod
archelp.mod           ctz_test.mod    gcry_dsa.mod            http.mod                  minix.mod        part_sun.mod         setpci.mod          usbserial_usbdebug.mod
at_keyboard.mod       date.mod        gcry_idea.mod           iorw.mod                  minix2.mod       part_sunpc.mod       sfs.mod             usbtest.mod
ata.mod               datehook.mod    gcry_md4.mod            iso9660.mod               minix2_be.mod    partmap.lst          shift_test.mod      verify.mod
backtrace.mod         datetime.mod    gcry_md5.mod            jfs.mod                   minix3.mod       parttool.lst         signature_test.mod  video.lst
bfs.mod               disk.mod        gcry_rfc2268.mod        jpeg.mod                  minix3_be.mod    parttool.mod         sleep.mod           video.mod
bitmap.mod            diskfilter.mod  gcry_rijndael.mod       keylayouts.mod            minix_be.mod     password.mod         sleep_test.mod      video_bochs.mod
bitmap_scale.mod      div.mod         gcry_rmd160.mod         keystatus.mod             mmap.mod         password_pbkdf2.mod  spkmodem.mod        video_cirrus.mod
blocklist.mod         div_test.mod    gcry_rsa.mod            ldm.mod                   moddep.lst       pata.mod             squash4.mod         video_colors.mod
boot.mod              dm_nv.mod       gcry_seed.mod           legacy_password_test.mod  modinfo.sh       pbkdf2.mod           syslinuxcfg.mod     video_fb.mod
bsd.mod               echo.mod        gcry_serpent.mod        legacycfg.mod             morse.mod        pbkdf2_test.mod      tar.mod             videoinfo.mod
bswap_test.mod        efi_gop.mod     gcry_sha1.mod           linux.mod                 mpi.mod          pcidump.mod          terminal.lst        videotest.mod
btrfs.mod             efi_uga.mod     gcry_sha256.mod         linux16.mod               msdospart.mod    play.mod             terminal.mod        videotest_checksum.mod
bufio.mod             efifwsetup.mod  gcry_sha512.mod         loadbios.mod              mul_test.mod     png.mod              terminfo.mod        xfs.mod
cat.mod               efinet.mod      gcry_tiger.mod          loadenv.mod               multiboot.mod    priority_queue.mod   test.mod            xnu.mod
cbfs.mod              ehci.mod        gcry_twofish.mod        loopback.mod              multiboot2.mod   probe.mod            test_blockarg.mod   xnu_uuid.mod
cbls.mod              elf.mod         gcry_whirlpool.mod      ls.mod                    nativedisk.mod   procfs.mod           testload.mod        xnu_uuid_test.mod
cbmemc.mod            eval.mod        geli.mod                lsacpi.mod                net.mod          progress.mod         testspeed.mod       xzio.mod
cbtable.mod           exfat.mod       gettext.mod             lsefi.mod                 newc.mod         raid5rec.mod         tftp.mod            zfs.mod
cbtime.mod            exfctest.mod    gfxmenu.mod             lsefimmap.mod             nilfs2.mod       raid6rec.mod         tga.mod             zfscrypt.mod
chain.mod             ext2.mod        gfxterm.mod             lsefisystab.mod           normal.mod       random.mod           time.mod            zfsinfo.mod
cmdline_cat_test.mod  extcmd.mod      gfxterm_background.mod  lsmmap.mod                ntfs.mod         read.mod             tr.mod
cmp.mod               fat.mod         gfxterm_menu.mod        lspci.mod                 ntfscomp.mod     reboot.mod           trig.mod
cmp_test.mod          file.mod        gptsync.mod             lssal.mod                 odc.mod          regexp.mod           true.mod
command.lst           fixvideo.mod    grub.efi                luks.mod                  offsetio.mod     reiserfs.mod         udf.mod
configfile.mod        font.mod        gzio.mod                lvm.mod                   ohci.mod         relocator.mod        ufs1.mod
core.efi              fs.lst          halt.mod                lzopio.mod                part_acorn.mod   romfs.mod            ufs1_be.mod


Does this look right?
Back to top
View user's profile Send private message
Vieri
l33t
l33t


Joined: 18 Dec 2005
Posts: 886

PostPosted: Tue Feb 14, 2017 7:58 am    Post subject: Reply with quote

Setting up two UEFI partitions on each disk as non-RAID1 works fine now. I used grub-install and I could reboot from the HDD with UEFI.
However, I could not boot via Legacy BIOS.
So I booted the LiveUSB with UEFI again, chrooted into the installed system and ran:

Code:

# grub-install --target=i386-pc /dev/sda
# grub-install --target=i386-pc /dev/sdb


I have to run that AND

Code:

# grub-install --target=x86_64-efi --efi-directory=/boot/efi /dev/sda
# grub-install --target=x86_64-efi --efi-directory=/boot/efi /dev/sdb


Now the HDD is bootable both ways.

Thanks
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