Deactivate GRUB2 recordfail feature

Last modified: Friday December 1st, 2023

From this article, you will learn how to deactivate GRUB2 recordfail feature.


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.

You may not want this in some situations, so you can change it. Depending on the GRUB version, you either need to change the file /etc/grub.d/00_header or the variable GRUB_RECORDFAIL_TIMEOUT in the file /etc/default/grub.

Deactivate GRUB2 recordfail feature

First, search for the following in the file /etc/grub.d/00_header

if [ ${recordfail} = 1 ]; then
   set timeout=-1
  set timeout=${GRUB_TIMEOUT}

If you find this (the exact wording), then simply add comment characters:

#if [ ${recordfail} = 1 ]; then
#    set timeout=-1
    set timeout=${GRUB_TIMEOUT}

Or, if you find the following,

if [ "${recordfail}" = 1 ]; then
 set timeout=${GRUB_RECORDFAIL_TIMEOUT:--1}
 set timeout=${2}

then edit the file /etc/default/grub and add the line


for a 5 second timeout.

In either case, to update the configuration, run update-grub.

Now GRUB2 will always use the set timeout.

Manual reset the recordfail value

You can manually reset the value for grubenv:

grub-editenv set recordfail=0

Or you can even remove it:

grub-editenv unset recordfail

Was this article helpful?
Views: 161

10 Years Beehosting!
Celebrate with 70% OFF + FREE Site Transfer. website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.