Submenu in Grub

If you have multiple kernels installed, say linux and linux-lts, by default grub-mkconfig groups them in a submenu.

https://wiki.archlinux.org/index.php/GRUB/Tips_and_tricks

As I read the quote - I may be wrong - a requirement for GRUB to use submenu is that you have more than one kernel installed.

So - say - you install the mainline and LTS or zen - then GRUB will default show a submenu with the items found and only display the primary boot entry - usually the kernel with the highest number.

1 Like

Obviously this is not the case, because I have already installed 2 kernels: Mainline & LTS and there is NO submenu displayed.

Hmm. I just experimented - and it works on a default eos install

Screenshot

endeavour-nix-grub

2 Likes

strange …

Is it - by any chance - a converted Manjaro?

And sorry - not quite default - but I don’t know if it matters - wait a minute - testing

/etc/default/grub
# GRUB boot loader configuration

GRUB_DEFAULT="saved"
GRUB_SAVE_DEFAULT="true"
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR="EndeavourOS"
GRUB_CMDLINE_LINUX_DEFAULT="quiet loglevel=3 nowatchdog"
GRUB_CMDLINE_LINUX=""

# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"

# Uncomment to enable booting from LUKS encrypted devices
#GRUB_ENABLE_CRYPTODISK=y

# Set to 'countdown' or 'hidden' to change timeout behavior,
# press ESC key to display menu.
GRUB_TIMEOUT_STYLE=menu

# Uncomment to use basic console
GRUB_TERMINAL_INPUT=console

# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT=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="1152x864 auto"

# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX=keep

# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"
#GRUB_DISABLE_LINUX_UUID=true

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

# Uncomment and set to the desired menu colors.  Used by normal and wallpaper
# modes only.  Entries specified as foreground/background.
#GRUB_COLOR_NORMAL="light-blue/black"
#GRUB_COLOR_HIGHLIGHT="light-cyan/blue"

# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/path/to/wallpaper"
#GRUB_THEME=/boot/grub/themes/EndeavourOS/theme.txt
GRUB_THEME=/usr/share/grub/themes/endeavouros-nix/theme.txt


# Uncomment to get a beep at GRUB start
#GRUB_INIT_TUNE="480 440 1"

It is certainly not a converted Manjaro, I reinstalled it yesterday (online).

sorry - no offense :slight_smile:

just changed to these lines - and it is still with a submenu

GRUB_DEFAULT="0"
#GRUB_SAVE_DEFAULT="true" 

what happens if you just remove the submenu line?

Submenu screenshot

endeavouros-nix-submenu

EDIT - just removed the lts kernel - grub still displays a submenu.

In my do-something-else-day I created the grub theme - so I have had some strange issues where the grub menu wasn’t displaying correct despite everything was as it should.

Not the background - only the menu - the background is courtesy of @anon96036739 here

1 Like

I could comment them out, but at the moment I can’t restart the computer because of a running download. I will contact you later, thanks.

Glad you’re enjoying using it! :slight_smile:

3 Likes

I have now commented out the line GRUB_DISABLE_SUBMENU=y first, restart, then completely removed it again, restart. The result was the same every time: Grub with submenu, but no internet connection after loading the desktop.
I am at the end, let it be, there are more important things :wink:

One idea is to copy some menu entries (those that are hidden) from /boot/grub/grub.cfg into /boot/grub/custom.cfg.
You don’t have to run grub-mkconfig for that.

By the way, could you show your /boot/grub/grub.cfg here? Preferably using a pastebin or similar service.

#
# 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
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,gpt2' --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  b94f97f7-5172-49d3-8f43-aed6fa978573
else
  search --no-floppy --fs-uuid --set=root b94f97f7-5172-49d3-8f43-aed6fa978573
fi
    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=de_DE
  insmod gettext
