Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
UEFI issues - no bootloader found - raid1+cryptsetup+lvm
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
zeronada
n00b
n00b


Joined: 22 Aug 2016
Posts: 2
Location: Germany

PostPosted: Mon Aug 22, 2016 3:21 pm    Post subject: UEFI issues - no bootloader found - raid1+cryptsetup+lvm Reply with quote

Hi everyone,

I have a problem after installing gentoo with cryptsetup, lvm and raid1 on UEFI hardware (Gigabyte Z77-DS3H with "Dual UEFI BIOS"):
I started the systemrescuecd, unlocked the disks and mounted everything:

Code:
root@sysresccd /root % lsblk -f --output NAME,FSTYPE,UUID,SIZE,MOUNTPOINT
NAME                             FSTYPE            UUID                                     SIZE MOUNTPOINT
sda                                                                                       931.5G
└─sda1                           ntfs              6C92203667A35DAF                       931.5G
sdb                                                                                       931.5G
└─sdb1                           linux_raid_member 125b6751-a266-d2b6-ae70-95e59df61d64   931.5G
  └─md127                                                                                 931.4G
    └─md127p1                    crypto_LUKS       7113a946-4511-4423-9c47-911d7f13b31b   931.4G
      └─hdd-gentoo               LVM2_member       7FcsJd-dJGw-a6Ct-ktcs-tcSQ-8YlX-akhqQF 931.4G
        ├─vg--gentoo--hdd-swap   swap              2cf73db5-a172-47f7-a0f7-e2df293aeb64      20G [SWAP]
        ├─vg--gentoo--hdd-opt    ext4              578e5af2-9fde-4716-b8c6-7363e9325df5      80G /mnt/gentoo/opt
        ├─vg--gentoo--hdd-backup ext4              d90f8c99-cbfa-430f-a770-44f3b000d36b     200G /mnt/gentoo/root/backup
        └─vg--gentoo--hdd-home   ext4              820a588e-7ec3-4743-8ad8-6cca85dec02d   631.4G /mnt/gentoo/home
sdc                                                                                       111.8G
└─sdc1                           linux_raid_member e8cb5baa-8e08-efbd-4b99-dddfca66debf   111.8G
  └─md126                                                                                 111.7G
    ├─md126p1                    vfat              C043-9868                                  2M /mnt/gentoo/boot/efi
    ├─md126p2                    crypto_LUKS       e9c5d3a2-e2c0-4089-b182-56e82f3f358a   108.7G
    │ └─gentoo-root-ssd          LVM2_member       yMb4vV-UNTq-7auF-esWS-pz9m-HLQ6-c1lTPK 108.7G
    │   └─vg--gentoo--root-root  ext4              70ad4647-5b57-45d7-96d9-a38ef0b52660   108.7G /mnt/gentoo
    └─md126p3                    vfat              B93B-6F8D                                  3G /mnt/gentoo/boot
sdd                                                                                       117.4G
└─sdd1                           linux_raid_member e8cb5baa-8e08-efbd-4b99-dddfca66debf   111.8G
  └─md126                                                                                 111.7G
    ├─md126p1                    vfat              C043-9868                                  2M /mnt/gentoo/boot/efi
    ├─md126p2                    crypto_LUKS       e9c5d3a2-e2c0-4089-b182-56e82f3f358a   108.7G
    │ └─gentoo-root-ssd          LVM2_member       yMb4vV-UNTq-7auF-esWS-pz9m-HLQ6-c1lTPK 108.7G
    │   └─vg--gentoo--root-root  ext4              70ad4647-5b57-45d7-96d9-a38ef0b52660   108.7G /mnt/gentoo
    └─md126p3                    vfat              B93B-6F8D                                  3G /mnt/gentoo/boot
