在安装完系统有时会发现系统时间与现在时间相差8小时,这是由于在安装系统时选择的时区是上海,而系统默认bios时间是utc时间,所以时间相差了8小时。这个时候的bios的时间和系统的时间是不一致的,一个代表 utc 时间,一个代表cst(+8时区),即上海时间。

当前系统时间:

[root@justin ~]# date
Mon Jan 13 07:07:48 CST 2014
[root@justin ~]# date -R
Fri, 18 Dec 2015 08:19:40 +0800

修正时间:

1、设置TUC、ARC为false,硬件时钟不于utc时间一致

[root@justin ~]# vim /etc/sysconfig/clock
# The time zone of the system is defined by the contents of /etc/localtime.
# This file is only for evaluation by system-config-date, do not rely on its
# contents elsewhere.
ZONE="Asia/Shanghai"
UTC=false
ARC=false

2、设置linux的时区设置为上海

[root@justin ~]# ln -sf /usr/share/zoneinfo/Asia/Shanghai    /etc/localtime

3、校对时间,需要先安装ntp服务器

[root@justin ~]# rpm -q ntp
package ntp is not installed
[root@justin ~]# yum -y install ntp
[root@justin ~]# rpm -q ntp
ntp-4.2.6p5-1.el6.centos.i686
[root@justin ~]# ntpdate ntp1.nl.net
18 Dec 08:31:04 ntpdate[50047]: the NTP socket is in use, exiting
[root@justin ~]# service ntpd stop
[root@justin ~]# ntpdate ntp1.nl.net     ;ntp后面是数字1,n后面是字母l
13 Jan 15:29:40 ntpdate[1531]: step time server 193.79.237.14 offset -8.976068 sec
[root@justin ~]#

4、设置硬件时间与系统时间一致并校准

[root@justin ~]# /sbin/hwclock --systohc
[root@justin ~]#

也可以用一条命令来搞定,如果对时间要求很严格最好用同步的方式

date -s "20151218 08:30:50" &&hwclock --systohc

至此,linux系统时间和计算机硬件时间都是cst时间了,并且为上海时区。

Tips:

[root@justin ~]# hwclock --help
hwclock - query and set the hardware clock (RTC)
Usage: hwclock [function] [options...]
Functions:-r | --show         read hardware clock and print result #读取硬件(BIOS)时间,并显示出来-s | --hctosys      set the system time from the hardware clock #把目前系统时间调整为硬件时间-w | --systohc      set the hardware clock to the current system time #把硬件时间调整为目前系统的时间--systz        set the system time based on the current timezone #把系统时间设置为当时时区的时间
Options:-u | --utc          the hardware clock is kept in UTC #设置硬件为的UTC时间--localtime    the hardware clock is kept in local time #设置硬件为本地时间

修改背景图片需要使用工具p_w_picpathmagick

1、安装Imagemagick

[root@justin ~]# yum install ImageMagick*
Loaded plugins: fastestmirror, product-id, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
Determining fastest mirrors
...
Replaced:libjpeg.i686 0:6b-46.el6
Complete!
[root@justin ~]#

2、上传背景图片到服务器,使用convert命令处理图片,GRUB使用的图像为14色,尺寸为640x480,然后修改splashp_w_picpath后面的参数

使用winscp将背景图片123.jpg上传到服务器(点击下载winscp)

[root@justin src]# cd /usr/local/src/ && ls
python-iniparse-0.3.1-2.1.el6.noarch.rpm  yum-3.2.29-40.el6.centos.noarch.rpm
RPM-GPG-KEY-CentOS-6                      yum-metadata-parser-1.1.2-16.el6.i686.rpm
wx.jpg                                    yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
[root@justin src]# convert wx.jpg -resize 640x480! -colors 14 wx.xpm
[root@justin src]# gzip wx.xpm
[root@justin src]# cp wx.xpm.gz /boot/grub/
[root@justin src]# cd !$
cd /boot/grub/
[root@justin grub]# cp menu.lst menu.lstbak
[root@justin grub]# vim menu.lst
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/sda2
#          initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashp_w_picpath=(hd0,0)/grub/wx.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux (2.6.32-279.el6.i686)root (hd0,0)kernel /vmlinuz-2.6.32-279.el6.i686 ro root=UUID=d8fe6590-fe20-451e-b5b9-dad15893db25 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quietinitrd /initramfs-2.6.32-279.el6.i686.img

3、重启查看是否生效

已生效

###########################################################

关注微信公众平台,了解最新动态

Linux交流QQ群:333212786

PS:由于学习阶段部分不确定性文章会暂时隐藏,后期会公开,新公开和修正的文章会

通过微信公众平台(justin_rsdd)给出提示,欢迎关注,同时也希望得到大家的指点!

##############################################################

转载于:https://blog.51cto.com/ityunwei2017/1335952

