How to Remove Grub Timeout
Grub will often pause for a number of seconds at the boot menu to allow for selection of options. If only one distro is installed and there is no need to access the boot options, the Grub timeout can be set to zero to allow for a faster boot.
NOTE: This will make the Grub menu almost inaccessible. Holding "Shift" on boot should allow access to the menu, but this is not well tested. If access to the Grub menu is needed after this, the changes may need to be reverted.
This guide was written for Ubuntu-based distributions of at least version 18.04. Other distros or older versions may have different commands, package names, and file locations.
- Create a script to modify the Grub config.
sudo su -c 'install -o root -g root -m 755 <(cat <<'"'"'FILE'"'"' #!/bin/sh cat <<GTO set timeout_style=hidden set timeout=0 if keystatus; then if keystatus --shift; then set timeout_style=menu set timeout=-1 else set timeout_style=hidden set timeout=0 fi fi GTO FILE ) /etc/grub.d/50_hidemenu'
- Disable the OS prober in the Grub config.
echo 'GRUB_DISABLE_OS_PROBER=true' | sudo tee -a /etc/default/grub >/dev/null
- Apply the script and the changed settings.
- On the next reboot, the Grub menu should be skipped with the first option being booted without delay.