# [Solved] Grub not finding new kernel

## Gooberpatrol66

The new kernel isn't appearing in the boot menu even though I can see it in /boot. I have run genkernel --install and grub-mkconfig several times.Last edited by Gooberpatrol66 on Sat Mar 16, 2019 2:31 am; edited 1 time in total

----------

## fedeliallalinea

You have mounted boot before make install? You can post the content of /boot?

----------

## Verdazil

 *Gooberpatrol66 wrote:*   

> The new kernel isn't appearing in the boot menu even though I can see it in /boot. I have run genkernel --install and grub-mkconfig several times.

 

1. Make sure the boot partition is mounted.

```
# df -h
```

2. Sometimes you need to remount before writing the configuration file grub.cfg:

```
# mount -o remount,rw /sys/firmware/efi/efivars
```

----------

## eccerr0r

Also, did grub-mkconfig find your new kernel?

----------

## Marlo

 *Gooberpatrol66 wrote:*   

> The new kernel isn't appearing in the boot menu even though I can see it in /boot. I have run genkernel --install and grub-mkconfig several times.

 

Gooberpatrol66,

Genkernel comes with a very well documented /etc/genkernel.conf.

In this config you can adjust everything you need.

For example:

```

# Should we install to $BOOTDIR?  Default is "no" because genkernel is used in

# catalyst and stage building.

INSTALL="yes"
```

```

# Mount BOOTDIR automatically if it isn't mounted?

MOUNTBOOT="yes"
```

```

# Make symlinks in BOOTDIR automatically?

#SYMLINK="no"

SYMLINK="yes"

```

You don`t need the extra command "grub-mkconfig". This can be done by genkernel alone if you have the right configuration.

```

# Add new kernel to grub?

BOOTLOADER="grub2"

```

```

# Set the boot directory, default is /boot

BOOTDIR="/boot"

```

And many other settings.

So read exactly the /etc/genkernel.conf and make the necessary settings.

greetings

Ma

----------

## Gooberpatrol66

 *fedeliallalinea wrote:*   

> You have mounted boot before make install? You can post the content of /boot?

 

```
gentooserver /home/nathan # ls /boot

grub                                       kernel-genkernel-x86_64-4.14.83-gentoo      System.map-genkernel-x86_64-4.19.23-gentoo

initramfs-genkernel-x86_64-4.14.83-gentoo  kernel-genkernel-x86_64-4.19.23-gentoo

initramfs-genkernel-x86_64-4.19.23-gentoo  System.map-genkernel-x86_64-4.14.83-gentoo
```

 *Quote:*   

> 
> 
> Also, did grub-mkconfig find your new kernel?

 

```

gentooserver /home/nathan # grub-mkconfig -o /boot/grub/grub.cfg

Generating grub configuration file ...

Found linux image: /boot/kernel-genkernel-x86_64-4.19.23-gentoo

Found initrd image: /boot/initramfs-genkernel-x86_64-4.19.23-gentoo

Found linux image: /boot/kernel-genkernel-x86_64-4.14.83-gentoo

Found initrd image: /boot/initramfs-genkernel-x86_64-4.14.83-gentoo

done
```

----------

## Gooberpatrol66

Is there a way to look at the contents of the boot menu without rebooting? This is a remote machine and it's inconvenient to keep rebooting it.

----------

## eccerr0r

The stuff it prints out when running grub-mkconfig should be the options that it will present next boot.  Of course you can just view the contents of the file.

Perhaps the new config file is being written to the wrong place?

----------

## Gooberpatrol66

This is bizarre. I can see menuentries for the new kernel in /boot/grub/grub.cfg, even though they aren't showing up in the boot menu.

```
menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-a782a62a-ffde-49b1-a680-0afeb9cdab0b' {

        load_video

        set gfxpayload=keep

        insmod gzio

        insmod part_gpt

        insmod btrfs

        set root='hd0,gpt3'

        if [ x$feature_platform_search_hint = xy ]; then

          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt3 --hint-efi=hd0,gpt3 --hint-baremetal=ahci0,gpt3  a782a62a-ffde-49b1-a680-0afeb9cdab0b

        else

          search --no-floppy --fs-uuid --set=root a782a62a-ffde-49b1-a680-0afeb9cdab0b

        fi

        echo    'Loading Linux x86_64-4.19.23-gentoo ...'

        linux   /boot/kernel-genkernel-x86_64-4.19.23-gentoo root=UUID=a782a62a-ffde-49b1-a680-0afeb9cdab0b ro init=/usr/lib/systemd/systemd 

        echo    'Loading initial ramdisk ...'

        initrd  /boot/initramfs-genkernel-x86_64-4.19.23-gentoo

}
```

```
menuentry 'Gentoo GNU/Linux, with Linux x86_64-4.19.23-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-4.19.23-gentoo-advanced-a782a62a-ffde-49b1-a680-0afeb9cdab0b' {

                load_video

                set gfxpayload=keep

                insmod gzio

                insmod part_gpt

                insmod btrfs

                set root='hd0,gpt3'

                if [ x$feature_platform_search_hint = xy ]; then

                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt3 --hint-efi=hd0,gpt3 --hint-baremetal=ahci0,gpt3  a782a62a-ffde-49b1-a680-0afeb9cdab0b

                else

                  search --no-floppy --fs-uuid --set=root a782a62a-ffde-49b1-a680-0afeb9cdab0b

                fi

                echo    'Loading Linux x86_64-4.19.23-gentoo ...'

                linux   /boot/kernel-genkernel-x86_64-4.19.23-gentoo root=UUID=a782a62a-ffde-49b1-a680-0afeb9cdab0b ro init=/usr/lib/systemd/systemd 

                echo    'Loading initial ramdisk ...'

                initrd  /boot/initramfs-genkernel-x86_64-4.19.23-gentoo

        }

        menuentry 'Gentoo GNU/Linux, with Linux x86_64-4.19.23-gentoo (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-4.19.23-gentoo-recovery-a782a62a-ffde-49b1-a680-0afeb9cdab0b' {

                load_video

                set gfxpayload=keep

                insmod gzio

                insmod part_gpt

                insmod btrfs

                set root='hd0,gpt3'

                if [ x$feature_platform_search_hint = xy ]; then

                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt3 --hint-efi=hd0,gpt3 --hint-baremetal=ahci0,gpt3  a782a62a-ffde-49b1-a680-0afeb9cdab0b

                else

                  search --no-floppy --fs-uuid --set=root a782a62a-ffde-49b1-a680-0afeb9cdab0b

                fi

                echo    'Loading Linux x86_64-4.19.23-gentoo ...'

                linux   /boot/kernel-genkernel-x86_64-4.19.23-gentoo root=UUID=a782a62a-ffde-49b1-a680-0afeb9cdab0b ro single init=/usr/lib/systemd/systemd

                echo    'Loading initial ramdisk ...'

                initrd  /boot/initramfs-genkernel-x86_64-4.19.23-gentoo

        }
```

----------

## eccerr0r

Ensure you're checking the right file.  Make sure your boot partition is mounted and you're not looking at a phantom file.

----------

## Gooberpatrol66

Alright, so grub was booting into my old /boot partition, i guess cause it was a valid EFI partition. I wiped it and mounted it under the new /boot, ran grub-install again, and it works now. I thought it wouldn't matter because I have EFI disabled in the BIOS, but whatever.

Solved.

----------

