CentOS 7 switching boot kernel and switching boot mode explanation

CentOS 7 switching boot kernel and switching boot mode explanation

centos7 switch boot kernel

Note: If necessary, it is recommended to execute yum update -y first to upgrade all packages

Note:

1. The CentOS I used for testing is version 7.2, with the default minimal installation and the system kernel is 3.10.0-327.

2. After upgrading to 4.4.x, if you use the yum update -y command to upgrade the software at will, the 3.10.0-693 kernel package in CentOS7.4 will continue to be installed and will be the first startup item.

3. After each yum update -y , you need to use the grub2-set-default 0 command to modify the default kernel startup item. 0 is the first item, 1 is the second item, and so on. Check GRU

1. View the current system kernel

uname -r

3.18.6-2.el7.centos.x86_64

View the list of available kernels

awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg

The results are as follows:

0 : CentOS Linux (3.18.6-2.el7.centos.x86_64) 7 (Core)

1 : CentOS Linux (3.10.0-514.el7.x86_64) 7 (Core)

2 : CentOS Linux (0-rescue-05653d304ed443db9b60529d6cf7d242) 7 (Core)

2. View the current default kernel startup item

grub2-editenv list

The results are as follows:

saved_entry=0

That is, the default kernel loaded when the system is currently started is CentOS Linux (3.18.6-2.el7.centos.x86_64) 7 (Core)

3. Change the default startup kernel item

grub2-set-default 1

Check the default kernel boot entry again and find that the saved_entry field changes to 1

4. Restart the system

reboot

View the current system kernel

uname -r

3.10.0-514.el7.x86_64

You can see that the kernel of the current system has been changed

centos7 switch boot mode

1. CentOS has only two startup modes:

multi-user.target: analogous to runlevel 3 # Command line mode graphical.target: analogous to runlevel 5 # Graphics mode

Check the vim /etc/inittab file, there is a command to change the mode

2. View the current mode:

systemctl get-default 

3. Change the startup mode

Start with command:

systemctl set-default multi-user.target

Start in graphical mode:

systemctl set-default graphical.target

Summarize

The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. If you want to learn more about this, please check out the following links

You may also be interested in:
  • Installation and configuration of mysql 8.0.15 under Centos7
  • Centos7.4 server installation of apache and solutions to problems encountered during the installation process
  • Tutorial on installing lamp-php7.0 in Centos7.4 environment
  • Centos7.5 configuration java environment installation tomcat explanation
  • The best way to start a jar package project under Centos7 server
  • Alibaba Cloud Centos7 installation and configuration of SVN
  • How to add custom system services to CentOS7 systemd
  • How to add Nginx to system services in CentOS7
  • Detailed explanation of the basic use of centos7 firewall in linux
  • Detailed explanation of Nginx installation, SSL configuration and common commands under Centos7.x

<<:  Nodejs Exploration: In-depth understanding of the principle of single-threaded high concurrency

>>:  Special commands in MySql database query

Recommend

js development plug-in to achieve tab effect

This article example shares the specific code of ...

How to view and execute historical commands in Linux

View historical commands and execute specified co...

How to use default values ​​for variables in SASS

Variables defined in SASS, the value set later wi...

Detailed examples of how to use the box-shadow property in CSS3

There are many attributes in CSS. Some attributes...

Detailed explanation of Truncate usage in MySQL

Preface: When we want to clear a table, we often ...

How to use the Marquee tag in XHTML code

In the forum, I saw netizen jeanjean20 mentioned h...

Create a virtual environment using venv in python3 in Ubuntu

1. Virtual environment follows the project, creat...

Vue component encapsulates sample code for uploading pictures and videos

First download the dependencies: cnpm i -S vue-uu...

How to install mysql on centos and set up remote access

1. Download the mysql repo source $ wget http://r...

Let's talk about the LIMIT statement in MySQL in detail

Table of contents question Server layer and stora...

Solution to MySQL 8.0 cannot start 3534

MySQL 8.0 service cannot be started Recently enco...

MySQL 5.7.18 MSI Installation Graphics Tutorial

This article shares the MySQL 5.7.18 MSI installa...