I tried to update my grub config file to timeout to 0 value, so OS starts quickly. I modified /etc/default/grub configuration file on my Ubuntu 18.04 and then ran:

sudo update-grub

and it didn't work. I also ran:

sudo grub-mkconfig
sudo update-grub

but they didn't work.

I searched a lot on the web to solve this issue, but all guides say to run the update-grub command to update grub by /etc/default/grub config file. I don't know if is Ubuntu 18.04 that handles grub files in a different way, but I cannot update my grub with my parameters.

This is my /etc/default/grub file:

# 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_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`

# 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 ...)

# Uncomment to disable graphical terminal (grub-pc only)

# 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'

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

# Uncomment to disable generation of recovery mode menu entries

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
  • 3
    Please edit your question and include your modified grub config file. Otherwise we're just trying to guess what you did. – Organic Marble May 14 at 12:04
  • Do you have other distributions installed (dual boot)? – mook765 May 14 at 12:22
  • it didn't work mean that my grub timeout is still set to 10 sec as by default @Melebius – Bob91 May 14 at 12:27
  • I have windows in the same ssd and other distros installed on other hdd, but last month i had fedora 27 (instead of ubuntu 18) and it worked when i changed grub config file, so i think the other distros aren't the causes of this behavior @mook765 – Bob91 May 14 at 12:35
  • 1
    Could you please run Boot-Info and edit your question to include a link to its resulting info log? Thanks. – David Foerster May 15 at 13:48

In /boot/grub/grub.cfg file there is a condition, almost at the end of the file, that sets the timeout to 10 if the timeout is set to 0. In other words, if you set the timeout to 0 in your /etc/default/grub and then update grub, the condition above reset it to 10 seconds.

if [ "${timeout}" = 0 ]; then
     set timeout=10

However, /boot/grub/grub.cfg is a read-only file and I cannot remove that condition. I made some tests with different values of the timeout in /etc/default/grub. I tried with 1ms (0.001), 0.1s and 1s and I found out that values below 1 (like 0.1 and 0.001) work in the same way and almost like timeout set to 0.

Uncomment GRUB_HIDDEN_TIMEOUT=0 and run update-grub again.

  • it doesn't work – Bob91 May 15 at 14:14
  • GRUB_HIDDEN_TIMEOUT=-1 – kuhajeyan Nov 20 at 16:33

You can set GRUB_TIMEOUT to 0.

The part overwriting timeout value is written in ajust_timeout function in the top of /etc/grub.d/30_os-prober.

ajust_timeout () {
if [ "\${timeout}" = 0]; then
  set timeout=10

So, you can set the value by editing the file and comment out if-block.

Like the other answers say, uncomment GRUB_HIDDEN_TIMEOUT and run update-grub. Then comment out the

if [ "${timeout}" = 0 ]; then
  set timeout=10

section in /boot/grub/grub.cfg. In vim you can just override the read-only property with an exclamation point :x!. Or you can run

sudo chmod +w /boot/grub/grub.cfg
sudo vim /boot/grub/grub.cfg
sudo chmod -w /boot/grub/grub.cfg

to temporarily have write permission while editing the file.

  • 1
    You are right, but i think everytime you update grub (manually or when there are any os upgrade) the /boot/grub/grub.cfg will recreated with the condition above. – Bob91 May 24 at 16:37
  • 1
    That is true, the file is overwritten on update, as I experienced recently. – asantas93 May 25 at 17:20

You can set GRUB_TIMEOUT to -1.


Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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