Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Grub2 only gives: error: disk 'hd0,gpt1' not found
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
TheTapsaFi
n00b
n00b


Joined: 02 Aug 2019
Posts: 7

PostPosted: Fri Aug 02, 2019 6:26 pm    Post subject: [SOLVED] Grub2 only gives: error: disk 'hd0,gpt1' not found Reply with quote

Hello all,

I have been trying to install Gentoo to my new Intel NUC8i7HVK. I'm aiming it to be installed so that the whole M.2 (NVME) disk is encrypted, and I'd use an un-encrypted USB stick as /boot, so its sort of a key to boot the machine. I just seem to be having a issue in that grub2 does not find any disks, even though grub2 itself does load. Something is hiding all the disks? Maybe EFI has some part in this, since this is the first machine I've had to utilize it?

Picture of the result:
https://pasteboard.co/IqNWN2L.jpg

Picture of trying to "ls" after setting debug=all:
https://pasteboard.co/IqNYyoP.jpg

I do not know why it complains about this hd0,gpt1 anyway, because the grub config does not seem to be even asking for it anywhere?
Here is the grub.cfg:
https://pastebin.com/MMfLdyyc

There might be some unnecessary "insmod"s etc from trying out different stuff to have some kind of effect on this issue, none of which have seemed to make any difference. When grub boots, if I press "e" on the boot menu entry, it shows that config as it is above, so it can read it ok.

blkid output:
https://pastebin.com/DBWAKzfq

Could it be that when I'm chrooted to the system using a archbang live usb, the grub-mkconfig names the devices differently, than when I remove the archbang live usb, and just try to boot from the intended /boot usb? There is no grub device map to give clues anymore as far as I know.(?) Maybe using USB stick as /boot is not as simple as I thought.

I have not been able to find any answers to this issue even though some people seem to have had almost the same issue, but they've just installed syslinux etc. to circumvent this problem. At the moment this computer is not essential to me, so I may keep it like this to find what the issue is, and maybe learn something along the way, which is mainly why I started on this journey with Gentoo anyway. I did install this following the handbook closely, and have made other Gentoo installs succesfully in the past, but those have not had encryption, lvm, uefi, or usb boot disk. Maybe I bit a piece too big for me to swallow...

Somewhat similar reports people have had in the past:
https://bbs.archlinux.org/viewtopic.php?id=238390
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1316068

I'd be very grateful for any directions and suggestions.


Last edited by TheTapsaFi on Sat Aug 03, 2019 8:49 pm; edited 1 time in total
Back to top
View user's profile Send private message
TheTapsaFi
n00b
n00b


Joined: 02 Aug 2019
Posts: 7

PostPosted: Sat Aug 03, 2019 8:15 am    Post subject: Reply with quote

Tried to reinstall grub. Formatted the USB stick that has /boot (/dev/sdb1) and /boot/efi (/dev/sdb2) partitions. Swapped the partitions around so that fat32 esp partition /boot/efi is on first partition (/dev/sdb1) and ext4 /boot is on second (/dev/sdb2). Reinstalled kernel and initramfs, and ran "grub-install --target=x86_64-efi --efi-directory=/boot/efi" again. Grub.cfg looks pretty similar, and now the error is "error: disk 'hd0,gpt2' not found." So it did react to the partitions being in the other order, but still searches for hd0, instead of hd1 mentioned in the grub.cfg. All of the available commands either seem to do nothing, absolutely no output, or give the error disk not found message. Even "halt" gives disk not found.

efibootmgr -v seems to show the entry created correctly by grub-install.

No replies yet... Maybe my question is either too obvious, has insufficient information, or too difficult. Knowing which it is would also help. ^^
Back to top
View user's profile Send private message
alamahant
Tux's lil' helper
Tux's lil' helper


Joined: 23 Mar 2019
Posts: 92

PostPosted: Sat Aug 03, 2019 11:37 am    Post subject: Reply with quote

May be you need to create your initramfs with this
Code:

genkernel --luks --lvm --install initramfs

Furthermore if your /boot is on a usb does the fstab reflect this?
Can you post your fstab and /etc/default/grub plz?
Better use UUIDs in fstab for your mounts.
Do you have the "dolvm" and the luks flags in the GRUB_CMDLINE_LINUX="" in your /etc/default/grub?
You seem to have your /boot in one disk your efi in another and your / in another..
Is such complexity absolutely essential?
Back to top
View user's profile Send private message
TheTapsaFi
n00b
n00b


