Grub behaviour differs from grub.cfg

I am dual booting manjaro and fedora using grub as my bootloader. I had LUKS encryption on my manjaro partition which I’ve removed today, after which on boot I receive a “cryptodisk/luks-…: no such disk” error, which then kicks me into the grub rescue shell. I’ve purged all mention of the cryptodisk from my configuration files, including mkinitcpio.conf, fstab, crypttab and grub.cfg. I’ve done this on both distros too, so I can’t work out why grub is still trying to mount the encrypted partitions. When I manually boot manjaro, the encrypt and opencrypt hooks still run (despite not being listed in the hooks for my mkinitcpio.conf)…

Here is my grub.cfg from manjaro.
Thanks for the help

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

set menu_color_normal=light-gray/black
set menu_color_highlight=green/black

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root eb7ab5ef-5a39-443b-bafd-2105cf5ba628
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_GB
  insmod gettext
fi
terminal_input console
terminal_output gfxterm
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root eb7ab5ef-5a39-443b-bafd-2105cf5ba628
insmod gfxmenu
loadfont ($root)/usr/share/grub/themes/manjaro/dejavu_sans_12.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/dejavu_sans_14.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/dejavu_sans_16.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/dejavu_sans_24.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/dejavu_sans_48.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/dejavu_sans_bold_16.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/dejavu_sans_mono_12.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/terminus-12.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/terminus-14.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/terminus-16.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/terminus-18.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/terminus-b12.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/terminus-b14.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/terminus-b16.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/terminus-b18.pf2
insmod png
set theme=($root)/usr/share/grub/themes/manjaro/theme.txt
export theme
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 'Manjaro Linux' --class manjaro --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-eb7ab5ef-5a39-443b-bafd-2105cf5ba628' {
        savedefault
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt
        insmod ext2
        search --no-floppy --fs-uuid --set=root eb7ab5ef-5a39-443b-bafd-2105cf5ba628
        linux   /boot/vmlinuz-5.15-rt-x86_64 root=UUID=eb7ab5ef-5a39-443b-bafd-2105cf5ba628 rw  root=/dev/nvme0n1p2
        initrd  /boot/intel-ucode.img /boot/initramfs-5.15-rt-x86_64.img
}
submenu 'Advanced options for Manjaro Linux' $menuentry_id_option 'gnulinux-advanced-eb7ab5ef-5a39-443b-bafd-2105cf5ba628' {
        menuentry 'Manjaro Linux (Kernel: 5.15.27-rt35-1-MANJARO x64)' --class manjaro --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.15.27-rt35-1-MANJARO x64-advanced-eb7ab5ef-5a39-443b-bafd-2105cf5ba628' {
        savedefault
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod ext2
                search --no-floppy --fs-uuid --set=root eb7ab5ef-5a39-443b-bafd-2105cf5ba628
                linux   /boot/vmlinuz-5.15-rt-x86_64 root=UUID=eb7ab5ef-5a39-443b-bafd-2105cf5ba628 rw  root=/dev/nvme0n1p2
                initrd  /boot/intel-ucode.img /boot/initramfs-5.15-rt-x86_64.img
        }
        menuentry 'Manjaro Linux (Kernel: 5.15.27-rt35-1-MANJARO x64 - fallback initramfs)' --class manjaro --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.15.27-rt35-1-MANJARO x64-fallback-eb7ab5ef-5a39-443b-bafd-2105cf5ba628' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod ext2
                search --no-floppy --fs-uuid --set=root eb7ab5ef-5a39-443b-bafd-2105cf5ba628
                linux   /boot/vmlinuz-5.15-rt-x86_64 root=UUID=eb7ab5ef-5a39-443b-bafd-2105cf5ba628 rw  root=/dev/nvme0n1p2
                initrd  /boot/initramfs-5.15-rt-x86_64-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 'Fedora Linux 35 (KDE Plasma) (on /dev/nvme0n1p5)' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-63abe411-58b0-4794-9679-c670f07e1e2d' {
        savedefault
        insmod part_gpt
        insmod ext2
        search --no-floppy --fs-uuid --set=root 63abe411-58b0-4794-9679-c670f07e1e2d
        linux /boot/vmlinuz-0-rescue-8b96f5d1567d41578c39a64a7443d1eb root=/dev/nvme0n1p5
        initrd /boot/initramfs-0-rescue-8b96f5d1567d41578c39a64a7443d1eb.img
}
submenu 'Advanced options for Fedora Linux 35 (KDE Plasma) (on /dev/nvme0n1p5)' $menuentry_id_option 'osprober-gnulinux-advanced-63abe411-58b0-4794-9679-c670f07e1e2d' {
        menuentry 'Fedora Linux 35 (KDE Plasma) (on /dev/nvme0n1p5)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-0-rescue-8b96f5d1567d41578c39a64a7443d1eb--63abe411-58b0-4794-9679-c670f07e1e2d' {
                savedefault
                insmod part_gpt
                insmod ext2
                search --no-floppy --fs-uuid --set=root 63abe411-58b0-4794-9679-c670f07e1e2d
                linux /boot/vmlinuz-0-rescue-8b96f5d1567d41578c39a64a7443d1eb root=/dev/nvme0n1p5
                initrd /boot/initramfs-0-rescue-8b96f5d1567d41578c39a64a7443d1eb.img
        }
        menuentry 'Fedora Linux 35 (KDE Plasma) (on /dev/nvme0n1p5)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-5.14.10-300.fc35.x86_64--63abe411-58b0-4794-9679-c670f07e1e2d' {
                savedefault
                insmod part_gpt
                insmod ext2
                search --no-floppy --fs-uuid --set=root 63abe411-58b0-4794-9679-c670f07e1e2d
                linux /boot/vmlinuz-5.14.10-300.fc35.x86_64 root=/dev/nvme0n1p5
                initrd /boot/initramfs-5.14.10-300.fc35.x86_64.img
        }
        menuentry 'Fedora Linux 35 (KDE Plasma) (on /dev/nvme0n1p5)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-5.17.11-200.fc35.x86_64--63abe411-58b0-4794-9679-c670f07e1e2d' {
                savedefault
                insmod part_gpt
                insmod ext2
                search --no-floppy --fs-uuid --set=root 63abe411-58b0-4794-9679-c670f07e1e2d
                linux /boot/vmlinuz-5.17.11-200.fc35.x86_64 root=/dev/nvme0n1p5
                initrd /boot/initramfs-5.17.11-200.fc35.x86_64.img
        }
        menuentry 'Fedora Linux 35 (KDE Plasma) (on /dev/nvme0n1p5)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-5.17.7-200.fc35.x86_64--63abe411-58b0-4794-9679-c670f07e1e2d' {
                savedefault
                insmod part_gpt
                insmod ext2
                search --no-floppy --fs-uuid --set=root 63abe411-58b0-4794-9679-c670f07e1e2d
                linux /boot/vmlinuz-5.17.7-200.fc35.x86_64 root=/dev/nvme0n1p5
                initrd /boot/initramfs-5.17.7-200.fc35.x86_64.img
        }
}

