You are not logged in.

#1 2021-09-19 15:44:18

lukascobbler
Member
Registered: 2021-09-19
Posts: 3

Grub not detecting other Linux kernels

Hello,

I have problems with GRUB detecting the Gentoo system. When I run the os-prober command, it finds the system which is on another drive.
However, when I run grub-mkconfig, it doesn't print the submenu for the Gentoo system/kernel. On the GRUB page, it says that I need to mount the system (it doesn't say where so I mount it to /mnt and /mnt/boot) before running the command.
When I do that, grub-mkconfig detects the submenu for Gentoo but when I actually boot into GRUB and select Gentoo, I get an error message that the kernel is not found.

I have GRUB installed on the Gentoo system as well.

Offline

#2 2021-09-19 15:47:13

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,840

Re: Grub not detecting other Linux kernels

Post your /boot/grub/grub.cfg and

lsblk -f

with the relevant partitions mounted in code tags: https://bbs.archlinux.org/help.php#bbcode

As for os-prober did you make sure to enable the use of os-prober in /etc/default/grub as the warning grub-mkconfig prints out informs you?

Offline

#3 2021-09-19 15:55:47

lukascobbler
Member
Registered: 2021-09-19
Posts: 3

Re: Grub not detecting other Linux kernels

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
insmod part_msdos
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="${saved_entry}"
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 [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root 226e644e-b48d-43e8-8275-9acdc5a37cf4
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
fi
terminal_input console
terminal_output gfxterm
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1  578b83c1-40ce-41a3-880e-17a094f3bcd5
else
  search --no-floppy --fs-uuid --set=root 578b83c1-40ce-41a3-880e-17a094f3bcd5
fi
insmod jpeg
background_image -m stretch /luka/Podaci/Backup11/wallpapers/beautiful-sea-coast-hd.jpg
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 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-226e644e-b48d-43e8-8275-9acdc5a37cf4' {
        savedefault
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt
        insmod ext2
        search --no-floppy --fs-uuid --set=root 226e644e-b48d-43e8-8275-9acdc5a37cf4
        echo    'Loading Linux linux-lts ...'
        linux   /boot/vmlinuz-linux-lts root=UUID=226e644e-b48d-43e8-8275-9acdc5a37cf4 rw  loglevel=3 intel_iommu=on
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initramfs-linux-lts.img
}
submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-226e644e-b48d-43e8-8275-9acdc5a37cf4' {
        menuentry 'Arch Linux, with Linux linux-lts' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-lts-advanced-226e644e-b48d-43e8-8275-9acdc5a37cf4' {
        savedefault
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod ext2
                search --no-floppy --fs-uuid --set=root 226e644e-b48d-43e8-8275-9acdc5a37cf4
                echo    'Loading Linux linux-lts ...'
                linux   /boot/vmlinuz-linux-lts root=UUID=226e644e-b48d-43e8-8275-9acdc5a37cf4 rw  loglevel=3 intel_iommu=on
                echo    'Loading initial ramdisk ...'
                initrd  /boot/initramfs-linux-lts.img
        }
        menuentry 'Arch Linux, with Linux linux-lts (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-lts-fallback-226e644e-b48d-43e8-8275-9acdc5a37cf4' {
        savedefault
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod ext2
                search --no-floppy --fs-uuid --set=root 226e644e-b48d-43e8-8275-9acdc5a37cf4
                echo    'Loading Linux linux-lts ...'
                linux   /boot/vmlinuz-linux-lts root=UUID=226e644e-b48d-43e8-8275-9acdc5a37cf4 rw  loglevel=3 intel_iommu=on
                echo    'Loading initial ramdisk ...'
                initrd  /boot/initramfs-linux-lts-fallback.img
        }
        menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-226e644e-b48d-43e8-8275-9acdc5a37cf4' {
        savedefault
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod ext2
                search --no-floppy --fs-uuid --set=root 226e644e-b48d-43e8-8275-9acdc5a37cf4
                echo    'Loading Linux linux ...'
                linux   /boot/vmlinuz-linux root=UUID=226e644e-b48d-43e8-8275-9acdc5a37cf4 rw  loglevel=3 intel_iommu=on
                echo    'Loading initial ramdisk ...'
                initrd  /boot/initramfs-linux.img
        }
        menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-226e644e-b48d-43e8-8275-9acdc5a37cf4' {
        savedefault
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod ext2
                search --no-floppy --fs-uuid --set=root 226e644e-b48d-43e8-8275-9acdc5a37cf4
                echo    'Loading Linux linux ...'
                linux   /boot/vmlinuz-linux root=UUID=226e644e-b48d-43e8-8275-9acdc5a37cf4 rw  loglevel=3 intel_iommu=on
                echo    'Loading initial ramdisk ...'
                initrd  /boot/initramfs-linux-fallback.img
        }
}

