Hardware clock,

Go to solution
all star
Occasional Advisor

Hardware clock,


i have question regarding NTP, system clock and hardware clock.

I have ntp server configured and this would sync only system clock right? how to sync the system clock with hardware clock.

does operating system periodically checks the system clock changes and update with hardware clock? how to automate this process.

Honored Contributor

Re: Hardware clock,

First, some definitions:
- hardware clock = the battery-backed clock on the system board, this is the clock that keeps time when the system is not running.

- system clock = the OS's idea of the current time. At system startup, in a very early phase, the time of the hardware clock is copied to the system clock with "hwclock --hctosys" or a similar command.

When the system is running, the system clock is the "primary" clock. If you don't use ntpd, you must use the "hwclock" command to adjust the hardware clock. The command to copy the system time into hardware clock is "hwclock --systohc".

If you are running ntpd, it will access the kernel's timekeeping functions and report when an accurate timesource is available. When the ntpd has properly synchronized with the timeserver(s), the OS kernel will automatically update the hardware clock according to the system clock. This update happens at 11-minute intervals, if I remember correctly.
Andrea Rossi
Frequent Advisor

Re: Hardware clock,

crontab the following command:
hwclock --systohc