Score:4

Would like to hide Grub menu

ru flag

First, sorry for my english (I'm french) !!

I've just bought a Dell Inspiron 13 2-in-1 laptop, installed Kubuntu 21.10 (no dual boot) but I've got a little problem with GRUB !

The grub menu still stays visible on boot, with a 30 seconds countdown...

I've first tryed to change the config with Grub customizer, no result.

Then I've modified the /etc/default/grub manually, plus a sudo update-grub, no result.

I've also tryed what's explained in this page about os_prober : https://gist.github.com/LeahCim/9332432 but still nothing...

Actually, my /etc/default/grub is

# 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_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_DISABLE_OS_PROBER=true
GRUB_TIMEOUT_STYLE="hidden"
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"

Regards

EDIT :

Due to a suggestion here, I've changed the GRUB_HIDDEN_TIMEOUT_QUIET= from false to true, but it's not better. Even changing GRUB_HIDDEN_TIMEOUT= from 2 to 0 didn't change anything.

In fact, whatever I change in /etc/default/grub, it seems to have no effects on Grub ; it's like if GRUB don't care about the /boot/grub/grub.cfg, or if grub.cfg don't care about /etc/default/grub, even after a "sudo update-grub".

EDIT 2 :

Whatever I try, nothing changes... I've tryed to find something in the grub.cfg but it's too difficult for me. I've seen "timeout=30" (line 109) which correspond to the 30 seconds countdown, but I don't know what to do with that neither how to change it. Could you help me, please ?!! Here is the file :

#
# 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
if [ "${initrdfail}" = 2 ]; then
   set initrdfail=
elif [ "${initrdfail}" = 1 ]; then
   set next_entry="${prev_entry}"
   set prev_entry=
   save_env prev_entry
   if [ "${next_entry}" ]; then
      set initrdfail=2
   fi
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

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 initrdfail {
    if [ -n "${have_grubenv}" ]; then if [ -n "${partuuid}" ]; then
      if [ -z "${initrdfail}" ]; then
        set initrdfail=1
        if [ -n "${boot_once}" ]; then
          set prev_entry="${default}"
          save_env prev_entry
        fi
      fi
      save_env initrdfail
    fi; fi
}
function recordfail {
  set recordfail=1
  # GRUB lacks write support for lvm, so recordfail support is disabled.
}
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_gpt
insmod lvm
insmod ext2
set root='lvmid/WJ7HiC-1808-IY8B-ZnJg-m2JO-X2Sp-eon3xJ/0mBBLm-PWoV-07pO-6ItQ-H0vK-80Oc-7ctcrG'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint='lvmid/WJ7HiC-1808-IY8B-ZnJg-m2JO-X2Sp-eon3xJ/0mBBLm-PWoV-07pO-6ItQ-H0vK-80Oc-7ctcrG'  5a9194c9-d3ba-4f02-925e-a6bf54b49c06
else
  search --no-floppy --fs-uuid --set=root 5a9194c9-d3ba-4f02-925e-a6bf54b49c06
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=fr_FR
  insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
  set timeout=30
else
  if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=hidden
    set timeout=0
  # Fallback hidden-timeout code in case the timeout_style feature is
  # unavailable.
  elif sleep --interruptible 0 ; then
    set timeout=0
  fi
fi
if [ $grub_platform = efi ]; then
  set timeout=30
  if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=menu
  fi
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
#set_background_image "images/tile.png";

set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
if background_color 0,0,0; then
  clear
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
    set gfxpayload="${1}"
    if [ "${1}" = "keep" ]; then
        set vt_handoff=vt.handoff=7
    else
        set vt_handoff=
    fi
}
if [ "${recordfail}" != 1 ]; then
  if [ -e ${prefix}/gfxblacklist.txt ]; then
    if hwmatch ${prefix}/gfxblacklist.txt 3; then
      if [ ${match} = 0 ]; then
        set linux_gfx_mode=keep
      else
        set linux_gfx_mode=text
      fi
    else
      set linux_gfx_mode=text
    fi
  else
    set linux_gfx_mode=keep
  fi
