大网数据广告活动
服务器运维问答

hwclock: Cannot access the Hardware Clock via any known method

· 52CE 我爱测

On a Debian server, I'm having problem with hwclock : $ hwclock --show hwclock: Cannot access the Hardware Clock via any known method. hwclock: Use the --debug option to see the details of our search for an access method. System …

问题原文

原帖链接 · Tombart · CC BY-SA 3.0

On a Debian server, I'm having problem with hwclock:

$ hwclock --show 
hwclock: Cannot access the Hardware Clock via any known method.
hwclock: Use the --debug option to see the details of our search for an access method.

System runs on backports kernel Debian 4.9.18-1~bpo8+1 (2017-04-10).

Here's debug output:

$ hwclock --debug
hwclock from util-linux 2.25.2
hwclock: cannot open /dev/rtc: Device or resource busy
No usable clock interface found.
hwclock: Cannot access the Hardware Clock via any known method.

clocksource:

$ cat /sys/devices/system/clocksource/clocksource0/current_clocksource
tsc

Finally, rtc device exists:

$ ls -l /dev/rtc*
lrwxrwxrwx 1 root root      4 Apr 29 16:41 /dev/rtc -> rtc0
crw------- 1 root root 253, 0 Apr 29 16:41 /dev/rtc0

已采纳解答

原帖链接 · Tombart · CC BY-SA 3.0

The problem seems to be connected to clocksource, check available_clocksource:

$ cat /sys/devices/system/clocksource/clocksource0/available_clocksource
tsc hpet acpi_pm

Based on answer to "What does “clocksource tsc unstable” mean?" it looks like TSC (Time Stamp Counter) is not very reliable.

By updating /etc/default/grub you can switch to another available clocksource. I'm using HPET.

GRUB_CMDLINE_LINUX_DEFAULT="clocksource=hpet"

and updating grub:

update-grub2

After reboot hwclock works again (just reboot without any modification might have helped as well - it might be just question for how long).

NOTE: Optimal clocksource might depend on your motherboard and CPU model.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-05-24)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。