sde                                                                                         2.7T
└─sde1                           crypto_LUKS       7718ea90-a6e7-49e2-8b2f-d6f8038a2ff7     2.7T
sdf                                                                                       931.5G
└─sdf1                           linux_raid_member 125b6751-a266-d2b6-ae70-95e59df61d64   931.5G
  └─md127                                                                                 931.4G
    └─md127p1                    crypto_LUKS       7113a946-4511-4423-9c47-911d7f13b31b   931.4G
      └─hdd-gentoo               LVM2_member       7FcsJd-dJGw-a6Ct-ktcs-tcSQ-8YlX-akhqQF 931.4G
        ├─vg--gentoo--hdd-swap   swap              2cf73db5-a172-47f7-a0f7-e2df293aeb64      20G [SWAP]
        ├─vg--gentoo--hdd-opt    ext4              578e5af2-9fde-4716-b8c6-7363e9325df5      80G /mnt/gentoo/opt
        ├─vg--gentoo--hdd-backup ext4              d90f8c99-cbfa-430f-a770-44f3b000d36b     200G /mnt/gentoo/root/backup
        └─vg--gentoo--hdd-home   ext4              820a588e-7ec3-4743-8ad8-6cca85dec02d   631.4G /mnt/gentoo/home
sr0                              iso9660           2016-08-12-17-03-34-00                 460.9M
loop0                            squashfs                                                 338.4M /livemnt/squashfs


Now I continued with:
https://wiki.gentoo.org/wiki/Talk:UEFI_Gentoo_Quick_Install_Guide
Code:
root@sysresccd /root % modprobe efivars
root@sysresccd /root % modprobe efivarfs
root@sysresccd /root % modprobe -c | grep efi
alias symbol:_rtl92c_phy_init_bb_rf_register_definition rtl8192c_common
root@sysresccd /root % lsmod| grep efi

I cannot find any loaded module, but I continued with chroot:
Code:
cp -L /etc/resolv.conf /mnt/gentoo/etc/
mount -t proc proc /mnt/gentoo/proc
mount --rbind /sys /mnt/gentoo/sys
mount --rbind /dev /mnt/gentoo/dev
mount --make-rslave /mnt/gentoo/sys
mount --make-rslave /mnt/gentoo/dev

chroot /mnt/gentoo /bin/bash
source /etc/profile
export PS1="(chroot) $PS1"
cp /proc/mounts /etc/mtab


After the regular handbook stuff, building a kernel, initram and System-map using genkernel, I was trying to use grub2 as boot loader, since I want to use mdadm 1.2 layout in the raid (there is an insmod mdraid1x and insmod part_gpt, I guess lilo is not able to that.)

https://wiki.gentoo.org/wiki/GRUB2
https://wiki.gentoo.org/wiki/GRUB2/AdvancedStorage

Code:
emerge -av --newuse --deep sys-boot/grub:2

[ebuild   R    ] sys-boot/grub-2.02_beta2-r9:2/2.02_beta2-r9::gentoo  USE="device-mapper fonts nls sdl themes truetype -debug -doc -efiemu (-libzfs) -mount -multislot -static {-test}" GRUB_PLATFORMS="efi-64 -coreboot -efi-32 -emu -ieee1275 -loongson -multiboot -pc -qemu -qemu-mips -uboot -xen" 0 KiB


Code:
(chroot) livecd / # cat /etc/default/grub
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
#
# To populate all changes in this file you need to regenerate your
# grub configuration file afterwards:
#     'grub2-mkconfig -o /boot/grub/grub.cfg'
#
# See the grub info page for documentation on possible variables and
# their associated values.

GRUB_DISTRIBUTOR="Gentoo"

# Default menu entry
#GRUB_DEFAULT=0

# Boot the default entry this many seconds after the menu is displayed
GRUB_TIMEOUT=50
#GRUB_TIMEOUT_STYLE=menu

# Append parameters to the linux kernel command line
GRUB_CMDLINE_LINUX="init=/linuxrc dolvm domdadm keymap=de net.ifnames=0"
#
# Examples:
#
# Boot with network interface renaming disabled
# GRUB_CMDLINE_LINUX="net.ifnames=0"
#
# Boot with systemd instead of sysvinit (openrc)
# GRUB_CMDLINE_LINUX="init=/usr/lib/systemd/systemd"

# Append parameters to the linux kernel command line for non-recovery entries
#GRUB_CMDLINE_LINUX_DEFAULT=""

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal.
# Note that you can use only modes which your graphic card supports via VBE.
# You can see them in real GRUB with the command `vbeinfo'.
#GRUB_GFXMODE=640x480