Joined: 02 Aug 2019
Posts: 7

PostPosted: Sat Aug 03, 2019 1:59 pm    Post subject: Reply with quote

Thanks alamahant,

Yes initramfs was created with:
Code:
genkernel --luks --lvm --keymap --firmware --install initramfs

I did now do this again, after making sure /dev/sdb1 was mounted at /boot/efi and /dev/sdb2 mounted at /boot.

Current fstab that I updated after the previous partition adjustment:
Code:

# <fs>                  <mountpoint>    <type>          <opts>          <dump/pass>
#swap
UUID=f88f766f-c7b8-4d69-aa0b-fbda45d101ac   none    swap    sw  0 0
#root
UUID=f89b4582-0063-4f60-9952-58e9bb484850   /   ext4    noatime 0 1
#boot
PARTUUID=b63250fa-d4e5-4aa6-b73e-e8f204fec259   /boot   ext4    noatime 0 2
#efi
PARTUUID=69fbeb2d-57d5-46b7-9cbf-db97b64e83c6   /boot/efi   vfat    noatime 0 2
#home
UUID=41f36876-bcab-4d5d-bbae-f008dd334ba3   /home   ext4    atime   0 0
#tmp
UUID=4f6223e6-a815-4239-9f59-ef9e69cc51b4   /tmp    ext4    noatime 0 0


Current blkid:
Code:

/dev/nvme0n1: UUID="cba3f1f5-a4fa-4199-8377-e16d229fa1c9" TYPE="crypto_LUKS"
/dev/sda1: LABEL="MULTIBOOT" UUID="1CED-2257" TYPE="vfat" PARTUUID="0005f8cc-01"
/dev/loop0: TYPE="squashfs"
/dev/mapper/acheron: UUID="skhVcS-n3pi-Ulmw-iygg-b64q-teO7-BTjGkE" TYPE="LVM2_member"
/dev/mapper/acheronVG-acheronTmp: UUID="4f6223e6-a815-4239-9f59-ef9e69cc51b4" TYPE="ext4"
/dev/mapper/acheronVG-acheronRoot: UUID="f89b4582-0063-4f60-9952-58e9bb484850" TYPE="ext4"
/dev/mapper/acheronVG-acheronHome: UUID="41f36876-bcab-4d5d-bbae-f008dd334ba3" TYPE="ext4"
/dev/mapper/acheronVG-acheronSwap: UUID="f88f766f-c7b8-4d69-aa0b-fbda45d101ac" TYPE="swap"
/dev/sdb1: LABEL_FATBOOT="EFI" LABEL="EFI" UUID="D84B-4D6C" TYPE="vfat" PARTLABEL="efi" PARTUUID="69fbeb2d-57d5-46b7-9cbf-db97b64e83c6"
/dev/sdb2: LABEL="boot" UUID="8af5dba4-764f-47fa-a68f-daec6a20fbdc" TYPE="ext4" PARTLABEL="boot" PARTUUID="b63250fa-d4e5-4aa6-b73e-e8f204fec259"
/dev/sdb3: LABEL="storage1" UUID="49035136232C35A4" TYPE="ntfs" PTTYPE="dos" PARTLABEL="storage1" PARTUUID="7daf21c3-5024-4386-bd2d-30dcb6734ddd"


/etc/default/grub has lots of comments, but here are the uncommented lines:
Code:

GRUB_ENABLE_CRYPTODISK=y
GRUB_PRELOAD_MODULES="part_gpt lvm usb usb_keyboard ehci ohci uhci cryptodisk luks"
GRUB_TERMINAL_INPUT="usb_keyboard"
GRUB_DISTRIBUTOR="Gentoo"
GRUB_CMDLINE_LINUX="dolvm crypt_root=UUID="cba3f1f5-a4fa-4199-8377-e16d229fa1c9" root=UUID="f89b4582-0063-4f60-9952-58e9bb484850""
GRUB_DEFAULT=0

I added luks after reading your reply, as i did not notice it was available together with cryptodisk. I did regenerate grub-mkconfig after this.

Currrent grub.cfg:
Code:

#
# 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 part_gpt
insmod lvm
insmod usb
insmod usb_keyboard
insmod ehci
insmod ohci
insmod uhci
insmod cryptodisk
insmod luks
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=fi_FI@euro
  insmod gettext
