工作笔记 — NTP (Linux上的时间同步服务。

NTP是一个同步世界时间的标准。

电脑由于某些设计上的天生缺陷,在长时间运作后,它的时间都会慢慢的不准。而通过NTP就可以让它自动调整。这个功能在服务器上尤其重要。

在Linux系统上,NTP自动调整可以通过ntpd这个小程序达成。

指令:service ntpd status
用于检查ntpd是否有在运作。

指令:ntpdate my.ntp.server.url1 my.ntp.server.url2 …
用于手动同步时间。如果ntpd正在运作,这个指令将返回『the NTP socket is in use, exiting』错误讯息。
ntp server可以用time.windows.com或time.apple.com。或者一些公开的NTP Free Server都可以。

指令:date
检查目前系统的日期和时间。

——————-

问题解决:
如果面对在手动更新时发现以下问题时。。。

[root@web54 root]# ntpdate ca.pool.ntp.org
7 Jan 00:44:33 ntpdate[28185]: sendto(216.234.161.11): Operation not permitted
7 Jan 00:44:34 ntpdate[28185]: sendto(216.234.161.11): Operation not permitted
7 Jan 00:44:35 ntpdate[28185]: sendto(216.234.161.11): Operation not permitted
7 Jan 00:44:36 ntpdate[28185]: sendto(216.234.161.11): Operation not permitted
7 Jan 00:44:37 ntpdate[28185]: no server suitable for synchronization found

请检查你的防火墙是否已经打开了Port 123。

Linux视频比赛

用户插入图片

在今年初进行的Linux视频比赛结果出来了。刚刚才看到得到优胜的几个成品,都非常强。

这里和大家分享两个个人觉得蛮不错的参赛作品。

[#M_《按我看成品1: 首奖作品 — What does it mean to be Free?》|《按我关闭》| _M#]
[#M_《按我看成品二:五强作品 — Linux Pub》|《按我关闭》| _M#]

Linux指令 – Fdisk及相关

从绿色工厂看来的经验,想到往后可能会遇到同样的事情,所以在此做个记录:

  • Linux中的fdisk,在删除extended partition时,partition id会向上递补的,但primary partition则没有这个问题。所以在设置fstab时,最好的设置方法还是把LABEL加进去。否则一旦不小心,partition id修改了,但没有更新到fstab中的设置时,问题可大可小。
  • 要检查LABEL,可使用dumpe2fs /dev/hdxx即可。

真的是不错的经验。又学到新东西了。

谁说部落没有好料的?