else
  set linux_gfx_mode=text
fi
export linux_gfx_mode
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-5a9194c9-d3ba-4f02-925e-a6bf54b49c06' {
    recordfail
    load_video
    gfxmode $linux_gfx_mode
    insmod gzio
    if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
    insmod part_gpt
    insmod lvm
    insmod ext2
    set root='lvmid/WJ7HiC-1808-IY8B-ZnJg-m2JO-X2Sp-eon3xJ/0mBBLm-PWoV-07pO-6ItQ-H0vK-80Oc-7ctcrG'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint='lvmid/WJ7HiC-1808-IY8B-ZnJg-m2JO-X2Sp-eon3xJ/0mBBLm-PWoV-07pO-6ItQ-H0vK-80Oc-7ctcrG'  5a9194c9-d3ba-4f02-925e-a6bf54b49c06
    else
      search --no-floppy --fs-uuid --set=root 5a9194c9-d3ba-4f02-925e-a6bf54b49c06
    fi
    linux   /boot/vmlinuz-5.13.0-21-generic root=/dev/mapper/vgkubuntu-root ro  quiet splash $vt_handoff
    initrd  /boot/initrd.img-5.13.0-21-generic
}
submenu 'Options avancées pour Ubuntu' $menuentry_id_option 'gnulinux-advanced-5a9194c9-d3ba-4f02-925e-a6bf54b49c06' {
    menuentry 'Ubuntu, avec Linux 5.13.0-21-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.13.0-21-generic-advanced-5a9194c9-d3ba-4f02-925e-a6bf54b49c06' {
        recordfail
        load_video
        gfxmode $linux_gfx_mode
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod lvm
        insmod ext2
        set root='lvmid/WJ7HiC-1808-IY8B-ZnJg-m2JO-X2Sp-eon3xJ/0mBBLm-PWoV-07pO-6ItQ-H0vK-80Oc-7ctcrG'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint='lvmid/WJ7HiC-1808-IY8B-ZnJg-m2JO-X2Sp-eon3xJ/0mBBLm-PWoV-07pO-6ItQ-H0vK-80Oc-7ctcrG'  5a9194c9-d3ba-4f02-925e-a6bf54b49c06
        else
          search --no-floppy --fs-uuid --set=root 5a9194c9-d3ba-4f02-925e-a6bf54b49c06
        fi
        echo    'Chargement de Linux 5.13.0-21-generic…'
        linux   /boot/vmlinuz-5.13.0-21-generic root=/dev/mapper/vgkubuntu-root ro  quiet splash $vt_handoff
        echo    'Chargement du disque mémoire initial…'
        initrd  /boot/initrd.img-5.13.0-21-generic
    }
    menuentry 'Ubuntu, avec Linux 5.13.0-21-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.13.0-21-generic-recovery-5a9194c9-d3ba-4f02-925e-a6bf54b49c06' {
        recordfail
        load_video
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod lvm
        insmod ext2
        set root='lvmid/WJ7HiC-1808-IY8B-ZnJg-m2JO-X2Sp-eon3xJ/0mBBLm-PWoV-07pO-6ItQ-H0vK-80Oc-7ctcrG'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint='lvmid/WJ7HiC-1808-IY8B-ZnJg-m2JO-X2Sp-eon3xJ/0mBBLm-PWoV-07pO-6ItQ-H0vK-80Oc-7ctcrG'  5a9194c9-d3ba-4f02-925e-a6bf54b49c06
        else
          search --no-floppy --fs-uuid --set=root 5a9194c9-d3ba-4f02-925e-a6bf54b49c06
        fi
        echo    'Chargement de Linux 5.13.0-21-generic…'
        linux   /boot/vmlinuz-5.13.0-21-generic root=/dev/mapper/vgkubuntu-root ro recovery nomodeset dis_ucode_ldr 
        echo    'Chargement du disque mémoire initial…'
        initrd  /boot/initrd.img-5.13.0-21-generic
    }
    menuentry 'Ubuntu, avec Linux 5.13.0-20-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.13.0-20-generic-advanced-5a9194c9-d3ba-4f02-925e-a6bf54b49c06' {
        recordfail
        load_video
        gfxmode $linux_gfx_mode
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod lvm
        insmod ext2
        set root='lvmid/WJ7HiC-1808-IY8B-ZnJg-m2JO-X2Sp-eon3xJ/0mBBLm-PWoV-07pO-6ItQ-H0vK-80Oc-7ctcrG'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint='lvmid/WJ7HiC-1808-IY8B-ZnJg-m2JO-X2Sp-eon3xJ/0mBBLm-PWoV-07pO-6ItQ-H0vK-80Oc-7ctcrG'  5a9194c9-d3ba-4f02-925e-a6bf54b49c06
        else
          search --no-floppy --fs-uuid --set=root 5a9194c9-d3ba-4f02-925e-a6bf54b49c06
        fi
        echo    'Chargement de Linux 5.13.0-20-generic…'
        linux   /boot/vmlinuz-5.13.0-20-generic root=/dev/mapper/vgkubuntu-root ro  quiet splash $vt_handoff
        echo    'Chargement du disque mémoire initial…'
        initrd  /boot/initrd.img-5.13.0-20-generic
    }
    menuentry 'Ubuntu, avec Linux 5.13.0-20-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.13.0-20-generic-recovery-5a9194c9-d3ba-4f02-925e-a6bf54b49c06' {
        recordfail
        load_video
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod lvm
        insmod ext2
        set root='lvmid/WJ7HiC-1808-IY8B-ZnJg-m2JO-X2Sp-eon3xJ/0mBBLm-PWoV-07pO-6ItQ-H0vK-80Oc-7ctcrG'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint='lvmid/WJ7HiC-1808-IY8B-ZnJg-m2JO-X2Sp-eon3xJ/0mBBLm-PWoV-07pO-6ItQ-H0vK-80Oc-7ctcrG'  5a9194c9-d3ba-4f02-925e-a6bf54b49c06
        else
          search --no-floppy --fs-uuid --set=root 5a9194c9-d3ba-4f02-925e-a6bf54b49c06
        fi
        echo    'Chargement de Linux 5.13.0-20-generic…'
        linux   /boot/vmlinuz-5.13.0-20-generic root=/dev/mapper/vgkubuntu-root ro recovery nomodeset dis_ucode_ldr 
        echo    'Chargement du disque mémoire initial…'
        initrd  /boot/initrd.img-5.13.0-20-generic
    }
    menuentry 'Ubuntu, avec Linux 5.13.0-19-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.13.0-19-generic-advanced-5a9194c9-d3ba-4f02-925e-a6bf54b49c06' {
        recordfail
        load_video
        gfxmode $linux_gfx_mode
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod lvm
        insmod ext2
        set root='lvmid/WJ7HiC-1808-IY8B-ZnJg-m2JO-X2Sp-eon3xJ/0mBBLm-PWoV-07pO-6ItQ-H0vK-80Oc-7ctcrG'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint='lvmid/WJ7HiC-1808-IY8B-ZnJg-m2JO-X2Sp-eon3xJ/0mBBLm-PWoV-07pO-6ItQ-H0vK-80Oc-7ctcrG'  5a9194c9-d3ba-4f02-925e-a6bf54b49c06
        else
          search --no-floppy --fs-uuid --set=root 5a9194c9-d3ba-4f02-925e-a6bf54b49c06
        fi
        echo    'Chargement de Linux 5.13.0-19-generic…'
        linux   /boot/vmlinuz-5.13.0-19-generic root=/dev/mapper/vgkubuntu-root ro  quiet splash $vt_handoff
        echo    'Chargement du disque mémoire initial…'
        initrd  /boot/initrd.img-5.13.0-19-generic
    }
    menuentry 'Ubuntu, avec Linux 5.13.0-19-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.13.0-19-generic-recovery-5a9194c9-d3ba-4f02-925e-a6bf54b49c06' {
        recordfail
        load_video
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod lvm
        insmod ext2
        set root='lvmid/WJ7HiC-1808-IY8B-ZnJg-m2JO-X2Sp-eon3xJ/0mBBLm-PWoV-07pO-6ItQ-H0vK-80Oc-7ctcrG'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint='lvmid/WJ7HiC-1808-IY8B-ZnJg-m2JO-X2Sp-eon3xJ/0mBBLm-PWoV-07pO-6ItQ-H0vK-80Oc-7ctcrG'  5a9194c9-d3ba-4f02-925e-a6bf54b49c06
        else
          search --no-floppy --fs-uuid --set=root 5a9194c9-d3ba-4f02-925e-a6bf54b49c06
        fi
        echo    'Chargement de Linux 5.13.0-19-generic…'
        linux   /boot/vmlinuz-5.13.0-19-generic root=/dev/mapper/vgkubuntu-root ro recovery nomodeset dis_ucode_ldr 
        echo    'Chargement du disque mémoire initial…'
        initrd  /boot/initrd.img-5.13.0-19-generic
    }
}

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

