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

Implementation of waterfall layout in uni-app project

GitHub address, you can star it if you like it Pl...

Implementation of Webpack3+React16 code splitting

Project Background Recently, there is a project w...

Installation tutorial of mysql8.0rpm on centos7

First, download the diagram 1. First uninstall th...

Summary of the unknown usage of "!" in Linux

Preface In fact, the humble "!" has man...

About Vue's 4 auxiliary functions of Vuex

Table of contents 1. Auxiliary functions 2. Examp...

Four data type judgment methods in JS

Table of contents 1. typeof 2. instanceof 3. Cons...

MySQL 5.6.27 Installation Tutorial under Linux

This article shares the installation tutorial of ...

Detailed explanation of storage engine in MySQL

MySQL storage engine overview What is a storage e...

Should I use Bootstrap or jQuery Mobile for mobile web wap

Solving the problem Bootstrap is a CSS framework ...

Parsing the commonly used v-instructions in vue.js

Table of contents Explanation of v-text on if for...

Encapsulation method of Vue breadcrumbs component

Vue encapsulates the breadcrumb component for you...

Linux common commands chmod to modify file permissions 777 and 754

The following command is often used: chmod 777 文件...