I've been trying to configure Grub to give a hidden 3 second countdown, and then boot into the default option.
What appears to happen is that Grub will alternate randomly between doing just that, and showing the menu with a 25 second countdown.
This happens both on full reboot, and on restore from hibernate. I have not been able to establish any pattern which will predict when it happens. Sometimes it gives one config 2 or 3 times in a row, sometimes it switches.
How can I make it consistent?
Ubuntu Desktop 18.04
Contents of /etc/default/grub
:
GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=3
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT_STYLE=countdown
GRUB_TIMEOUT=3
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nouveau.modeset=0"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=/dev/nvme0n1p3"
#GRUB_CMDLINE_LINUX_DEFAULT="text"
#GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX=""
GRUB_INIT_TUNE="480 440 1"
I have also used grub-customizer 5.1.0
.
It turns out the problem is actually that a "recordfail" field is set in the file
/boot/grub/grubenv
The way to reset that is with the command:
But what you really need is for this to be done as part of boot sequence, whether normal or from hibernate.
This can be done with a service.
Use this service descriptor:
Then install it using the instructions from this answer:
Create the above descriptor as
Then:
Some references suggested you need to run
sudo systemctl daemon-reload
first, but I have not found this necessary.