![未来设置的超级块,修复系统时钟](https://linux22.com/image/842353/%E6%9C%AA%E6%9D%A5%E8%AE%BE%E7%BD%AE%E7%9A%84%E8%B6%85%E7%BA%A7%E5%9D%97%EF%BC%8C%E4%BF%AE%E5%A4%8D%E7%B3%BB%E7%BB%9F%E6%97%B6%E9%92%9F.png)
我不断收到有关我的超级块挂载时间在未来的错误消息,并坚持在每次启动时执行 fsck,而且我每次都必须从恢复选项中进入来执行此操作。
以下是我认为可能有帮助的信息,我在启动和 fsck 后运行了这些信息:
Snipped from dump2fs after fsck
Last mount time: Thu Sep 19 17:24:47 2013
Last write time: Thu Sep 19 17:24:47 2013
Mount count: 14
Maximum mount count: -1
Last checked: Thu Sep 19 14:31:17 2013
$ sudo hwclock --debug
hwclock from util-linux 2.20.1
Using /dev interface to clock.
Last drift adjustment done at 1379654884 seconds after 1969
Last calibration done at 1379654884 seconds after 1969
Hardware clock is on local time
Assuming hardware clock is kept in local time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2013/09/20 00:28:37
Hw clock time : 2013/09/20 00:28:37 = 1379662117 seconds since 1969
Fri Sep 20 00:28:37 2013 -0.567722 seconds
$ sudo dpkg-reconfigure tzdata
Current default time zone: 'America/Los_Angeles'
Local time is now: Fri Sep 20 00:32:33 PDT 2013.
Universal Time is now: Fri Sep 20 07:32:33 UTC 2013.
$ date
Fri Sep 20 00:32:20 PDT 2013
$ cat /proc/driver/rtc
rtc_time : 00:32:03
rtc_date : 2013-09-20
alrm_time : 23:41:15
alrm_date : 2013-09-20
alarm_IRQ : no
alrm_pending : no
update IRQ enabled : no
periodic IRQ enabled : no
periodic IRQ frequency : 1024
max user IRQ frequency : 64
24hr : yes
periodic_IRQ : no
update_IRQ : no
HPET_emulated : yes
BCD : yes
DST_enable : no
periodic_freq : 1024
batt_status : okay
$ cat /etc/adjtime
0.000000 1379654884 0.000000
1379654884
LOCAL
我尽快用一个字符串运行了第二次:
date && hwclock --debug && dumpe2fs /dev/sdc3 | head -50
Fri Sep 20 22:06:11 PDT 2013
hwclock from util-linux 2.20.1
Using /dev interface to clock.
Last drift adjustment done at 1379663788 seconds after 1969
Last calibration done at 1379663788 seconds after 1969
Hardware clock is on local time
Assuming hardware clock is kept in local time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2013/09/20 22:06:12
Hw clock time : 2013/09/20 22:06:12 = 1379739972 seconds since 1969
Fri Sep 20 22:06:12 2013 -0.844855 seconds
dumpe2fs 1.42 (29-Nov-2011)
Last mount time: Fri Sep 20 15:04:39 2013
Last write time: Fri Sep 20 14:54:16 2013
Mount count: 21
Maximum mount count: -1
Last checked: Thu Sep 19 14:31:17 2013
答案1
可能是你的 BIOS 电池坏了。这似乎在某些旧笔记本电脑型号中很常见。更换电池可能会解决问题。另一个对我有用的解决方案是告诉 e2fsck 你的时钟坏了:
将以下内容放入/etc/e2fsck.conf:
[options]
broken_system_clock = true
然后你必须把这个 conf 文件添加到你的 initramfs 中。
将以下内容放入/etc/initramfs-tools/hooks/e2fsck-conf.sh:
#!/bin/sh
PREREQ=""
prereqs()
{
echo "$PREREQ"
}
case $1 in
prereqs)
prereqs
exit 0
;;
esac
. /usr/share/initramfs-tools/hook-functions
CONFFILE=/etc/e2fsck.conf
CONFDIR=`dirname "$CONFFILE"`
if [ -f "$CONFFILE" ]
then
mkdir -p ${DESTDIR}${CONFDIR}
cp $CONFFILE ${DESTDIR}${CONFDIR}
fi
然后执行sudo update-initramfs -u
。
来源:Debian 用户论坛。我擅自将 initramfs 钩子脚本写得更详细一些。这纯粹是我的风格偏好。
答案2
答案似乎已经确定这里
Ctrl基本上,用+ Alt+启动终端T。然后输入。
sudo apt-get install ntp
安装完成后,使用以下命令启动服务:
sudo service ntp start