# Set to 'text' to force the Linux kernel to boot in normal text
# mode, 'keep' to preserve the graphics mode set using
# 'GRUB_GFXMODE', 'WIDTHxHEIGHT'['xDEPTH'] to set a particular
# graphics mode, or a sequence of these separated by commas or
# semicolons to try several modes in sequence.
#GRUB_GFXPAYLOAD_LINUX=

# Path to theme spec txt file.
# The starfield is by default provided with use truetype.
# NOTE: when enabling custom theme, ensure you have required font/etc.
#GRUB_THEME="/boot/grub/themes/starfield/theme.txt"

# Background image used on graphical terminal.
# Can be in various bitmap formats.
#GRUB_BACKGROUND="/boot/grub/mybackground.png"

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to kernel
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY=true

# Uncomment to disable generation of the submenu and put all choices on
# the top-level menu.
# Besides the visual affect of no sub menu, this makes navigation of the
# menu easier for a user who can't see the screen.
#GRUB_DISABLE_SUBMENU=y

# Uncomment to play a tone when the main menu is displayed.
# This is useful, for example, to allow users who can't see the screen
# to know when they can make a choice on the menu.
#GRUB_INIT_TUNE="60 800 1"
GRUB_ENABLE_CRYPTODISC=y
GRUB_CRYPTODISC_ENABLE=y
GRUB_PRELOAD_MODULES=lvm


I hope this is all I need to change in /etc/default/grub. Then I do:
Code:
(chroot) livecd / # grub-mkconfig -v
grub-mkconfig (GRUB) 2.02~beta2

I guess the command in the textfile is not gentoo specific since I cannot find any grub2-* commands.

Code:
(chroot) livecd / # grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  WARNING: Failed to connect to lvmetad. Falling back to internal scanning.
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  WARNING: Failed to connect to lvmetad. Falling back to internal scanning.
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  WARNING: Failed to connect to lvmetad. Falling back to internal scanning.
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  WARNING: Failed to connect to lvmetad. Falling back to internal scanning.
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  WARNING: Failed to connect to lvmetad. Falling back to internal scanning.
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  WARNING: Failed to connect to lvmetad. Falling back to internal scanning.
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  WARNING: Failed to connect to lvmetad. Falling back to internal scanning.
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  WARNING: Failed to connect to lvmetad. Falling back to internal scanning.
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  WARNING: Failed to connect to lvmetad. Falling back to internal scanning.
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  WARNING: Failed to connect to lvmetad. Falling back to internal scanning.
Found linux image: /boot/kernel-genkernel-x86_64-4.4.8-hardened-r1
Found initrd image: /boot/initramfs-genkernel-x86_64-4.4.8-hardened-r1
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  WARNING: Failed to connect to lvmetad. Falling back to internal scanning.
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  WARNING: Failed to connect to lvmetad. Falling back to internal scanning.
done


Looks not good, but I continued. There might be a connection problem since lvmetad is not running:

Code:
(chroot) livecd / # /etc/init.d/lvmetad status
 * You are attempting to run an openrc service on a
 * system which openrc did not boot.
 * You may be inside a chroot or you may have used
 * another initialization system to boot this system.
 * In this situation, you will get unpredictable results!
 * If you really want to do this, issue the following command:
 * touch /run/openrc/softlevel


This is the result:

