3

I noticed this first when I removed the i386 kernel and left in place the amd64, so I installed the i386 kernel again, still doesn't work. Nothing explain why I need to select the boot option if I have the GRUB_TIMEOUT option set in the grub configuration file:

➜  ~  grep -v '#' /etc/default/grub 
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX="initrd=/install/initrd.gz"

grub.cfg

➜  ~  cat /boot/grub/grub.cfg 
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
set default="0"

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}
function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_msdos
insmod ext2
set root='hd1,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 --hint='hd1,msdos7'  cead26d6-08f4-4894-ac78-a9a4ce59f773
else
  search --no-floppy --fs-uuid --set=root cead26d6-08f4-4894-ac78-a9a4ce59f773
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
  set timeout=-1
else
  set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
insmod part_msdos
insmod ext2
set root='hd1,msdos8'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos8 --hint-efi=hd0,msdos8 --hint-baremetal=ahci0,msdos8 --hint='hd1,msdos8'  0cef2d59-21ca-4ba2-a9b2-0b9ef1f42589
else
  search --no-floppy --fs-uuid --set=root 0cef2d59-21ca-4ba2-a9b2-0b9ef1f42589
fi
insmod png
if background_image /braiam/.cache/gnome-control-center/backgrounds/14fb12e1345ca2dfd3807e7f7b1122b0d6015d9453ed5742de72b988a9cffded; then
  set color_normal=white/black
  set color_highlight=black/white
