Introduction
In this article, we will discuss the issue of an inconsistent HWclock and system clock in Linux 6.1 Yocto 4.2 (Mickelore). We will cover the key concepts related to this problem and provide potential solutions.
Background
The Hardware Clock (HWclock) is a clock that is independent of the operating system and is usually located on the motherboard. It keeps time even when the system is powered off. The system clock, on the other hand, is the clock maintained by the Linux operating system. The HWclock is used to set the system clock at boot time and to synchronize the system clock with the HWclock periodically.
The Issue
The user reports that the command sudo hwclock --verbose fails to synchronize the HWclock with the system clock. The output of the command is as follows:
setting time zone: Etc/UTC
synchronizing clock...
failed: Timeout
Possible Solutions
1. Check the HWclock daemon
The first step is to check if the HWclock daemon is running. Use the following command to check:
sudo systemctl status hwcld
If the service is not running, start it using:
sudo systemctl start hwcld
2. Check the clock source
The next step is to check the clock source. Use the following command to check:
sudo hwclock --status
The output of the command will show the clock source. If it is not set to the HWclock, use the following command to set it:
If the clock source is not set, use the following command to set it:
sudo hwclock --systohc
3. Check the system clock
The next step is to check the system clock. Use the following command to check:
timedatectl status
If the system clock is set to the wrong time, use the following command to set it:
sudo timedatectl set-time "YYYY-MM-DD HH:MM:SS"
- Check if the HWclock daemon is running using
sudo systemctl status hwcld - Check if the clock source is set to the HWclock using
sudo hwclock --status - Check the system clock using
timedatectl status