Code:
(chroot) sysresccd / # cat /boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
insmod lvm
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if loadfont unicode ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=50
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=50
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-70ad4647-5b57-45d7-96d9-a38ef0b52660' {
   load_video
   if [ "x$grub_platform" = xefi ]; then
      set gfxpayload=keep
   fi
   insmod gzio
   insmod part_gpt
   insmod part_gpt
   insmod part_gpt
   insmod diskfilter
   insmod mdraid1x
   insmod fat
   set root='mduuid/e8cb5baa8e08efbd4b99dddfca66debf,gpt3'
   if [ x$feature_platform_search_hint = xy ]; then
     search --no-floppy --fs-uuid --set=root --hint='mduuid/e8cb5baa8e08efbd4b99dddfca66debf,gpt3'  B93B-6F8D
   else
     search --no-floppy --fs-uuid --set=root B93B-6F8D
   fi
   echo   'Loading Linux x86_64-4.4.8-hardened-r1 ...'
   linux   /kernel-genkernel-x86_64-4.4.8-hardened-r1 root=/dev/mapper/vg--gentoo--root-root ro init=/linuxrc dolvm domdadm keymap=de net.ifnames=0
   echo   'Loading initial ramdisk ...'
   initrd   /initramfs-genkernel-x86_64-4.4.8-hardened-r1
}
submenu 'Advanced options for Gentoo GNU/Linux' $menuentry_id_option 'gnulinux-advanced-70ad4647-5b57-45d7-96d9-a38ef0b52660' {
   menuentry 'Gentoo GNU/Linux, with Linux x86_64-4.4.8-hardened-r1' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-4.4.8-hardened-r1-advanced-70ad4647-5b57-45d7-96d9-a38ef0b52660' {
      load_video
      if [ "x$grub_platform" = xefi ]; then
         set gfxpayload=keep
      fi
      insmod gzio
      insmod part_gpt
      insmod part_gpt
      insmod part_gpt
      insmod diskfilter
      insmod mdraid1x
      insmod fat
      set root='mduuid/e8cb5baa8e08efbd4b99dddfca66debf,gpt3'
      if [ x$feature_platform_search_hint = xy ]; then
        search --no-floppy --fs-uuid --set=root --hint='mduuid/e8cb5baa8e08efbd4b99dddfca66debf,gpt3'  B93B-6F8D
      else
        search --no-floppy --fs-uuid --set=root B93B-6F8D
      fi
      echo   'Loading Linux x86_64-4.4.8-hardened-r1 ...'
      linux   /kernel-genkernel-x86_64-4.4.8-hardened-r1 root=/dev/mapper/vg--gentoo--root-root ro init=/linuxrc dolvm domdadm keymap=de net.ifnames=0
      echo   'Loading initial ramdisk ...'
      initrd   /initramfs-genkernel-x86_64-4.4.8-hardened-r1
   }
   menuentry 'Gentoo GNU/Linux, with Linux x86_64-4.4.8-hardened-r1 (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-4.4.8-hardened-r1-recovery-70ad4647-5b57-45d7-96d9-a38ef0b52660' {
      load_video
      if [ "x$grub_platform" = xefi ]; then
         set gfxpayload=keep
      fi
      insmod gzio
      insmod part_gpt
      insmod part_gpt
      insmod part_gpt
      insmod diskfilter
      insmod mdraid1x
      insmod fat
      set root='mduuid/e8cb5baa8e08efbd4b99dddfca66debf,gpt3'
      if [ x$feature_platform_search_hint = xy ]; then
        search --no-floppy --fs-uuid --set=root --hint='mduuid/e8cb5baa8e08efbd4b99dddfca66debf,gpt3'  B93B-6F8D
      else
        search --no-floppy --fs-uuid --set=root B93B-6F8D
      fi
      echo   'Loading Linux x86_64-4.4.8-hardened-r1 ...'
      linux   /kernel-genkernel-x86_64-4.4.8-hardened-r1 root=/dev/mapper/vg--gentoo--root-root ro single init=/linuxrc dolvm domdadm keymap=de net.ifnames=0
      echo   'Loading initial ramdisk ...'
      initrd   /initramfs-genkernel-x86_64-4.4.8-hardened-r1
   }
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###


But since this is just a warning, I didn't want to start lvmetad.
I don't get what the handbook means when install grub2, so I just continued with the regular grub2 guide:
https://wiki.gentoo.org/wiki/GRUB2
Quote:
In order for GRUB2 to install properly, the EFI directory must be mounted and the efivars kernel module must be loaded before the grub-install command will complete successfully.