else
  set menu_color_normal=cyan/blue
  set menu_color_highlight=white/blue
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
    set gfxpayload="${1}"
}
set linux_gfx_mode=
export linux_gfx_mode
menuentry 'Debian GNU/Linux' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-cead26d6-08f4-4894-ac78-a9a4ce59f773' {
    load_video
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='hd1,msdos5'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd1,msdos5'  279a18da-130b-46dd-8b54-84da48eb445f
    else
      search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f
    fi
    echo    'Loading Linux 3.13-1-amd64 ...'
    linux   /vmlinuz-3.13-1-amd64 root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro initrd=/install/initrd.gz quiet
    echo    'Loading initial ramdisk ...'
    initrd  /initrd.img-3.13-1-amd64
}
submenu 'Advanced options for Debian GNU/Linux' $menuentry_id_option 'gnulinux-advanced-cead26d6-08f4-4894-ac78-a9a4ce59f773' {
    menuentry 'Debian GNU/Linux, with Linux 3.13-1-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13-1-amd64-advanced-cead26d6-08f4-4894-ac78-a9a4ce59f773' {
        load_video
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd1,msdos5'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd1,msdos5'  279a18da-130b-46dd-8b54-84da48eb445f
        else
          search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f
        fi
        echo    'Loading Linux 3.13-1-amd64 ...'
        linux   /vmlinuz-3.13-1-amd64 root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro initrd=/install/initrd.gz quiet
        echo    'Loading initial ramdisk ...'
        initrd  /initrd.img-3.13-1-amd64
    }
    menuentry 'Debian GNU/Linux, with Linux 3.13-1-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13-1-amd64-recovery-cead26d6-08f4-4894-ac78-a9a4ce59f773' {
        load_video
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd1,msdos5'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd1,msdos5'  279a18da-130b-46dd-8b54-84da48eb445f
        else
          search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f
        fi
        echo    'Loading Linux 3.13-1-amd64 ...'
        linux   /vmlinuz-3.13-1-amd64 root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro single initrd=/install/initrd.gz
        echo    'Loading initial ramdisk ...'
        initrd  /initrd.img-3.13-1-amd64
    }
    menuentry 'Debian GNU/Linux, with Linux 3.12-1-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.12-1-amd64-advanced-cead26d6-08f4-4894-ac78-a9a4ce59f773' {
        load_video
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd1,msdos5'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd1,msdos5'  279a18da-130b-46dd-8b54-84da48eb445f
        else
          search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f
        fi
        echo    'Loading Linux 3.12-1-amd64 ...'
        linux   /vmlinuz-3.12-1-amd64 root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro initrd=/install/initrd.gz quiet
        echo    'Loading initial ramdisk ...'
        initrd  /initrd.img-3.12-1-amd64
    }
    menuentry 'Debian GNU/Linux, with Linux 3.12-1-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.12-1-amd64-recovery-cead26d6-08f4-4894-ac78-a9a4ce59f773' {
        load_video
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd1,msdos5'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd1,msdos5'  279a18da-130b-46dd-8b54-84da48eb445f
        else
          search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f
        fi
        echo    'Loading Linux 3.12-1-amd64 ...'
        linux   /vmlinuz-3.12-1-amd64 root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro single initrd=/install/initrd.gz
        echo    'Loading initial ramdisk ...'
        initrd  /initrd.img-3.12-1-amd64
    }
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###

### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
    insmod part_msdos
    insmod ext2
    set root='hd1,msdos5'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd1,msdos5'  279a18da-130b-46dd-8b54-84da48eb445f
    else
      search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f
    fi
    linux16 /memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
    insmod part_msdos
    insmod ext2
    set root='hd1,msdos5'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd1,msdos5'  279a18da-130b-46dd-8b54-84da48eb445f
    else
      search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f
    fi
    linux16 /memtest86+.bin console=ttyS0,115200n8
}
menuentry "Memory test (memtest86+, experimental multiboot)" {
    insmod part_msdos
    insmod ext2
    set root='hd1,msdos5'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd1,msdos5'  279a18da-130b-46dd-8b54-84da48eb445f
    else
      search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f
    fi
    multiboot   /memtest86+_multiboot.bin
}
menuentry "Memory test (memtest86+, serial console 115200, experimental multiboot)" {
    insmod part_msdos
    insmod ext2
    set root='hd1,msdos5'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd1,msdos5'  279a18da-130b-46dd-8b54-84da48eb445f
    else
      search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f
    fi
    multiboot   /memtest86+_multiboot.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows 7 (loader) (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-AA64B45A64B42AC9' {
    insmod part_msdos
    insmod ntfs
    set root='hd1,msdos1'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd1,msdos1'  AA64B45A64B42AC9
    else
      search --no-floppy --fs-uuid --set=root AA64B45A64B42AC9
    fi
    chainloader +1
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

I tried purging grub, removing the grub.cfg file, changing the GRUB_DEFAULT=0 and nothing improved.

1

2 Answers 2

5

Try adding this to /etc/default/grub:

GRUB_RECORDFAIL_TIMEOUT=$GRUB_TIMEOUT

That should modify this:

if [ "${recordfail}" = 1 ] ; then
  set timeout=-1
else
  set timeout=5
fi

So that both timeouts are the same. If this does not work, find the section in `/etc/grub.d/00_header which looks like this:

if [ "\${recordfail}" = 1 ]; then
  set timeout=-1
else
  set timeout=${2}
fi

And remove the if clause so you just have:

set timeout=${2}

${2} may or may not be the original value. If it isn't don't change that.

3
  • +1 but it can't be Ubuntu specific, he's using Debian.
    – terdon
    Commented Mar 15, 2014 at 19:50
  • @terdon Perhaps the fix got moved upstream...Fedora doesn't use that switch (recordfail). Anyway, I edited in a version of the pre-fix solution from AU.
    – goldilocks
    Commented Mar 15, 2014 at 20:02
  • 1
    I had a recordfail marker in the grubenv. Removing it fixed the problem but yours is a workaround ;)
    – Braiam
    Commented Mar 15, 2014 at 20:58
4

Edit your grubenv (usually in /boot/grub) and remove the recordfail marker. (A boot failure has been permanently recorded in the grub saved environment.)

1
  • Note: the proper way to edit the grubenv file is to use grub2-editenv unset Commented Jan 6, 2017 at 15:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .