Skip to main content

Change Grub timeout duration

 Grub is the most commonly used boot loader in Linux systems. 

      Grub : A program that calls a Unix/Linux operating system into memory. Officially GNU GRUB, GRUB is a popular boot loader due to its flexibility and configuration capabilities, allowing changes to be made at boot time and support for boot images from the network. 

Quite often you don't see the grub menu at all. And under most circumstances it is OK. But if you have some problems and you have to go to recovery mode, you have to see the menu and select an OS from the menu. 

So you love to see this grub menu when you boot your system and you are unable to see it.

The culprit is the GRUB_TIMEOUT. If this value is set to 0, then you can't see the menu. 

The correct method to change its setting is through the file /etc/default/grub

 

sudo vi /etc/default/grub

$ cat /etc/default/grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=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=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

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

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

 

As you can observe, the time is set to 0. So  the time to display the menu is set to 0 seconds before default option is selected. 

Edit the line containing GRUB_TIMEOUT and set it 10 seconds. Now the grub will display the menu for 10 seconds before automatically selecting the default option. 

Next use update-grub 

$sudo update-grub

update-grub will update your changes in the actual grub configuration file which is /boot/grub/grub.cfg

Grub timeout style :

Another setting which affects the display of the menu is the grub configuration value GRUB_TIMEOUT_STYLE. If this value is set to countdown or hidden, then the menu will not be shown. Instead one line indicating time remaining is shown if value is set to countdown, and at the end of timeout time, the default option is booted. If the option is set to hidden a blank screen shown for the duration and at the end of which default option is booted. In these times, you can press F4 or esc or keep holding shift key to display the menu.
 
But if the value is set to menu, then the menu is displayed.
 
So if you want to set this value, set it to menu. You can even remove this setting altogether. 
 
Once again edit the file /etc/default/grub. And set the value as
 
GRUB_TIMEOUT_STYLE = menu

And use update-grub.

 

 

Comments