This is done, so:
Code:
grub-install --target=x86_64-efi --efi-directory=/boot/efi --recheck --debug  /dev/sdc
...
lot of debug stuff
...
grub-install: info: reading /usr/lib/grub/x86_64-efi/mdraid1x.mod.
grub-install: info: kernel_img=0x5558ea80a250, kernel_size=0x19200.
grub-install: info: the core size is 0x20478.
grub-install: info: writing 0x21800 bytes.
grub-install: info: copying `/boot/grub/x86_64-efi/core.efi' -> `/boot/efi/EFI/gentoo/grubx64.efi'.
grub-install: info: Registering with EFI: distributor = `gentoo', path = `\EFI\gentoo\grubx64.efi', ESP at mduuid/e8cb5baa8e08efbd4b99dddfca66debf,gpt1.
grub-install: info: executing efibootmgr --version </dev/null >/dev/null.
grub-install: info: executing modprobe -q efivars.
grub-install: info: executing efibootmgr -c -d.
efibootmgr: option requires an argument -- 'd'
efibootmgr version 0.12
usage: efibootmgr [options]
   -a | --active         sets bootnum active
   -A | --inactive       sets bootnum inactive
   -b | --bootnum XXXX   modify BootXXXX (hex)
   -B | --delete-bootnum delete bootnum (hex)
   -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
   -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")
   -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
   -@ | --append-binary-args file  append extra args from file (use "-" for stdin)
   -h | --help             show help/usage
Installation finished. No error reported.
(chroot) sysresccd / #

And the Result is the same when I run this on /dev/sdd (I do both because I want to be able to boot from both devices in case one is broken. I hope with grub it works this way.).
After a reboot, I do not found a grub bootloader.

How do you install grub2 on a device? I always used lilo, but I will not be able to boot a 1.2 mdadm raid with lilo since kernel detection works only with 0.9 as far as I know. I know in the https://wiki.gentoo.org/wiki/GRUB2/AdvancedStorage it is said that you cannot use genkernel to build a kernel when using raid1:
Quote:
Make sure the kernel is configured correctly. Especially make sure that CONFIG_FHANDLE variable is set (this is why genkernel must not be used - genkernel will reset the value of CONFIG_FHANDLE and reap havoc upon the RAID set).

I will rebuild the kernel if this is still actually true, but I should at least find a bootloader when I start the computer.
Any ideas are appreciate, I have no idea what to do now... Many thanks in advance.
If I forgot any files you need, please ask and I will attach them.
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1369
Location: Montréal

PostPosted: Mon Aug 22, 2016 6:37 pm    Post subject: Reply with quote

Hello,

about the fact that the modules efivars and efivarfs do not show up when you do lsmod, check in the /boot directory of SystemRescueCd the Linux configuration file to know how the Efi support have been compile. If this file is named config for example do
Code:
grep -i efi /boot/config

If you see that the options CONFIG_EFI_VARS and CONFIG_EFIVAR_FS are compile in hard (=y) this explain why the modules efivars and efivarfs do not show up when you do lsmod. Those modules do not exist.

If CONFIG_EFI_VARS and CONFIG_EFIVAR_FS are compile in modules (=m) you may have not boot in Efi mode. In this case, check you Bios/efi setup. Be sure to choose the Efi mode for SystemRescueCd in the Efi boot choices menu. Be sure that SystemRescuecd have effectively boot in Efi mode and have not fallback in Bios mode.

In all cases, check if SystemRescueCd have mount a efivarfs in the /sys/firmware/efi/efivars directory with the mount command. This filesystem must be mount in the chroot too, what you do not do according with the commands you have done. Without access to the efivars with read and write permissions, you are unable to install Grub2 for Efi boot in chroot.

In chroot Openrc tell you that it will not start a service unless you follow the method it show you. I think you must activate lvm out of the chroot from the shell prompt of the host, SystemRescueCd.

To Iinstall successfully Grub2 in Efi mode in chroot with the grub-install command, the EFI partition must be mounted in /boot/efi in the chroot directory. Than after that only it is time to use grub-mkconfig. If the Efi partition is not mounted in the chroot /boot/efi directory, this explain the error messages you receive from grub-install and grub-mkconfig.

So, the accessibility of the efivars in /sys/firmware/efi/efivars of the chroot and the Efi partition mounted in the /boot/efi of the chroot are mandatory to succeed.

