Grub menu sometimes does not show on boot

I just installed KDE stable on my laptop and spent some time figuring out most of the problems I have. One things bothers me, though, is that grub menu does not show consistently. Without changing any settings and/or pressing any key, sometimes the menu shows up before the boot messages appear on screen (which is the expected behavior), and sometimes nothing is shown before boot messages.

In my attempt to spot some pattern and figure out what's happening, I repetitively reboot my laptop without logging into the OS (click the 'reboot' option on login page). The first two times, the menu did not show up. However, without doing anything, the menu showed up the third time (I did not press left shift or esc key). And then the menu showed up consistently for 6 or 7 times. My other attempts had similar results.

I did very little changes to the grub config file. I removed "quiet" from GRUB_CMDLINE_LINUX_DEFAULT. I also added a new line "GRUB_HIDDEN_TIMEOUT=120" in the hope that if grub is hidden it will be quite obvious, but when the menu did not show up, it jumped straight to boot messages without waiting for 2 minutes. I did verify that changing the GRUB_TIMEOUT value affect the wait time before booting to the default entry when the menu did show.

I'm quite confused at the moment. I'm not sure if it is a grub problem or UEFI problem (I did disabled legacy boot in the firmware) or something else. I hope someone can give me some hint or tell me what kind of information I should post here to figure out what's happening.

/etc/default/grub:

GRUB_DEFAULT=saved
GRUB_HIDDEN_TIMEOUT=120
GRUB_TIMEOUT=5
GRUB_TIMEOUT_STYLE=menu
GRUB_DISTRIBUTOR='Manjaro'
GRUB_CMDLINE_LINUX_DEFAULT="resume=UUID=d77b93d1-6f32-47cc-a60d-476aae5356c6"
GRUB_CMDLINE_LINUX=""

# If you want to enable the save default function, uncomment the following
# line, and set GRUB_DEFAULT to saved.
GRUB_SAVEDEFAULT=true

# 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

# 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 'videoinfo'
GRUB_GFXMODE=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-gray/black"
GRUB_COLOR_HIGHLIGHT="green/black"

# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/usr/share/grub/background.png"
GRUB_THEME="/usr/share/grub/themes/manjaro/theme.txt"

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

how does the command

efibootmgr -v

look?

Manjaro has adopted the work of Fedora to create a silent boot only showing what ever logo is in or available in the firmware.

After a successful boot - that is defined by a timespan of two minutes - a service will write a success status to the grubenv file in /boot/grub.

Next time you boot you will not see grub unless you press either keys Esc, Shift or F8 at the right time during boot.

If the boot was unsuccessful or system reboot before the two minute timespan - then upon reboot the grub menu will be showed automatically.

A lot of information is available on this silent boot feature. A forum search on the keywords

silent boot @philm 

https://archived.forum.manjaro.org/search?q=silent%20boot%20%40philm%20

3 Likes

I think @linux-aarhus 's answer rules out the UEFI problem assumption. This is the expected behavior after all. But just for reference, here is the reference:

$ efibootmgr -v
BootCurrent: 0003
Timeout: 0 seconds
BootOrder: 0003,3003,2001,2002,2003
Boot0003* EFI HDD Device (SAMSUNG MZHPU512HCGL-000H1)   PciRoot(0x0)/Pci(0x1c,0x0)/Pci(0x0,0x0)/Sata(0,0,0)/HD(3,MBR,0x3a64aee,0x800,0x100000)RC
Boot2001* USB Drive (UEFI)      RC
Boot3003* Internal Hard Disk or Solid State Disk        RC

Thank for your thorough explanation! I did some reading on silent boot, but still want to confirm two things:

  1. Does the silent boot implementation conflict with the GRUB_HIDDEN_TIMEOUT setting (which would explain why grub does not wait for 120s before the menu is shown)?
  2. I read about "grub-silent". I assume that is a different thing, right?

I don't know - I think the answer is available in one of @philm's posts.

On a second thought - it would be reasonable to make the silent boot override the timeout otherwise a user would stare at a black screen for what would feel like a lifetime before the real boot takes place.

Wondering - what the h.... is happening!

To my understanding - yes.

Thanks! Your answers are quite helpful.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by