0

I want to boot directly into my Xubuntu. I searched a bit online and found out that you can edit the file /etc/default/grub to make the timeout of GRUB 0 seconds. What you have to do is change GRUB_TIMEOUT to 0 and then in your shell run sudo update-grub. I did this, but after rebooting my system still had a 30 second timeout. After further investigation I found the file /boot/grub/grub.cfg and I found these two lines of code:

if [ "${recordfail}" = 1 ] ; then
  set timeout=30 <-------------------------------!!
else
  if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=menu
    set timeout=0
  # Fallback normal timeout code in case the timeout_style feature is
  # unavailable.
  else
    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

(I pointed at the two lines with this symbol: <---!!). I think that these have something to do with my problem and why the timeout is 30 seconds. I can change them but I didn't because in the file it's stated explicitly to not change anything in the file so I turned to this platform. Could you recommend a solution?

Ubuntu: 19.04

Carolus
  • 477
  • 4
  • 16
  • 1
    Hi Juan - this is great, thank you! Since StackOverflow is a Q/A site, it's recommended to add your answer as a solution, rather than embed it in the question. :) – Ben Dec 04 '19 at 14:28
  • If your `/boot` directory is on btrfs or LVM, you should look at [this](https://askubuntu.com/a/1123295/307091) – Carolus Dec 27 '19 at 12:50

1 Answers1

-1

I ran info -f grub in my shell and I navigated through the menu and found that Grub has this rule GRUB_RECORDFAIL_TIMEOUT. I added this rule into my grub file and set it equal to 0 and when I rebooted It didn't take 30 seconds but less. It's taking 10 seconds.

After this I decided to read the /boot/grub/grub.cfg file once more and I found something interesting.

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows Boot Manager (on /dev/sda2)' --class windows --class os $menuentry_id_option 'osprober-efi-4457-E741' {
    insmod part_gpt
    insmod fat
    set root='hd0,gpt2'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  4457-E741
    else
      search --no-floppy --fs-uuid --set=root 4457-E741
    fi
    chainloader /efi/Microsoft/Boot/bootmgfw.efi
}
set timeout_style=menu
if [ "${timeout}" = 0 ]; then
  set timeout=10 <--------------------------------!!
fi
### END /etc/grub.d/30_os-prober ###

I think that this is happening because I have another drive containing a different OS (Windows 10). This is because in the os-prober section timeout is once more set to 10.

I searched a bit more in info -f grub and found out that you could disable the os-prober by adding GRUB_DISABLE_OS_PROBER=true. This fixed my issue.

Solved.

Carolus
  • 477
  • 4
  • 16
  • 1
    Another trick (instead of disabling the os-prober) might be to use a timeout of `0.0` since it isn't equal to `0`. Mentioned in this [answer](https://askubuntu.com/a/905477/307091). – Carolus Dec 27 '19 at 09:45