Grub wait time 10 seconds after editing to "0" in /etc/default/grub?

Solution 1:

This is a bug. The problem is in the file /etc/grub.d/30_os-prober.

As presented here, a workaround is to add the files /etc/grub.d/25_pre-os-prober and /etc/grub.d/35_post-os-prober.

The two files must also be marked as executable to work.

After adding this two files, your modifications to the variable GRUB_TIMEOUT in /etc/default/grub should work as expected.

If you are not dual booting, another workaround is to uninstall os-prober.

25_pre-os-prober:

#! /bin/sh
# file: /etc/grub.d/25_pre-os-prober
set -e

# Save the $timeout and $timeout_style values set by /etc/grub.d/00_header
# before /etc/grub.d/30_os-prober messes them up.

cat << EOF
set timeout_bak=\${timeout}
set timeout_style_bak=\${timeout_style}
EOF

35_post-os-prober

#! /bin/sh
# file: /etc/grub.d/35_post-os-prober
set -e

# Reset $timeout and $timeout_style to their original values
# set by /etc/grub.d/00_header before /etc/grub.d/30_os-prober messed them up.

cat << EOF
set timeout=\${timeout_bak}
set timeout_style=\${timeout_style_bak}
EOF

Solution 2:

If you read the documentation at info -f grub -n 'Simple configuration', it is said that GRUB_HIDDEN_TIMEOUT_* is deprecated.

Could you try using instead in /etc/default/grub:

GRUB_TIMEOUT=0
GRUB_TIMEOUT_STYLE=hidden
#GRUB_HIDDEN_TIMEOUT="0"
#GRUB_HIDDEN_TIMEOUT_QUIET="true"
# rest of file unchanged

Run

sudo update-grub

and see if it works or not.

You could double-check in /boot/grub/grub.cfg looking for timeout that the update has correctly been done.

Solution 3:

There is an override in grub for when the timeout is 0 seconds to replace it with 10 seconds. Rather than editing grub scripts as other answers recommend you can simply use:

GRUB_HIDDEN_TIMEOUT="0.0"
GRUB_TIMEOUT="0.0"

This will work because the grub overrides will not find "0" to be equal to "0.0".