### BEGIN /etc/grub.d/10_linux_zfs ###
### END /etc/grub.d/10_linux_zfs ###

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

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

### BEGIN /etc/grub.d/20_memtest86+ ###
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/25_pre-os-prober ###
set timeout_bak=${timeout}
set timeout_style_bak=${timeout_style}
### END /etc/grub.d/25_pre-os-prober ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {
    fwsetup
}
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/35_post-os-prober ###
set timeout=${timeout_bak}
set timeout_style=${timeout_style_bak}
### END /etc/grub.d/35_post-os-prober ###

### 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've noticed in KDE partition manager that my NVME drive appears 2 times : 1st is /dev/nvme0n1 (with 2 partitions : /dev/nvme0n1p1 mounted on /boot/efi 512Mio FAT32 and /dev/nvme0n1p2 mounted on vgkubuntu 476,44Gio LVM2 PV) and 2nd /dev/vgkubuntu (with 2 partitions : /dev/vgkubuntu/root mounted on / 475,48Gio EXT4 and /dev/vgkubuntu/swap_1 980Mio linuxswap). Is that normal ? Could it explain my problem with GRUB ?

Organic Marble avatar
us flag
It might be worth looking in `/boot/grub/grub.cfg` to confirm that "whatever I change in /etc/default/grub, it seems to have no effects on Grub " If you change the value of the TIMEOUTs to 99, run update-grub, and don't find a 99 in that file, something deeper is going on. Or save the file to a .backup, make a trivial change in /etc/default/grub, run update-grub, then diff the files
Ruslan avatar
bv flag
Do you have multiple storage devices? Maybe the one GRUB looks at is not the one where you modify your config file.
karel avatar
sa flag
Does this answer your question? [How to remove or hide the GRUB boot menu?](https://askubuntu.com/questions/18775/how-to-remove-or-hide-the-grub-boot-menu)
Score:5
ng flag

I believe you need to change

GRUB_HIDDEN_TIMEOUT=2

to

GRUB_HIDDEN_TIMEOUT=0

You also need to run sudo update-grub after you make changes to the configuration file.

You definitely do not need GRUB customizer. IMO GRUB customizer is a plague: most people would want boot to be as secure and stable as possible. Installing less stable, less secure, eyecandy to an essential low level utility that you only see for a few seconds is a bit silly. But one of the best things about Linux is that you have a lot of choices, including not-so-good ones. Hiding GRUB with configs is definitely the better option.

ChanganAuto avatar
us flag
I wish I could give +100 just for the *Installing less stable, less secure, eyecandy to an essential low level utility that you only see for a few seconds is a bit silly.*
ru flag
I agree for Grub customizer, but I needed to try that solution... I've already tried changing the GRUB_HIDDEN_TIMEOUT ; whatever I try, Grub always start showing the menu with a 30 seconds countdown...
Nmath avatar
ng flag
There may be options that conflict with each other. There are a couple of different solutions where this has been asked before. See: https://askubuntu.com/q/618169. Always when editing configs like this make sure that you back up the original file so that you can restore any changes you have made.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.