RHEL6基础三十七之系统时间修正、GRUB背景图片修改相关推荐

  1. win10系统自定义日历应用背景图片怎么设置

    Win10系统与win7系统的差别还是非常大的,比如win10系统的正式版,自带了功能强大的日历应用,不足之处就是日历应用的背景默认的都是一张图片,如果想特立独行换一个自己喜欢的背景图片也是可以的.下 ...

  2. 锁定计算机 背景图片,浅谈win7系统中电脑开机的背景图片修改方法

    在操作电脑中无奇不有,为了让电脑变得更有个性,特别用户就想改掉原有的经典的WINDOWS开机背景,换上自己喜欢的开机背景图片,在win7系统下对于怎么设置这个过程,下面豆豆来详细介绍下修改方法. 浅谈 ...

  3. windows系统开机自动进行NTP时间同步和系统时间修正

    提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档 文章目录 前言 一.环境介绍 二.使用步骤 1.SymmTime配置 运行情况 前言 NTP是一种常用的时间同步方式,同步精度可以达到 ...

  4. asp.net站点时间格式与系统时间格式不一致。手动修改

    asp.net站点时间格式与系统时间格式不匹配时,当修改系统时间格式,站点时间可能还是旧的格式.则可通过修改注册表更新时间格式. 1.开始-运行-输入regedit,依次找到HKEY-Users\.D ...

  5. 电脑表格日期怎么修改原有日期_为何电脑系统时间常出错或无法修改?怎么解决?...

    简介 电脑系统出现的问题可谓层出不穷,千奇百怪.这不,有朋友就遇到电脑系统时间无法修改或者修改后很快就出错的问题,而且有时候在修改时会出现"没有权限,无法更改"的类似信息.这是怎么 ...

  6. ios7系统圆角按钮有背景图片还显示为蓝色

    做项目时发现,在ios7以下的按钮都会按照背景图片显示,但是到了ios7的系统按钮标题会变成蓝色,最后找到原因是按钮初始化时设置成了UIButtonTypeRoundeRect类型,导致的,并且这个类 ...

  7. RHEL6基础三十一之服务器维护基础命令②awk

     格式:awk -F '[分隔符]' '{pattern + action}' filename[s] 工作方式:awk对指定filename[s]逐行扫描,从第一行到最后一行,读入有'\n'换行符分 ...

  8. RHEL6基础三十四之服务器维护基础命令④sort、uniq

    sort 格式:sort [-options] filename[s] 功能:将文件的每一行作为一个单位,相互比较,最后将他们按升序输出,比较原则是从首字符向后,依次按ASCII码值进行比较. 1 2 ...

  9. xXx时间屏保+背景图片

    2019独角兽企业重金招聘Python工程师标准>>> 好看的背景图片与桌面壁纸的组合 二少曾用网址:www.juku8.com.www.un69.cc,目前使用www.uxyz.v ...

  10. 【笔记】系统和内核版本用户系统时间YUM仓库selinuxfirewalld

    系统版本号 查看版本号的方式: 第一方方法: 通过查看配置文件 [root@ahui ~]# cat /etc/redhat-release CentOS Linux release 7.8.2003 ...

最新文章

  1. 比ewsa更快的跑包工具_重庆单肩包订购,编织布袋定做厂家
  2. 本周测试服务器角色转移系统仅开放转入,5月24日维护公告 角色转移系统全服放出...
  3. ubuntu-11.10-server-i386学习笔记-SVN版本服务器安装
  4. MySQL调优(二):数据类型和schema优化,MySQL8.0取消查询缓存的原因
  5. C语言高级编程:如何确定一个变量是有符号还是无符号数
  6. H.264可伸缩编码SVC
  7. LeetCode 118. Pascal’s Triangle
  8. MFC PreTranslateMessage介绍
  9. 深入理解分布式之抉择分布式锁
  10. z变换解差分方程例题_中级数学4 - 多元线性方程
  11. linux内存源码分析 - 伙伴系统(释放页框)
  12. flex measure
  13. 关于计算机科学与技术二级学科的一点介绍
  14. 网站推荐:快速查询 “中国传统配色” 的色值和色名
  15. Ubuntu下搜狗输入法突然无法输入中文解决方案
  16. Cadence Allegro 板框倒角设置方法
  17. OSChina 周四乱弹 —— 你妈是洗衣机的亲妈
  18. 《蓝莓之夜》经典台词
  19. Java 面试/笔试题神整理 [Java web and android]
  20. c语言struct结构体类型有关typedef定义的本名和别名

热门文章

  1. openssl代码领读目录
  2. Scrapy输出CSV指定列顺序
  3. 【转载】快速掌握一个语言最常用的50%
  4. what's the differences between readonly const in C# 在C#中readonly和const的区别
  5. 关于python字符串format的一些花式用法
  6. 【t092】迷之阶梯
  7. WIN8禁用休眠功能
  8. map.entryk,v小用法(转)
  9. 创建你的第一个游戏Pong——概览
  10. TFS小记(3):建立团队项目