Modify the boot time of grub in ubuntu

Modify the boot time of grub in ubuntu

The online search to modify the grub startup time is basically to modify /etc/default/grub

#Comment out GRUB_HIDDEN_TIMEOUT=0
#GRUB_HIDDEN_TIMEOUT=0
#Modify GRUB_TIMEOUT = 0 
GRUB_TIMEOUT = 0

Then run update-grub to regenerate /boot/grub/grub.cfg. However, this does not work and you still have to wait 30 seconds.

View /boot/grub/grub.cfg

### BEGIN /etc/grub.d/00_header ###
...
function recordfail {
 set recordfail=1
 # GRUB lacks write support for lvm, so recordfail support is disabled.
}
...
if [ "${recordfail}" = 1 ] ; then
 set timeout=30
...
if [ $grub_platform = efi ]; then
 set timeout=30
...
### END /etc/grub.d/00_header ###

From the above configuration, we can see that if it is an lvm partition, the timeout is 30 seconds; if it is an EFI boot, the timeout is 30 seconds. The priority is EFI > LVM.

Let's take a look at the /etc/grub.d/00_header script that generates this configuration.

...
  cat << EOF
if [ "\${recordfail}" = 1 ] ; then
 set timeout=${GRUB_RECORDFAIL_TIMEOUT:-30}
else
EOF
...
if [ "$recordfail_broken" = 1 ]; then
 cat << EOF
if [ \$grub_platform = efi ]; then
 set timeout=${GRUB_RECORDFAIL_TIMEOUT:-30}
 if [ x\$feature_timeout_style = xy ] ; then
  set timeout_style=menu
 fi
...

You can see that this timeout of 30 seconds is set by the value of GRUB_RECORDFAIL_TIMEOUT.

So just add or modify GRUB_RECORDFAIL_TIMEOUT in /boot/grub/grub.cfg

GRUB_RECORDFAIL_TIMEOUT=0

Then run sudo update-grub to regenerate /boot/grub/grub.cfg.

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Steps to install GRUB on Linux server
  • A quick solution to the problem of entering grub directly in dual systems but not entering ubantu
  • grub is damaged, and the GRUB 2 boot prompt appears when booting
  • Linux grub startup encryption and deletion recovery method
  • A brief tutorial on how to start the grub command line system

<<:  Summary of MySQL database and table sharding

>>:  A brief analysis of the difference between static and self in PHP classes

Recommend

MySQL multi-table query detailed explanation

Eating well and getting enough rest sounds simple...

MySQL 5.7.24 installation and configuration graphic tutorial

This article shares the installation and configur...

How to solve the slow speed of MySQL Like fuzzy query

Question: Although the index has been created, wh...

mysql add, delete, modify and query basic statements

grammar Here is the generic SQL syntax for INSERT...

MySQL 5.7.18 version free installation configuration tutorial

MySQL is divided into installation version and fr...

Solution to the inaccessibility of Tencent Cloud Server Tomcat port

I recently configured a server using Tencent Clou...

Analysis of parameter transfer process of driver module in Linux

Declare the parameter name, type and permission y...

Detailed steps to install JDK and Tomcat in Linux environment

Table of contents 1. Install JDK Manual Installat...

JS implementation of Apple calculator

This article example shares the specific code of ...

How to create scheduled tasks using crond tool in Linux

Preface Crond is a scheduled execution tool under...

How to use jconsole to monitor remote Tomcat services

What is JConsole JConsole was introduced in Java ...

Learn Node.js from scratch

Table of contents url module 1.parse method 2. fo...

JavaScript removes unnecessary properties of an object

Table of contents Example Method 1: delete Method...

Web Design Tutorial (5): Web Visual Design

<br />Previous article: Web Design Tutorial ...