美文网首页
Centos7 系统修复

Centos7 系统修复

作者: 天生小包 | 来源:发表于2020-03-31 15:44 被阅读0次

1、查看系统时间

[root@localhost sysconfig]# timedatectl
      Local time: 一 2017-11-06 21:13:19 CST
  Universal time: 一 2017-11-06 13:13:19 UTC
        RTC time: 一 2017-11-06 13:13:19
       Time zone: Asia/Shanghai (CST, +0800)
     NTP enabled: no
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a

注:发现系统时间和Universal time时间相差8个小时;

2、查看系统时区

[root@localhost sysconfig]# ls /usr/share/zoneinfo/
Africa      Brazil   Egypt    GB-Eire    HST          Japan      Navajo    posixrules  Turkey     zone1970.tab
America     Canada   Eire     GMT        Iceland      Kwaj

3、删除当前系统所处的时区

[root@localhost sysconfig]# sudo rm /etc/localtime

4、从/usr/share/zoneinfo/中创建软连接以替换当前的时区信息

[root@localhost sysconfig]# sudo ln -s /usr/share/zoneinfo/Universal/etc/localtime
#重启系统
[root@localhost sysconfig]#  reboot

5、再次查看系统时间

[root@localhost sysconfig]# sudo timedatectl
      Local time: 一 2017-11-06 13:14:32 UTC
  Universal time: 一 2017-11-06 13:14:32 UTC
        RTC time: 一 2017-11-06 13:14:32
       Time zone: Universal (UTC, +0000)
     NTP enabled: no
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a

6、 安装ntpdate工具

# yum -y install ntp ntpdate

7、 设置系统时间与网络时间同步

# ntpdate cn.pool.ntp.org

8、 将系统时间写入硬件时间

# hwclock --systohc

9、强制系统时间写入CMOS中防止重启失效

# hwclock -w 
或# clock -w

相关文章

网友评论

      本文标题:Centos7 系统修复

      本文链接:https://www.haomeiwen.com/subject/magwuhtx.html