fi
terminal_input usb_keyboard
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=5
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-/dev/mapper/acheronVG-acheronRoot' {
    load_video
    if [ "x$grub_platform" = xefi ]; then
        set gfxpayload=keep
    fi
    insmod gzio
    insmod part_gpt
    insmod ext2
    set root='hd1,gpt2'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275/(null)/sas/disk@0,gpt2' --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2  8af5dba4-764f-47fa-a68f-daec6a20fbdc
    else
      search --no-floppy --fs-uuid --set=root 8af5dba4-764f-47fa-a68f-daec6a20fbdc
    fi
    echo    'Ladataan Linux 4.19.52-gentoo kayttojarjestelmaydin ...'
    linux   /vmlinuz-4.19.52-gentoo root=/dev/mapper/acheronVG-acheronRoot ro dolvm crypt_root=UUID=cba3f1f5-a4fa-4199-8377-e16d229fa1c9 root=UUID=f89b4582-0063-4f60-9952-58e9bb484850
    echo    'Ladataan alustavaa ramlevya ...'
    initrd  /initramfs-genkernel-x86_64-4.19.52-gentoo
}
submenu 'Lisavalitsimet kohteelle "Gentoo GNU/Linux"' $menuentry_id_option 'gnulinux-advanced-/dev/mapper/acheronVG-acheronRoot' {
    menuentry 'Gentoo GNU/Linux, jakeluversiolla Linux 4.19.52-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.19.52-gentoo-advanced-/dev/mapper/acheronVG-acheronRoot' {
        load_video
        if [ "x$grub_platform" = xefi ]; then
            set gfxpayload=keep
        fi
        insmod gzio
        insmod part_gpt
        insmod ext2
        set root='hd1,gpt2'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275/(null)/sas/disk@0,gpt2' --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2  8af5dba4-764f-47fa-a68f-daec6a20fbdc
        else
          search --no-floppy --fs-uuid --set=root 8af5dba4-764f-47fa-a68f-daec6a20fbdc
        fi
        echo    'Ladataan Linux 4.19.52-gentoo kayttojarjestelmaydin ...'
        linux   /vmlinuz-4.19.52-gentoo root=/dev/mapper/acheronVG-acheronRoot ro dolvm crypt_root=UUID=cba3f1f5-a4fa-4199-8377-e16d229fa1c9 root=UUID=f89b4582-0063-4f60-9952-58e9bb484850
        echo    'Ladataan alustavaa ramlevya ...'
        initrd  /initramfs-genkernel-x86_64-4.19.52-gentoo
    }
    menuentry 'Gentoo GNU/Linux, jakeluversiolla Linux 4.19.52-gentoo (toipumistila)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.19.52-gentoo-recovery-/dev/mapper/acheronVG-acheronRoot' {
        load_video
        if [ "x$grub_platform" = xefi ]; then
            set gfxpayload=keep
        fi
        insmod gzio
        insmod part_gpt
        insmod ext2
        set root='hd1,gpt2'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275/(null)/sas/disk@0,gpt2' --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2  8af5dba4-764f-47fa-a68f-daec6a20fbdc
        else
          search --no-floppy --fs-uuid --set=root 8af5dba4-764f-47fa-a68f-daec6a20fbdc
        fi
        echo    'Ladataan Linux 4.19.52-gentoo kayttojarjestelmaydin ...'
        linux   /vmlinuz-4.19.52-gentoo root=/dev/mapper/acheronVG-acheronRoot ro single dolvm crypt_root=UUID=cba3f1f5-a4fa-4199-8377-e16d229fa1c9 root=UUID=f89b4582-0063-4f60-9952-58e9bb484850
        echo    'Ladataan alustavaa ramlevya ...'
        initrd  /initramfs-genkernel-x86_64-4.19.52-gentoo
    }
}
 
### 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 ###

Is that "--hint-efi=hd1,gpt2" line wrong? /boot/efi is on partition /dev/sdb1, not /dev/sdb2. Should I correct this somehow? I did try to press 'e' again at grub menu and change this to "hd1,gpt1" and pressed F10, and got the same result, disk "hd0,gpt2" not found.

Here is the efibootmgr I did not add to my previous post:
Code:

# efibootmgr -v
BootCurrent: 0002
Timeout: 1 seconds
BootOrder: 0001,0002,0000
Boot0000* Windows Boot Manager  VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...}................
Boot0001* gentoo    HD(1,GPT,69fbeb2d-57d5-46b7-9cbf-db97b64e83c6,0x800,0x64000)/File(\EFI\gentoo\grubx64.efi)
Boot0002* UEFI : USB : KingstonDT 101 G2 PMAP : PART 0 : OS Bootloader  PciRoot(0x0)/Pci(0x1,0x1)/Pci(0x0,0x0)/USB(3,0)/HD(1,MBR,0x5f8cc,0x800,0xec6800)..BO