fi
terminal_input console
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 'EndeavourOS, on linux-lts' --class endeavouros --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-lts-advanced-b94f97f7-5172-49d3-8f43-aed6fa978573' {
	savedefault
	load_video
	set gfxpayload=keep
	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//disk@0,gpt2' --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  b94f97f7-5172-49d3-8f43-aed6fa978573
	else
	  search --no-floppy --fs-uuid --set=root b94f97f7-5172-49d3-8f43-aed6fa978573
	fi
	echo	'Loading kernel linux-lts ...'
	linux	/boot/vmlinuz-linux-lts root=UUID=b94f97f7-5172-49d3-8f43-aed6fa978573 rw  quiet loglevel=3 nowatchdog
	echo	'Loading initial ramdisk ...'
	initrd	/boot/intel-ucode.img /boot/initramfs-linux-lts.img
}
menuentry 'EndeavourOS, on linux-lts (fallback initramfs)' --class endeavouros --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-lts-fallback-b94f97f7-5172-49d3-8f43-aed6fa978573' {
	savedefault
	load_video
	set gfxpayload=keep
	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//disk@0,gpt2' --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  b94f97f7-5172-49d3-8f43-aed6fa978573
	else
	  search --no-floppy --fs-uuid --set=root b94f97f7-5172-49d3-8f43-aed6fa978573
	fi
	echo	'Loading kernel linux-lts ...'
	linux	/boot/vmlinuz-linux-lts root=UUID=b94f97f7-5172-49d3-8f43-aed6fa978573 rw  quiet loglevel=3 nowatchdog
	echo	'Loading initial ramdisk ...'
	initrd	/boot/initramfs-linux-lts-fallback.img
}
menuentry 'EndeavourOS, on linux' --class endeavouros --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-b94f97f7-5172-49d3-8f43-aed6fa978573' {
	savedefault
	load_video
	set gfxpayload=keep
	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//disk@0,gpt2' --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  b94f97f7-5172-49d3-8f43-aed6fa978573
	else
	  search --no-floppy --fs-uuid --set=root b94f97f7-5172-49d3-8f43-aed6fa978573
	fi
	echo	'Loading kernel linux ...'
	linux	/boot/vmlinuz-linux root=UUID=b94f97f7-5172-49d3-8f43-aed6fa978573 rw  quiet loglevel=3 nowatchdog
	echo	'Loading initial ramdisk ...'
	initrd	/boot/intel-ucode.img /boot/initramfs-linux.img
}
menuentry 'EndeavourOS, on linux (fallback initramfs)' --class endeavouros --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-b94f97f7-5172-49d3-8f43-aed6fa978573' {
	savedefault
	load_video
	set gfxpayload=keep
	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//disk@0,gpt2' --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  b94f97f7-5172-49d3-8f43-aed6fa978573
	else
	  search --no-floppy --fs-uuid --set=root b94f97f7-5172-49d3-8f43-aed6fa978573
	fi
	echo	'Loading kernel linux ...'
	linux	/boot/vmlinuz-linux root=UUID=b94f97f7-5172-49d3-8f43-aed6fa978573 rw  quiet loglevel=3 nowatchdog
	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 ###
### 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 ###

1 Like

Thanks!
Can’t find any obvious reason. The only (a long shot) might be to compare the UUIDs in grub.cfg to the actual UUIDs of your partitions, e.g. command

lsblk -fm

Here is the output from lsbk -fm:

[uwe@HAL ~]$ lsblk -fm
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINT SIZE OWNER GROUP MODE
sda 232,9G root disk brw-rw----
├─sda1 vfat FAT32 A929-6A4D 299,1M 0% /boot/efi 300M root disk brw-rw----
├─sda2 ext4 1.0 b94f97f7-5172-49d3-8f43-aed6fa978573 200,4G 3% / 223,8G root disk brw-rw----
└─sda3 swap 1 2a77001d-ae85-4e73-a7a0-8f9c199d2646 [SWAP] 8,8G root disk brw-rw----
sdb 1,8T root disk brw-rw----
└─sdb1 ext4 1.0 76c9bf53-88a4-4d70-8949-b23a590140a8 1,2T 27% /home 1,8T root disk brw-rw----
sdc 1,8T root disk brw-rw----
├─sdc1 ext4 1.0 4bdf534e-c92e-4f4f-b4a8-77d797784f9e 84,8G 8% /run/timeshi 100G root disk brw-rw----
└─sdc2 ext4 1.0 dd3668ed-5ff8-48ea-b33a-023da89b4ae3 1,7T root disk brw-rw----
[uwe@HAL ~]$

As you can see, the / partition (sda2) is the same UUID, as in the grub.config … :unamused:

#
# 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
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,gpt2' --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  b94f97f7-5172-49d3-8f43-aed6fa978573
else
  search --no-floppy --fs-uuid --set=root b94f97f7-5172-49d3-8f43-aed6fa978573
