The difference between Centos6 and Centos7 systems

Table of Contents

1. System type

2. Service management

3. File system

4. File structure

5. Desktop system

6. Host name

7. Check the system version

8. Time synchronization

9. Firewall

10. Login prompt

11. Character set

12. Time zone setting

13. Regional settings

14. grub (GRand Unified Bootloader)

15. Kernel

16. Database

17. Network card name

18. Nested virtualization technology

19. USB extension

20. Comparison chart


1. System type

The system type of centos6 is sysvinit (sysvinit is the init system of system V)

The system type of centos7 is systemd (systemed is the latest initialization system intt of the Linux system. The design goal of systemed is to overcome the inherent shortcomings of sysvinit, thereby efficiently improving the startup speed of the system).

You can check the system type through pstree -p. The first process of centos6 is init (pid=1), and the first process of centos7 is systemd (pid=1).

centos6 starts in a certain order and starts very slowly; centos7 starts in parallel and starts quickly.
In fact, many differences between centos6 and 7 are related to the system type sysvinit/systemd.

2. Service Management

  • centos6: uses service and chconfig management services (service service start/stop/restart/status/reload)
  • centos7: Use systemctl to manage services, but you can also use service and chconfig commands (systemctl start/stop/restart/reload service)

3. File system

  • centos6.X: The default file system is EXT4 (Fourth EXtended filesystem). The capacity of a single file system of EXT4 reaches 1EB (1,048,576TB, 1EB=1024PB, 1PB=1024TB), and the size of a single file reaches 16TB (4K block size); supported Unlimited number of subdirectories.
  • centos7.X: The default file system is XFS. The size is 9EB and the maximum file system size is 18EB.

You can use blkid /dev/sda1 to view the file system

[root@centos7 ~]# blkid /dev/sda1
/dev/sda1: UUID="d617fdc4-033b-431e-96d5-b106bbc9461d" TYPE="xfs" 

4. File structure

  • centos6: /bin, /sbin, /lib, /lib64 are under /
  • centos7: /bin, /sbin, /lib, /lib64 are under /usr

5. Desktop system

  • centos6:GNOME 2.x
  • centos7: GNOME 3.x (GNOME Shell)

6. Host name

  • centos6: The configuration file is /etc/sysconfig/network (permanent settings)
  • centos7: The configuration file is /etc/hostname (permanent setting) and you can also use the command to set it permanently: hostnamectl set-hostname hostname #hostname is a new hostname management tool

7. Check system version

All redhat series (centos) can use cat /etc/redhat-release

centos7 can also use cat /etc/os-release to support the unified release version name and version number file of all systemd systems. This can be used to test ubuntu16 and 18; you can also use cat /proc/version to view the system version

[root@localhost ~]# cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

8. Time synchronization

  • centos6: using ntp
  • centos7: Using chrony can also use ntp

9. Firewall

  • centos6: iptables firewall
  • centos7: firewalld firewall

10. Login prompt

cat /etc/issue #Some production environments will clear this file. Please analyze the specific situation in detail.

[root@centso7 ~]# cat /etc/issue
\S
Kernel \r on an \m

11. Character set

  • centos6: use /etc/sysconfig/i18n
  • centos7: use /etc/local.conf

Centos7 can also use the character set management tool localectl to set it. localctl set-locale LANG=zh_CN.UTF-8 #localectl is a new character management tool

[root@centos7 ~]# cat /etc/locale.conf
LANG="zh_CN.UTF-8"

12. Time zone setting

  • centos6: in /etc/sysconfig/clock
  • centos7: There is no such configuration file, you need to use timedatectl to set it
[root@centos7 ~]# timedatectl
      Local time: Monday 2023-11-13 11:38:33 CST
  Universal time: 1 2023-11-13 03:38:33 UTC
        RTC time: 1 2023-11-13 02:34:26
       Time zone: Asia/Shanghai (CST, + 0800)
     NTP enabled: yes
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a

13. Regional Settings

centos6:

vim /etc/sysconfig/i18n LANG="ja_JP.utf8"
/etc/sysconfig/i18n
locale

centos7:

localectl set-locale LANG=ja_JP.utf8
localectl status

14.grub(GRand Unified Bootloader)

  • centos6: using grub
  • centos7: using grub2

The name of the configuration file has changed. In grub, the configuration file is grub.conf or menu.lst (a soft link to grub.conf). In grub2, it is renamed grub.cfg.

15. Kernel

The kernel version of centos6 is 2.6x, and the kernel version of centos7 is 3.10.x. Use uname -r to view it.

[root@centos7 ~]# uname -r
3.10.0-693.el7.x86_64

16. Database

  • centos6: The default database is MySQL
  • centos7: The default database is MariaDB

17. Network card name

  • centos6: The network card name is eth0
  • centos7: The network card name is ens33

18. Nested virtualization technology

  • centos6: not supported
  • centos7: support

19. USB extension

  • centos6:USB2.0
  • centos7:USB3.0

20. Comparison chart

Serial number System function centos6 centos7
1 init system sysvinit systemed
2 Desktop system GNOME 2.x GNOME 3.x/GNOME shell
3 File system EXT4 XFS
4 Kernel version 2.6.x 3.10.x
5 Start loading GRUB Legacy GRUB2
6 Firewall iptables firewalld
7 Database mysql mariadb
8 File directory /bin,/sbin,/lib, /lib64 is under / /bin,/sbin,/lib,/lib64 is under /usr
9 Host name /etc/sysconfig/network /etc/hostname
10 Time synchronization ntp,ntpq -p chrony,chronyc sources
11 Modify time zone vim /etc/sysconfig/clock timedatectl set-timezone
12 Character settings /etc/sysconfig/il8n /etc/local.conf
13 Start and stop services service service start systemctl start service
14 Self-start chkconfig service on/off systemctl enable service
15 Service List chkconfig –list systemctl list-unit-files
16 kill kill -9 pid systemctl kill –signal=pid Service
17 Network and ports netstat ss
18 View IP ifconfig ip address show
19 Routing information route -n ip route show
20 Shutdown the stop system shutdown -h now systemctl poweroff
21 Single-user mode init S systemctl rescue
22 USB extension USB2.0 USB3.0
23 Nested virtualization Not supported Supported
24 Network card name eth0 ens33

The knowledge points of the article match the official knowledge files, and you can further learn relevant knowledge. Cloud native entry-level skills treeHomepageOverview 17053 people are learning the system