Tried booting again, these above actions had no noticeable effect.

EDIT: forgot to answer this:
Quote:
You seem to have your /boot in one disk your efi in another and your / in another..
Is such complexity absolutely essential?

Aim is to have the whole M.2 SSD encrypted, and use the USB stick containing /boot and /boot/efi as sort of a key to boot the machine. I thought this was the easier approach, but maybe I was wrong. I do not however think this isn't a possible setup. I guess /boot and /boot/efi could be on the same fat formatted partition too, but some guides suggested to make it this way, so I did (, although those discussed migrating from bios to efi).
Back to top
View user's profile Send private message
alamahant
Tux's lil' helper
Tux's lil' helper


Joined: 23 Mar 2019
Posts: 92

PostPosted: Sat Aug 03, 2019 2:56 pm    Post subject: Reply with quote

Have you installed lvm2 and dosfstools ?
Try to do efibootmgr -n 0001 && reboot
Back to top
View user's profile Send private message
TheTapsaFi
n00b
n00b


Joined: 02 Aug 2019
Posts: 7

PostPosted: Sat Aug 03, 2019 3:56 pm    Post subject: Reply with quote

Both are installed:
Code:

# emerge --search sys-fs/dosfstools
 
[ Results for search key : sys-fs/dosfstools ]
Searching...
 
*  sys-fs/dosfstools
      Latest version available: 4.1
      Latest version installed: 4.1
      Size of files: 169 KiB
      Homepage:      https://github.com/dosfstools/dosfstools
      Description:   DOS filesystem tools - provides mkdosfs, mkfs.msdos, mkfs.vfat
      License:       GPL-3
 
[ Applications found : 1 ]
 
# emerge --search sys-fs/lvm2
 
[ Results for search key : sys-fs/lvm2 ]
Searching...
 
*  sys-fs/lvm2
      Latest version available: 2.02.184-r4
      Latest version installed: 2.02.184-r4
      Size of files: 2 328 KiB
      Homepage:      https://sourceware.org/lvm2/
      Description:   User-land utilities for LVM2 (device-mapper) software
      License:       GPL-2
 
[ Applications found : 1 ]


Parted says the following about the usb stick that is supposed to boot:
Code:

Model: Kingston DataTraveler 2.0 (scsi)
Disk /dev/sdb: 7807MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
 
Number  Start   End     Size    File system  Name      Flags
 1      1049kB  211MB   210MB   fat32        efi       boot, esp
 2      211MB   840MB   629MB   ext4         boot
 3      4138MB  7807MB  3669MB  ntfs         storage1  msftdata


Tried rebooting after efibootmgr command, no effect, the exact same result. "Gentoo" option is visible in UEFI menu, and grub does load the menuentries, and corresponding configs, but then gives error about hd0. Feels like grub is thinking it resides on hd0,gpt2, even though it is on hd1, gpt 1 or 2? I'm not sure if it installs on the /boot/efi partition or the other, mounted on /boot.(?)
Back to top
View user's profile Send private message
GDH-gentoo
n00b
n00b


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

PostPosted: Sat Aug 03, 2019 6:29 pm    Post subject: Reply with quote

TheTapsaFi wrote:
Maybe my question is either too obvious, has insufficient information, or too difficult. Knowing which it is would also help. ^^

The last alternative probably :) GRUB has documentation, but I find it rather lacking in some aspects. If GRUB is loading and presenting the menu, then the UEFI firmware at least knows how to handle booting from the USB stick and handing control to GRUB. So I wouldn't mess any more with efibootmgr. Instead, assuming you are able to make changes to grub.cfg and try booting afterwards, I'd comment out some of the insmod commands and commands that depend on that. I'll post a suggestion later. In the meantime, can we see your whole /etc/default/grub?


Last edited by GDH-gentoo on Sat Aug 03, 2019 10:36 pm; edited 3 times in total
Back to top
View user's profile Send private message
TheTapsaFi
n00b
n00b


Joined: 02 Aug 2019
Posts: 7

PostPosted: Sat Aug 03, 2019 6:30 pm    Post subject: Reply with quote