### 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 ###
menuentry 'Gentoo/Linux (on /dev/sdb2)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-be692d3c-80e7-43c0-a1d0-060f81ace1a3' {
        savedefault
        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-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2  be692d3c-80e7-43c0-a1d0-060f81ace1a3
        else
          search --no-floppy --fs-uuid --set=root be692d3c-80e7-43c0-a1d0-060f81ace1a3
        fi
        linux /boot/vmlinuz-5.10.61-gentoo root=/dev/sdb2
        initrd /boot/initramfs-5.10.61-gentoo.img
}
submenu 'Advanced options for Gentoo/Linux (on /dev/sdb2)' $menuentry_id_option 'osprober-gnulinux-advanced-be692d3c-80e7-43c0-a1d0-060f81ace1a3' {
        menuentry 'Gentoo/Linux (on /dev/sdb2)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-5.10.61-gentoo--be692d3c-80e7-43c0-a1d0-060f81ace1a3' {
                savedefault
                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-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2  be692d3c-80e7-43c0-a1d0-060f81ace1a3
                else
                  search --no-floppy --fs-uuid --set=root be692d3c-80e7-43c0-a1d0-060f81ace1a3
                fi
                linux /boot/vmlinuz-5.10.61-gentoo root=/dev/sdb2
                initrd /boot/initramfs-5.10.61-gentoo.img
        }
        menuentry 'Gentoo/Linux (on /dev/sdb2)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-5.10.61-gentoo.old--be692d3c-80e7-43c0-a1d0-060f81ace1a3' {
                savedefault
                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-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2  be692d3c-80e7-43c0-a1d0-060f81ace1a3
                else
                  search --no-floppy --fs-uuid --set=root be692d3c-80e7-43c0-a1d0-060f81ace1a3
                fi
                linux /boot/vmlinuz-5.10.61-gentoo.old root=/dev/sdb2
        }
}

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

### BEGIN /etc/grub.d/30_uefi-firmware ###
menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {
        fwsetup
}
### END /etc/grub.d/30_uefi-firmware ###

### 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 ###
lsblk -f:
sda                                                                                
|-sda1      ext4   1.0         578b83c1-40ce-41a3-880e-17a094f3bcd5  103.5G    74% /home
`-sda2      ext4   1.0         fe6a0075-812d-4b25-973d-a1ae5b03ccbe    221G    43% /opt
                                                                                   /app_hdd
sdb                                                                                
|-sdb1      vfat   FAT32       66E0-7474                             973.4M     5% /mnt/boot
`-sdb2      ext4   1.0         be692d3c-80e7-43c0-a1d0-060f81ace1a3  409.5G     1% /mnt
sdc                                                                                
`-sdc1      ext4   1.0         4acbb951-0bdd-4c26-aaf7-bc024fb4bf16                
nvme0n1                                                                            
|-nvme0n1p1 vfat   FAT32       9B94-FF88                                 2G     1% /boot/EFI
|-nvme0n1p2 swap   1           ec3f8e0b-4d52-42dc-884d-e2be58a605f4                [SWAP]
`-nvme0n1p3 ext4   1.0         226e644e-b48d-43e8-8275-9acdc5a37cf4  183.9G    12% /

Also, I did enable os prober in the /etc/defaults/grub

Offline

#4 2021-09-19 17:07:04

lukascobbler
Member
Registered: 2021-09-19
Posts: 3

Re: Grub not detecting other Linux kernels

Hello,

I have fixed the problem by mounting the boot partition of Gentoo to /mnt instead of mounting the root Gentoo on /mnt and boot of Gentoo on /mnt/boot.

Offline

Board footer

Powered by FluxBB