What is the difference between centos7 system and previous versions?

王林
Release: 2020-03-26 14:32:31
Original
3047 people have browsed it

What is the difference between centos7 system and previous versions?

The following is a brief example to illustrate the major changes:

1. Installation

When installing, all previous Centos packages can be selected. Yes, but now you can only select one item, and there are duplicate sub-options; when installing to the selected partition, the partition recommended by Centos 7 is xfs instead of the previous ext4.

2. Initial startup

After installing the computer, the interface for booting into the system has changed. At first glance, I thought there were two kernels. Turns out one of them is the rescue selection, and after pressing e, You will find that all the grub.conf information is out. Finally, you find the place where the kernel is started, write a 1 (the purpose is to enter single-user mode), and then enter the rescue mode.

(Recommended tutorial: centos tutorial)

3. Startup sequence

After entering the system, it is a graphical interface. If you want to enter the character interface, modify / etc/inittab, it is found to be an empty file, all of which are comments. If you want to change the runlevel, you can soft-link /lib/systemd/system/runlevel*.target to /etc/systemd/system/default.target. (Of course, if you pass the exam, overwriting will work). I tried it and it worked, and I can change it to character interface 3.

Originally, from Centos7 onwards, the target concept was used to define the run level, which was divided into level 3 and level 5. The meaning is as follows:

The third run level uses multi-user. target is replaced, and the fifth run level is replaced by graphical.target. runlevel3.target and runlevel5.target are symbolic links pointing to multi-user.target and graphical.target respectively.

Use the following command to switch to "Run Level 3":

systemctl isolate multi-user.target或systemctl isolate runlevel3.target
Copy after login

Use the following command to switch to "Run Level 5":

systemctl isolate graphical.target或systemctl isolate runlevel5.target
Copy after login

(1) View the current running level

runlevel
Copy after login

(2) View the default boot run level:

systemctl get-default
Copy after login

(3) Modify the boot default run level command

systemctl set-default multi-user.target(或graphical.target)
Copy after login

Or use the following command:

Default startup run level 3:

ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
Copy after login

Default startup run level 5:

ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target
Copy after login

4 , Configure the network and host name

Configure the network, go to /etc/sysconfig/network-script/ and see that the network card has been renamed enp1s5, which is interesting. After configuring the network, change the host name, go to /etc/ I went to sysconfig/network to change the name and found that this file was also empty. I tried to modify it according to the original version 6. After restarting, it had no effect. I checked the hostname and found that to change the name in 7, I had to go to /etc/hostname to change the name.

5. LVM and I was thinking about zooming in and out, but something went wrong. When executing resize2fs, why did it keep reporting superblock errors? Then I ran man resize2fs and found that this command only supports the ext file system!

(Recommended related video tutorials:

linux video tutorial

) 6. Service management

Centos’ service uses systemd instead of sysvinit management. Systemd's service management program, systemctl is the main tool, which integrates the functions of the previous service and chkconfig. You can use it to enable/disable services permanently or only for the current session.

(1) Start a service:

systemctl start postfix.service
Copy after login

(2) Close a service:

systemctl stop postfix.service
Copy after login

(3) Restart a service:

systemctl restartpostfix.service
Copy after login

(4 ) Display service status:

systemctl statuspostfix.service
Copy after login

(5) Enable a service when booting:

systemctl enable postfix.service
Copy after login

(6) Disable a service when booting:

systemctl disable postfix.service
Copy after login

(7) Check whether the service is Start at boot:

systemctl is-enabled postfix.service
Copy after login

(8) View the list of started services:

systemctl list-unit-files|grep enabled
Copy after login

Description: Enabling services is in the current "runlevel" configuration file directory /etc/systemd/system In /multi-user.target.wants/, create a soft link to the corresponding service configuration file in /usr/lib/systemd/system. To disable the service, delete this soft link.

The above is the detailed content of What is the difference between centos7 system and previous versions?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template