I do not have any other ESPs.
My hard drive, M.2 SSD, /dev/nvme0n1, is completely encrypted.

Parted:
Code:

Error: /dev/nvme0n1: unrecognised disk label
Model: Unknown (unknown)                                                 
Disk /dev/nvme0n1: 256GB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:


It has only one physical volume in it, containing one volumegroup, with three logical volumes, one of which is the root, as you've seen above in blkid.

Removing the encryption, recreating the physical volume to allow for another partitions for /boot and /boot/efi, and reinstalling grub on the /dev/nvme0n1 sounds like a massive amount of work, and would probably mean I would have to do all of the work so far again, only to then start the work yet again to work towards the setup I wanted, which I have described, if it worked. I'm not very willing to do this yet.
Also I do think grub should at least see some disks, like the one it itself is installed on, when "ls -l" is input from the command line, or at least halt when given the command, instead of giving error about some unknown disk to almost every command.
I might try to install grub on some other usb stick though.
But I'll try the grub install with recheck first.
Back to top
View user's profile Send private message
TheTapsaFi
n00b
n00b


Joined: 02 Aug 2019
Posts: 7

PostPosted: Sat Aug 03, 2019 7:12 pm    Post subject: Reply with quote

Oh, did not notice your post GDH-gentoo. Thanks for replying though!
I'll hold on with the grub reinstall for a bit then.

Here you go,
Code:

# cat /etc/default/grub
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
#
# 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_ENABLE_CRYPTODISK=y
GRUB_PRELOAD_MODULES="part_gpt lvm usb usb_keyboard ehci ohci uhci cryptodisk luks"
GRUB_TERMINAL_INPUT="usb_keyboard"
GRUB_DISTRIBUTOR="Gentoo"
GRUB_CMDLINE_LINUX="dolvm crypt_root=UUID="cba3f1f5-a4fa-4199-8377-e16d229fa1c9" root=UUID="f89b4582-0063-4f60-9952-58e9bb484850""

# Default menu entry
GRUB_DEFAULT=0

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

# Append parameters to the linux kernel command line
#GRUB_CMDLINE_LINUX=""
#
# 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

# 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"

Back to top
View user's profile Send private message
GDH-gentoo
n00b
n00b


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

PostPosted: Sat Aug 03, 2019 7:53 pm    Post subject: Reply with quote

TheTapsaFi wrote:
Code:

GRUB_ENABLE_CRYPTODISK=y
GRUB_PRELOAD_MODULES="part_gpt lvm usb usb_keyboard ehci ohci uhci cryptodisk luks"
GRUB_TERMINAL_INPUT="usb_keyboard"

All right. Let's try this. Comment GRUB_ENABLE_CRYPTODISK and GRUB_TERMINAL_INPUT, and change GRUB_PRELOAD_MODULES to just:

Code:
GRUB_PRELOAD_MODULES="part_gpt"

I'm not sure if part_gpt is even needed, but I don't think it hurts leaving it there either. I suppose you handle LVM and LUKS in the initramfs (initramfs-genkernel-x86_64-4.19.52-gentoo, right?), i.e. after GRUB has handed control to the kernel, so I don't think lvm, cryptodisk and luks are needed. And leaving the USB stuff out is what I'd want to know the effect of.

Regenerate grub.cfg and try to boot again. If you are still able to get to the menu, press 'c' to get to GRUB's console, and tell us what does the ls command do now.
Back to top
View user's profile Send private message
TheTapsaFi
n00b
n00b


Joined: 02 Aug 2019
Posts: 7

PostPosted: Sat Aug 03, 2019 8:45 pm    Post subject: Reply with quote

You are correct, initramfs-genkernel-x86_64-4.19.52-gentoo was created with:
Code:
genkernel --luks --lvm --keymap --firmware --install initramfs


Here is the /etc/default/grub lines that are uncommented now:
Code:

GRUB_PRELOAD_MODULES="part_gpt"
GRUB_DISTRIBUTOR="Gentoo"
GRUB_CMDLINE_LINUX="dolvm crypt_root=UUID="cba3f1f5-a4fa-4199-8377-e16d229fa1c9" root=UUID="f89b4582-0063-4f60-9952-58e9bb484850""
GRUB_DEFAULT=0


rerunning grub-mkconfig:
Code:

# grub-mkconfig -o /boot/grub/grub.cfg
Tuottaa grub-asetustiedoston ...
Linux-levykuva loytyi: /boot/vmlinuz-4.19.52-gentoo
Loytyi initrd-levykuva: /boot/initramfs-genkernel-x86_64-4.19.52-gentoo
valmis

