Grub Timeout

Ubuntu Version:

22.04

Desktop Environment (if applicable):

Mate

Problem Description:

My grub screen is currently showing 26 secs before closing (interestingly pressing Return does not close the screen like it use to - I have to wait 26secs). I have seen lots of suggestions about including the line $GRUB-TIMEOUT

Currently my /etc/default/grub looks like:

GRUB_DEFAULT="0"
GRUB_TIMEOUT_STYLE="menu"
GRUB_TIMEOUT="3"
GRUB_RECORDFAIL-TIMEOUT="$GRUB-TIMEOUT"
GRUB_DISTRIBUTOR="`lsb_release -i -s 2> /dev/null || echo Debian`"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

when I run the command sudo update-grub I get:

sudo update-grub
Sourcing file `/etc/default/grub'
/usr/sbin/grub-mkconfig: 9: /etc/default/grub: GRUB_RECORDFAIL-TIMEOUT=-TIMEOUT: not found

Any advice appreciated.

Relevant System Information:

Screenshots or Error Messages:

What I’ve Tried:


You may try changing
GRUB_RECORDFAIL-TIMEOUT="$GRUB-TIMEOUT"
to
GRUB_RECORDFAIL_TIMEOUT=$GRUB_TIMEOUT

Found at How can I force Ubuntu to boot on a stuck boot menu? and Cannot get grub menu to timeout (or go away)

I notice that you have inverted commas surrounding these three options.
Is grub-customizer installed?

g-schick: Unfortunately removing the quotes did not work. I left the commas in as by default all the comments to the right of the equals signs are in commas.
tea-for-one: I have not touched/changed the commas - only the text within the commas.

I have got grub-customizer installed and I have set the screen time to 3secs. When I now try to launch grub customizer I get the screen
grub customiser

Actually - although I have said 26 secs above I was wrong, it is the default 30secs.

Apologies - I have omitted a potentially important piece of information. I dual boot and had to replace my win10 HD. When replaced I could only boot to to win10 (as expected) and had to reinstall grub. Twice this did not work but on the third attempt (doing the same thing) I got grub back.

The reason @tea-for-one asked about Grub Customizer is because the app typically does things like add quotation marks like that due to its configurations.

However, we do not recommend using this tool since it often causes more problems than it solves.

Although possibly daunting at first, GRUB can be customized in various ways to achieve what you want without the need for a tool like Grub Customizer.

I would recommend uninstalling Grub Customizer and then set up the config file like this:

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

Then sudo update-grub and reboot,

All of this assumes you are single-booting with only Ubuntu.

If not, let us know.

If the above suggestion does not resolve the issue let us know and we can adjust the config.

EDIT: I just saw your additional post and adjusted the contents for your file.

Nevertheless, if GRUB is controlling the boot order this should work.

Do you have this folder /etc/grub.d/proxifiedScripts?

More importantly, make sure that you have all your personal files backed up on another device.
As mentioned by @rubi1200 , the old version of grub-customizer (i.e. for ubuntu 22.04) has been known to cause a few problems, hence backups are your safety belt.

More info for grub-customizer here

1 Like

rubi1200 - I have replaced /etc/default/grub with your entries and no difference - still 30sec and the changes I made to the grub screen via grub customizer are still there. (I have purged grub customizer).

tea-for-one - I do not have a proxifiedScripts file. (Everything backed up).

I have changed the background picture in the /etc/default/grub file and indeed the background picture changed (so the file is active). I also changed the timeout from 10sec to 3sec but it still remains at 30sec. (Another thing - it use to be the case that once I chose ‘ubuntu’ from the grub screen (didn’t actually choose it as it was set at 3secs so I just left it) the screen would go to my ‘background picture’ and quickly boot to the Desktop. Now … I have to wait ages to boot to the Desktop.

I do not have grub-customizer installed, so I can’t double-check every detail.
However, I’m pretty sure that the later, more reliable versions of grub-customizer do not have a proxifiedScripts directory.

Nevertheless, grub-customizer is probably controlling some parts of Grub (over and above the usual grub options).
Is there a readme within grub-customizer to help you?

Well, grub-customizer is a third party PPA tool, you should really seek support with it from the PPA owner, we usually do not support third party tools on the official Ubuntu support venues… (AFAIK it also messes around with /etc/grub.d which is completely generated by update-grub on Ubuntu systems so it will likely clash with default behavior of the OS)

2 Likes

The quotes arn’t the only change between the lines. Did you also replace the ‘-’ with ‘_’ two times (prepending TIMEOUT)?

GRUB_RECORDFAIL-TIMEOUT="$GRUB-TIMEOUT"
GRUB_RECORDFAIL_TIMEOUT=$GRUB_TIMEOUT

@g-schick This is only a symptom of the problem.

Please read the link posted by @tea-for-one which explains how Grub Customizer modifies config files on a user’s system.

Dealing with it is like trying to unscramble an egg.

This is why we do not recommend using tools like this especially since, with some effort, all the modifications can be done within GRUB without the need for a 3rd party tool.

From the initial post:

As far as I understand this update-grub doesn’t recognize GRUB_RECORDFAIL-TIMEOUT and also replaces $GRUB-TIMEOUT by empty $GRUB variabe which results in -TIMEOUT.

So why is it wrong to correct errors probably done by a 3rd party tool with built in tools?

And if I get this right ‘Grub Customizer’ refuses to work based on the same error.

The OP removed the tool and redid his GRUB config:

The timeout entry was removed so changing the format will not make a difference now to the larger issue which is that Grub Customizer modifies files in a way that makes it hard to undo the damage.

I am hoping that @tea-for-one has some ideas about how to fix the current issue, namely, that

At this point, I am not sure if this is due to a leftover Grub Customizer issue or something else.

Perhaps correcting them manually is necessary.

Are you sure about that?

Thank you all for your help. This is my current 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_DEFAULT="0"
#GRUB_TIMEOUT_STYLE="menu"
#GRUB_TIMEOUT="3"
#GRUB_RECORDFAIL-TIMEOUT="$GRUB-TIMEOUT"
#GRUB_DISTRIBUTOR="`lsb_release -i -s 2> /dev/null || echo Debian`"
#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
#GRUB_CMDLINE_LINUX=""

GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=3
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"
GRUB_DISABLE_OS_PROBER="false"

export GRUB_MENU_PICTURE="/home/dad/Documents/icons/grub.png"
export GRUB_COLOR_NORMAL="red/black"
export GRUB_COLOR_HIGHLIGHT="yellow/black"

As rubi1200 has said - I have removed grub-customizer from my system. Should I delete existing (config/all) files and re-install grub to save time?

You may try grub-editenv - unset recordfail to manually remove recordfail and maybe clear the delay.

Or you may try to alter the timeout in case of a record fail using GRUB_RECORDFAIL_TIMEOUT=$GRUB_TIMEOUT to set it to the same value as GRUB_TIMEOUT.

How exactly did you reinstall? Using a chroot?

Note that grub never uses dashes in any variable names … so the proper name of the variable is:

GRUB_RECORDFAIL_TIMEOUT=

What the line:

GRUB_RECORDFAIL_TIMEOUT="$GRUB_TIMEOUT"

simply does is to assign the same value to both vartiables with the ability to only change it in one place …
Note that shell assigning (which /etc/default/grub uses) always requires quotes around the assigned values (especially if there could be spaces in the values you put in there), so you must have quotes around everything behind the equal sign … the correct syntax here is:

GRUB_DEFAULT="0"
GRUB_TIMEOUT_STYLE="menu"
GRUB_TIMEOUT="3"
# assigning the value of GRUB_TIMEOUT to RECORDFAIL, so they are the same and you only need to change the time above
GRUB_RECORDFAIL_TIMEOUT="$GRUB_TIMEOUT"
GRUB_DISTRIBUTOR="`lsb_release -i -s 2> /dev/null || echo Debian`"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

A short description of the recordfail feature might perhaps also help you to decide if you actually feel you need it:

With GRUB2, there is a recordfail feature. If there is a 
failed boot attempt, GRUB2 will automatically stop at
the boot menu during the next boot.

PS: Though I assume the customizer tool simply changed a lot more than just /etc/default/grub which might have messed up things now … grub has a very complex way of generating multiple layers of configs from various templates to produce its final grub.cfg

1 Like