3

I have a laptop which I intend to be dual-boot. It previously booted into Windows (7), and after Linux install now boots directly into Linux (openSUSE). I've edited /etc/grub.d/40_custom to add the Windows chainloader entry. So far, so good.

Unfortunately I can't get grub2 to display the selection menu at all, even to select the Safe Mode entry for the Linux install. I get a split-second flash of the "welcome to grub" message and then it boots directly into the default Linux entry.

Things I have tried:

  • Setting GRUB_TIMEOUT to an integer value and GRUB_HIDDEN_TIMEOUT to
    • 0
    • blank
    • commented out
  • Setting GRUB_HIDDEN_TIMEOUT_QUIET to both "true" and "false"
  • Setting GRUB_TERMIAL to "console"
  • Removing "quiet" and "splash=silent" from GRUB_CMDLINE_LINUX_DEFAULT

I am regenerating the config each time with /usr/sbin/grub2-mkconfig

Other info:

  • Holding shift during boot doesn't bring up the menu regardless of the state of GRUB_HIDDEN_TIMEOUT
  • I'm pretty sure this machine isn't using UEFI (I have no /sys/firmware/efi directory)
  • Legacy USB support is enabled in the BIOS.

Anything else I can try? This is getting really aggravating, I never had this much trouble with grub legacy!

Edit:

Section of grub.cfg related to timeout:

if [ x${boot_once} = xtrue]; then
    set timeout=0  
elif [ x$feature_timeout_style = xy ]; then  
    set timeout_style=menu  
    set timeout=0  
# Fallback normal timeout code in case the timeout_style feature is unavailable
else  
    set timeout=0  
fi

This is different to the output displayed by the grub update script, which has "timeout = 10"! Editing the grub.cfg file directly displays the menu as expected.

  • What output this command? grep -i timeout /boot/grub/grub.cfg – MiniMax Jun 26 '17 at 13:21
  • And, on Ubuntu, the Esc need to be holded, while booting, in some cases. Shift doesn't always work. Try with Esc button, may be it will work on OpenSUSE too. – MiniMax Jun 26 '17 at 13:32
6

Do this lines exist in the your /etc/default/grub? If not, add them.

GRUB_TIMEOUT=10
GRUB_TIMEOUT_STYLE=menu

run update-grub afterwards to update /boot/grub/grub.cfg

You can check, if the needed changes has happened, by this way:
grep -i timeout /boot/grub/grub.cfg

Output should be contained such values:

set timeout_style=menu
set timeout=10

From the grub manual:

GRUB_TIMEOUT

Boot the default entry this many seconds after the menu is displayed, unless a key is pressed. The default is 5. Set to 0 to boot immediately without displaying the menu, or to -1 to wait indefinitely. If GRUB_TIMEOUT_STYLE is set to countdown or hidden, the timeout is instead counted before the menu is displayed.

GRUB_TIMEOUT_STYLE

If this option is unset or set to menu, then GRUB will display the menu and then wait for the timeout set by GRUB_TIMEOUT to expire before booting the default entry. Pressing a key interrupts the timeout. If this option is set to countdown or hidden, then, before displaying the menu, GRUB will wait for the timeout set by GRUB_TIMEOUT to expire. If ESC is pressed during that time, it will display the menu and wait for input. If a hotkey associated with a menu entry is pressed, it will boot the associated menu entry immediately. If the timeout expires before either of these happens, it will boot the default entry. In the countdown case, it will show a one-line indication of the remaining time.

  • This looked like a really promising lead, as my default grub file had no GRUB_TIMEOUT_STYLE entry at all, but unfortunately same result as before :( I will try playing with the other values again with this entry added though. Thanks for the suggestion! – jam Jun 27 '17 at 8:56
  • Actually I think you may have put me on the right track asking about the grep output. When I run the update grub script for this OS it outputs what looks like the new contents of grub.cfg, and it has "set timeout=10", but if I grep grub.cfg itself, this line is "set timeout=0"! So a bug, possibly... – jam Jun 27 '17 at 9:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.