RHEL6与RHEL7的变化(转)

System and command changes between RHEL 6 and RHEL 7

Between RHEL6 and RHEL7 there are a number of changes to tools, commands, and workflows. Changes that are likely to affect common administrative tasks are listed here:

  • Anaconda RHEL installer completely redesigned1
  • Legacy GRUB boot loader replaced by GRUB22
  • Procedure for bypassing root password prompt at boot completely different3
  • SysV init system and all related tools replaced by systemd4
  • ext4 replaced by xfs as default filesystem type5
  • Directories /bin, /sbin, /lib and /lib64 are now all under the /usr directory6
  • Network interfaces have a new naming scheme based on physical device location (e.g., eth0 might become enp0s3)7
  • ntpd replaced by chronyd as the default network time protocol daemon8
  • GNOME2 replaced by GNOME3 as default desktop environment9
  • System registration and subscription now handled exclusively with Red Hat Subscription Management (RHSM)10
  • MySQL replaced by Mariadb11
  • tgtd replaced by targetcli12
  • High Availability Add-On: RGManager removed as resource-management option (in favor of Pacemaker); all CMAN features merged into Corosync (qdiskd replaced by votequorum plugin); all tools unified into pcs13
  • ifconfig and route commands are further deprecated in favor of ip
  • netstat further deprecated in favor of ss
  • System user UID range extended from 0-499 to 0-999
  • locate no longer available by default; (available as mlocate package)
  • nc (netcat) replaced by nmap-ncat

See footnotes for additional detail about these changes.

Administrative command and config-file changes

System Basics

Task RHEL6 RHEL7
View RH subscription information /etc/sysconfig/rhn/systemid 
subscription-manager identity
subscription-manager identity
Configure RH subscription rhn_register 
rhnreg_ks 
subscription-manager
subscription-manager14 
rhn_register15

Basic Configuration

Task RHEL6 RHEL7
Graphical configuration tools system-config-* gnome-control-center
Configure network system-config-network nmcli 
nmtui 
nm-connection-editor
Configure system language system-config-language localectl
Configure system time and date system-config-date 
date
timedatectl 
date
Synchronize time and date ntpdate 
/etc/ntp.conf
ntpdate 
/etc/chrony.conf
Configure keyboard system-config-keyboard localectl

Jobs and services

Task RHEL6 RHEL7
List all services chkconfig 
ls /etc/init.d/
systemctl -at service 
ls /{usr/lib,etc}/systemd/system/*.service
List running services service –status-all systemctl -t service –state=active
Start/stop a service service name start 
service name stop
systemctl start name.service 
systemctl stop name.service
Enable/disable a service chkconfig name on 
chkconfig name off
systemctl enable name.service 
systemctl disable name.service
Check if service enabled chkconfig name systemctl is-enabled name
View service status service name status systemctl status name.service
Create service file or change config chkconfig –add systemctl daemon-reload
View runlevel/target runlevel systemctl get-default
Change runlevel/target init runlevel systemctl isolate name.target 
init runlevel
Configure logging /etc/rsyslog.conf /etc/rsyslog.conf 
/etc/rsyslog.d/*.conf 
/var/log/journal/ 
/etc/systemd/journald.conf
View logs /var/log/ /var/log/ 
journalctl

Kernel, boot, and hardware

Task RHEL6 RHEL7
Bypass root password prompt at boot append 1 or s or init=/bin/bash to kernel cmdline append rd.break or init=/bin/bash to kernel cmdline
Shut down system shutdown systemctl shutdown
Power off system poweroff systemctl poweroff
Halt system halt systemctl halt
Reboot system reboot systemctl reboot
Configure default runlevel/target /etc/inittab systemctl set-default
Configure GRUB bootloader /boot/grub/grub.conf /etc/default/grub 
grub2-mkconfig 
grub-set-default

Software management

Task RHEL6 RHEL7
Install software yum install 
yum groupinstall
yum install 
yum group install
View software info yum info 
yum groupinfo
yum info 
yum group info

File systems, volumes, and disks

Task RHEL6 RHEL7
Create/modify disk partitions fdisk 
parted
fdisk 
parted 
gdisk
Default file system ext4 xfs
Enlarge volumes formatted with default filesystem vgextend 
lvextend 
resize2fs
vgextend 
lvextend 
xfs_growfs

Networking

Task RHEL6 RHEL7
Configure name resolution /etc/hosts 
/etc/resolv.conf
/etc/hosts 
/etc/resolv.conf 
nmcli con mod
Configure hostname /etc/sysconfig/network /etc/hostname 
hostnamectl 
nmtui
View network interface info ip addr 
ifconfig 
brctl
ip addr 
nmcli dev show 
teamdctl 
brctl 
bridge
Configure network interface /etc/sysconfig/network-scripts/ifcfg-* /etc/sysconfig/network-scripts/ifcfg-* 
nmcli con [add|mod|edit] 
nmtui 
nm-connection-editor
Configure firewall iptables & ip6tables 
/etc/sysconfig/ip*tables 
system-config-firewall
firewall-cmd 
firewall-config
View ports/sockets netstat 
ss 
lsof
ss 
lsof

  1. Migration Planning Guide: New Installer and Installation Guide 

  2. Migration Planning Guide: New Boot Loader and System Administrator’s Guide: Working with the GRUB 2 Boot Loader 

  3. Installation Guide: Resetting the Root Password 

  4. Some systemd-related commands do not return output. Further information on systemd available at Migration Planning Guide: New Init System and System Administrator’s Guide: Managing Services with systemd 

  5. Migration Planning Guide: New Default File System: XFS and Storage Administration Guide: The XFS File System andInstallation Guide: Reference Table for ext4 and XFS Commands 

  6. Migration Planning Guide: New layout for root file system 

  7. Migration Planning Guide: New Network Naming Schema and Networking Guide: Consistent Network Device Naming 

  8. System Administrator’s Guide: Configuring NTP Using the chrony Suite 

  9. Migration Planning Guide: Desktop and Desktop Migration and Administration Guide: 

  10. Get Started with Red Hat Subscription Management 

  11. Release Notes: MariaDB 5.5 

  12. Migration Planning Guide: Target Management with targetcli 

  13. High Availability Add-On Overview: Overview of Differences Between Releases 

  14. subscription-manager is used for Satellite 6, Satellite 5.6 with SAM and newer, and Red Hat’s CDN. 

  15. RHN tools are deprecated on Red Hat Enterprise Linux 7. rhn_register should be used for Satellite server 5.6 and newer only. For details, see: Satellite 5.6: unable to register RHEL 7 client system due to rhn-setup package not included in Minimal installation 

发表评论

电子邮件地址不会被公开。 必填项已用*标注