fi
    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=de_DE
  insmod gettext
fi
terminal_input console
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 'EndeavourOS, on linux-lts' --class endeavouros --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-lts-advanced-b94f97f7-5172-49d3-8f43-aed6fa978573' {
	savedefault
	load_video
	set gfxpayload=keep
	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//disk@0,gpt2' --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  b94f97f7-5172-49d3-8f43-aed6fa978573
	else
	  search --no-floppy --fs-uuid --set=root b94f97f7-5172-49d3-8f43-aed6fa978573
	fi
	echo	'Loading kernel linux-lts ...'
	linux	/boot/vmlinuz-linux-lts root=UUID=b94f97f7-5172-49d3-8f43-aed6fa978573 rw  quiet loglevel=3 nowatchdog
	echo	'Loading initial ramdisk ...'
	initrd	/boot/intel-ucode.img /boot/initramfs-linux-lts.img
}
menuentry 'EndeavourOS, on linux-lts (fallback initramfs)' --class endeavouros --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-lts-fallback-b94f97f7-5172-49d3-8f43-aed6fa978573' {
	savedefault
	load_video
	set gfxpayload=keep
	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//disk@0,gpt2' --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  b94f97f7-5172-49d3-8f43-aed6fa978573
	else
	  search --no-floppy --fs-uuid --set=root b94f97f7-5172-49d3-8f43-aed6fa978573
	fi
	echo	'Loading kernel linux-lts ...'
	linux	/boot/vmlinuz-linux-lts root=UUID=b94f97f7-5172-49d3-8f43-aed6fa978573 rw  quiet loglevel=3 nowatchdog
	echo	'Loading initial ramdisk ...'
	initrd	/boot/initramfs-linux-lts-fallback.img
}
menuentry 'EndeavourOS, on linux' --class endeavouros --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-b94f97f7-5172-49d3-8f43-aed6fa978573' {
	savedefault
	load_video
	set gfxpayload=keep
	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//disk@0,gpt2' --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  b94f97f7-5172-49d3-8f43-aed6fa978573
	else
	  search --no-floppy --fs-uuid --set=root b94f97f7-5172-49d3-8f43-aed6fa978573
	fi
	echo	'Loading kernel linux ...'
	linux	/boot/vmlinuz-linux root=UUID=b94f97f7-5172-49d3-8f43-aed6fa978573 rw  quiet loglevel=3 nowatchdog
	echo	'Loading initial ramdisk ...'
	initrd	/boot/intel-ucode.img /boot/initramfs-linux.img
}
menuentry 'EndeavourOS, on linux (fallback initramfs)' --class endeavouros --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-b94f97f7-5172-49d3-8f43-aed6fa978573' {
	savedefault
	load_video
	set gfxpayload=keep
	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//disk@0,gpt2' --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  b94f97f7-5172-49d3-8f43-aed6fa978573
	else
	  search --no-floppy --fs-uuid --set=root b94f97f7-5172-49d3-8f43-aed6fa978573
	fi
	echo	'Loading kernel linux ...'
	linux	/boot/vmlinuz-linux root=UUID=b94f97f7-5172-49d3-8f43-aed6fa978573 rw  quiet loglevel=3 nowatchdog
	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 ###
### 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 ###

my /etc/fstab:

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a device; this may
# be used with UUID= as a more robust way to name devices that works even if
# disks are added and removed. See fstab(5).
#
# <file system>                              <mount point>      <type>     <options>                                               <dump>    <pass>
UUID=A929-6A4D                                /boot/efi          vfat       umask=0077                                              0         2
UUID=b94f97f7-5172-49d3-8f43-aed6fa978573     /                  ext4       defaults,noatime                                        0         1
UUID=76c9bf53-88a4-4d70-8949-b23a590140a8     /home              ext4       defaults,noatime                                        0         2
UUID=dd3668ed-5ff8-48ea-b33a-023da89b4ae3     /media/backup      ext4       defaults,noauto,user,x-gvfs-show,x-gvfs-name=Backup     0         0
UUID=2a77001d-ae85-4e73-a7a0-8f9c199d2646      none              swap       defaults                                                0         0
tmpfs                                         /tmp               tmpfs      defaults,noatime,mode=1777                              0         0