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

How to use worker_threads to create new threads in nodejs

Introduction As mentioned in the previous article...

Serial and parallel operations in JavaScript

Table of contents 1. Introduction 2. es5 method 3...

Build Tomcat9 cluster through Nginx and realize session sharing

Use Nginx to build Tomcat9 cluster and Redis to r...

JavaScript file loading and blocking issues: performance optimization case study

Let me start with a question: When writing an HTM...

MYSQL A question about using character functions to filter data

Problem description: structure: test has two fiel...

A little-known JS problem: [] == ![] is true, but {} == !{} is false

console.log( [] == ![] ) // true console.log( {} ...

Detailed implementation plan of Vue front-end exporting Excel files

Table of contents 1. Technology Selection 2. Tech...

Implementation of Nginx load balancing cluster

(1) Experimental environment youxi1 192.168.5.101...

Vue implements countdown function

This article example shares the specific code of ...

Docker stop stops/remove deletes all containers

This article mainly introduces Docker stop/remove...

The process of SSH service based on key authentication in Linux system

As we all know, SSH is currently the most reliabl...

Teach you how to deploy zabbix service on saltstack

Table of contents Saltstack deploys zabbix servic...

Front-end advanced teaching you to use javascript storage function

Table of contents Preface Background Implementati...