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
Use the following command to switch to "Run Level 5":
systemctl isolate graphical.target或systemctl isolate runlevel5.target
(1) View the current running level
runlevel
(2) View the default boot run level:
systemctl get-default
(3) Modify the boot default run level command
systemctl set-default multi-user.target(或graphical.target)
Or use the following command:
Default startup run level 3:
ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
Default startup run level 5:
ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target
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 tutorialCentos’ 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
(2) Close a service:
systemctl stop postfix.service
(3) Restart a service:
systemctl restartpostfix.service
(4 ) Display service status:
systemctl statuspostfix.service
(5) Enable a service when booting:
systemctl enable postfix.service
(6) Disable a service when booting:
systemctl disable postfix.service
(7) Check whether the service is Start at boot:
systemctl is-enabled postfix.service
(8) View the list of started services:
systemctl list-unit-files|grep enabled
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!