You have choose a very complicated setup to handle if your are not familiar with filesystems encryption, lvm, raid and Efi with Linux and Gentoo.
_________________
Paul


Last edited by Logicien on Tue Aug 23, 2016 12:32 pm; edited 1 time in total
Back to top
View user's profile Send private message
324874
Apprentice
Apprentice


Joined: 26 Jul 2014
Posts: 168

PostPosted: Tue Aug 23, 2016 8:24 am    Post subject: Reply with quote

Hi zeronada!

I believe it's not easy [added] to have an ESP (EFI System Partition) on a RAID disk (cf. "Partition Discovery", page 539, in the UEFI specification).

lsblk:
NAME                             FSTYPE            UUID                                     SIZE MOUNTPOINT
[...]
sdc                                                                                       111.8G
└─sdc1                           linux_raid_member e8cb5baa-8e08-efbd-4b99-dddfca66debf   111.8G
  └─md126                                                                                 111.7G
    ├─md126p1                    vfat              C043-9868                                  2M /mnt/gentoo/boot/efi
    ├─md126p2                    crypto_LUKS       e9c5d3a2-e2c0-4089-b182-56e82f3f358a   108.7G
    │ └─gentoo-root-ssd          LVM2_member       yMb4vV-UNTq-7auF-esWS-pz9m-HLQ6-c1lTPK 108.7G
    │   └─vg--gentoo--root-root  ext4              70ad4647-5b57-45d7-96d9-a38ef0b52660   108.7G /mnt/gentoo
    └─md126p3                    vfat              B93B-6F8D                                  3G /mnt/gentoo/boot
sdd                                                                                       117.4G
└─sdd1                           linux_raid_member e8cb5baa-8e08-efbd-4b99-dddfca66debf   111.8G
  └─md126                                                                                 111.7G
    ├─md126p1                    vfat              C043-9868                                  2M /mnt/gentoo/boot/efi
    ├─md126p2                    crypto_LUKS       e9c5d3a2-e2c0-4089-b182-56e82f3f358a   108.7G
    │ └─gentoo-root-ssd          LVM2_member       yMb4vV-UNTq-7auF-esWS-pz9m-HLQ6-c1lTPK 108.7G
    │   └─vg--gentoo--root-root  ext4              70ad4647-5b57-45d7-96d9-a38ef0b52660   108.7G /mnt/gentoo
    └─md126p3                    vfat              B93B-6F8D                                  3G /mnt/gentoo/boot
[...]


This wiki page lack of informations.

I believe you are incorrectly using RAID technology: (Edit: Could you explain your configuration, please?)
"Data is distributed across the drives in one of several ways, referred to as RAID levels, depending on the required level of redundancy and performance." - (source: wikipedia)

Best regards, feng.


Last edited by 324874 on Tue Aug 23, 2016 12:41 pm; edited 1 time in total
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


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

PostPosted: Tue Aug 23, 2016 10:33 am    Post subject: Reply with quote

You may check if booting from raid is even possible. Therefore use a pendrive (usb stick) and setup grub on that. When you are than able to boot from the usb pendrive than you are unable to boot from that "fake" raid.

You may check if its really a hardware raid controller. Keywords fake raid / software vs hardware raid ... when you look up on the web....

Usually a hardware raid is with one of those adaptec plug in cards where the cables are connected to that card. a mainboard raid is usually crap (personal opinion) ...

You may achieve mirroring your data with e.g. lvm2 feature for example ... (highly recommended)
Back to top
View user's profile Send private message
zeronada
n00b
n00b


Joined: 22 Aug 2016
Posts: 2
Location: Germany

PostPosted: Tue Aug 23, 2016 3:03 pm    Post subject: Reply with quote

Thank you guys for your fast replies.

@tw04l124:
My RAID1 "configuration" is a software raid. I dislike mainboard raid solutions too, since if this "hardware raid" may get destroyed I would have to get the same mainboard just to get the data. But it sounds very interesting to mirror data with lvm2, I didn't know that.