set timeout_style=menu
if [ "${timeout}" = 0 ]; then
  set timeout=10
fi
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
### 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.
#menuentry "Fedora Bootloader" {
#       insmod chain
#       if [ x$feature_platform_search_hint = xy ]; then
#               search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 63abe411-58b0-4794-9679-c670f07e1e2d
#       else
#               search --no-floppy --fs-uuid --set=root 63abe411-58b0-4794-9679-c670f07e1e2d
#       fi
#       configfile /boot/grub2/grub.cfg
#}
### 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 ###

### BEGIN /etc/grub.d/60_memtest86+ ###
if [ "${grub_platform}" == "pc" ]; then
    menuentry "Memory Tester (memtest86+)" --class memtest86 --class gnu --class tool {
        search --fs-uuid --no-floppy --set=root  eb7ab5ef-5a39-443b-bafd-2105cf5ba628
        linux16 /boot/memtest86+/memtest.bin 
    }
fi
### END /etc/grub.d/60_memtest86+ ###

You most likely did not run:
sudo mkinitcpio -P
and
sudo update-grub
After you modified the files.

Thanks for the help, mkinitcpio -P seems to have fixed the issue with the encrypt/opencrypt hooks, however I’m still having issues with grub on boot. I’m going to try and reinstall the bootloader using a live install and go from there :slight_smile:

That file is modified by update-grub you should edit /etc/default/grub.

1 Like