(Sorry for some finnish. Ready, no errors, found that linux image, and that initrd.)

Resulting grub.cfg in its entirety:
Code:

# 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 part_gpt
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=fi_FI@euro
  insmod gettext
fi
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=5
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-/dev/mapper/acheronVG-acheronRoot' {
    load_video
    if [ "x$grub_platform" = xefi ]; then
        set gfxpayload=keep
    fi
    insmod gzio
    insmod part_gpt
    insmod ext2
    set root='hd0,gpt2'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275/(null)/sas/disk@0,gpt2' --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  8af5dba4-764f-47fa-a68f-daec6a20fbdc
    else
      search --no-floppy --fs-uuid --set=root 8af5dba4-764f-47fa-a68f-daec6a20fbdc
    fi
    echo    'Ladataan Linux 4.19.52-gentoo kayttojarjestelmaydin ...'
    linux   /vmlinuz-4.19.52-gentoo root=/dev/mapper/acheronVG-acheronRoot ro dolvm crypt_root=UUID=cba3f1f5-a4fa-4199-8377-e16d229fa1c9 root=UUID=f89b4582-0063-4f60-9952-58e9bb484850
    echo    'Ladataan alustavaa ramlevya ...'
    initrd  /initramfs-genkernel-x86_64-4.19.52-gentoo
}
submenu 'Lisavalitsimet kohteelle "Gentoo GNU/Linux"' $menuentry_id_option 'gnulinux-advanced-/dev/mapper/acheronVG-acheronRoot' {
    menuentry 'Gentoo GNU/Linux, jakeluversiolla Linux 4.19.52-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.19.52-gentoo-advanced-/dev/mapper/acheronVG-acheronRoot' {
        load_video
        if [ "x$grub_platform" = xefi ]; then
            set gfxpayload=keep
        fi
        insmod gzio
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt2'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275/(null)/sas/disk@0,gpt2' --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  8af5dba4-764f-47fa-a68f-daec6a20fbdc
        else
          search --no-floppy --fs-uuid --set=root 8af5dba4-764f-47fa-a68f-daec6a20fbdc
        fi
        echo    'Ladataan Linux 4.19.52-gentoo kayttojarjestelmaydin ...'
        linux   /vmlinuz-4.19.52-gentoo root=/dev/mapper/acheronVG-acheronRoot ro dolvm crypt_root=UUID=cba3f1f5-a4fa-4199-8377-e16d229fa1c9 root=UUID=f89b4582-0063-4f60-9952-58e9bb484850
        echo    'Ladataan alustavaa ramlevya ...'
        initrd  /initramfs-genkernel-x86_64-4.19.52-gentoo
    }
    menuentry 'Gentoo GNU/Linux, jakeluversiolla Linux 4.19.52-gentoo (toipumistila)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.19.52-gentoo-recovery-/dev/mapper/acheronVG-acheronRoot' {
        load_video
        if [ "x$grub_platform" = xefi ]; then
            set gfxpayload=keep
        fi
        insmod gzio
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt2'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275/(null)/sas/disk@0,gpt2' --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  8af5dba4-764f-47fa-a68f-daec6a20fbdc
        else
          search --no-floppy --fs-uuid --set=root 8af5dba4-764f-47fa-a68f-daec6a20fbdc
        fi
        echo    'Ladataan Linux 4.19.52-gentoo kayttojarjestelmaydin ...'
        linux   /vmlinuz-4.19.52-gentoo root=/dev/mapper/acheronVG-acheronRoot ro single dolvm crypt_root=UUID=cba3f1f5-a4fa-4199-8377-e16d229fa1c9 root=UUID=f89b4582-0063-4f60-9952-58e9bb484850
        echo    'Ladataan alustavaa ramlevya ...'
        initrd  /initramfs-genkernel-x86_64-4.19.52-gentoo
    }
}
 
### 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 ###


Tried booting it... success(!), but maybe it was a fluke, so I retry... and SUCCESS again!!! Who knew insmod'ing absolutely every module under the sun would cause issues instead of repairing them. ;)
Some other issues still, but that's expected with Gentoo. Endless source of joy & problems, like having a second spouse.

Thanks a ton GDH-gentoo and alamahant ! Made a small donation to Gentoo foundation in celebration of this first solved issue of mine thanks to you. I'll see if I find out how to mark this solved.
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