@Logicien:
Thanks a lot! I totally forgot the modules could be compiled in the kernel of the rescue system. Also I wasn't aware that /sys/firmware/efi/efivars has to be mounted in the chroot. I will have a look where /sys/firmware/efi/efivars is located and mount it before chrooting. But since I have to restart the whole installation process now, I will format the discs to MDR and use the legacy boot. I had no idea that UEFI would be that complicated.

@feng:
Thanks for the link to the spec, I see the issue now. It seems that the UEFI ignores the recognized RAID on purpose (p. 539 chapter 12.3.2 Partition Discovery as you mentioned). It seems that I was trying something stupid with the raid, since I created first partitions on sdc and sdd, then created the arrays (and the efi partition is inside the raid..):

Code:
mdadm --create /dev/md/ssd-gentoo-root --level=1 --raid-devices=2 /dev/sdc1 /dev/sdd1
mdadm --create /dev/md/hdd-gentoo-1tb --level=1 --raid-devices=2 /dev/sdb1 /dev/sdf1


And after that I was partitioning again. I guess I was kind of confused with all those different layers :D
Is it possible to create an array this way and do partitioning after creation?

Code:
mdadm --create /dev/md/ssd-gentoo-root --level=1 --raid-devices=2 /dev/sdc /dev/sdd
mdadm --create /dev/md/hdd-gentoo-1tb --level=1 --raid-devices=2 /dev/sdb /dev/sdf
fdisk /dev/md/ssd-gentoo-root
fdisk /dev/md/hdd-gentoo-1tb


This is mentioned in: https://raid.wiki.kernel.org/index.php/RAID_Creation (without the partitioning).
Or do I have to do formatting directly after I have the new raid device, like this (for every partition on the drives):

Code:
mdadm --create /dev/md/0 --level=1 --raid-devices=2 /dev/sdc1 /dev/sdd1
mkfs.ext4 /dev/md0


I will now install the os first and do raid1 only on the data drive (non-boot), and then go with this guides:
* https://www.howtoforge.com/how-to-set-up-software-raid1-on-a-running-system-incl-grub2-configuration-ubuntu-10.04
* https://forums.gentoo.org/viewtopic-p-7673806.html?sid=739a3bf503dc75aca3b0eb0523425fa2

I am a bit confused with the software raid, the last time I had to do anything with raid was with an adaptec controller, this was pretty straightforward. There you can do partitioning after creating raid1. But without that, I would have to do splitting and partitioning on a drive before the raid1 setup, so I would have to create a raid1 for every /dev/sdXn, like in https://www.howtoforge.com/how-to-set-up-software-raid1-on-a-running-system-incl-grub2-configuration-ubuntu-10.04. This seems to be a bit ugly, is that the way to go with software-raid1?
Back to top
View user's profile Send private message
324874
Apprentice
Apprentice


Joined: 26 Jul 2014
Posts: 168

PostPosted: Tue Aug 23, 2016 8:02 pm    Post subject: Reply with quote

zeronada, I see some things that could be improved.

The partition sizes seem too large.

There is only need one EFI System Partition to load Gentoo. This partition should be mounted on the /boot/efi directory.
This one could be mounted on /boot but the directory's content won't be available because it will have become a mount point.

This setup (RAID, LUKS and LVM) is difficult for me. I think this is difficult for a lot of people too.

LUKS/cryptsetup website wrote:
Be aware that if you add LVM into the mix, things can get very complicated.

Maybe, it can be done with softwares knowledge (knowing how softwares work).

zeronada wrote:
Is it possible to create an array this way and do partitioning after creation?

Yes, It's possible with LVM on RAID , for example. (cf. wiki.kernel.org)

zeronada wrote:
Or do I have to do formatting directly after I have the new raid device, like this (for every partition on the drives)

It's possible too. (cf. wiki.gentoo.org)

I don't know if one of the following ways works: [I haven't view (study) other possibilities]
  • create RAID disks, encrypt them with LUKS and finaly create partitions with LVM.
  • create LUKS and finaly create partition with LVM having RAID1 mirroring. (*)

(*) I don't know if there is a difference between LVM having RAID1 and LVM on RAID1.

Best regards, feng.
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