system time resets to incorrect time after reboot

Ask questions about Arch Linux ARM. Please search before making a new topic.

system time resets to incorrect time after reboot

Postby ctucker » Sat Dec 25, 2021 4:23 pm

I'm working with archlinuxarm on a Raspberry Pi 4 (8GB).

As I write this post the current local time is 2021-12-25 11:15:00 EST

Here is the output from $this->bbcode_second_pass_code('', 'timedatectl status'):

$this->bbcode_second_pass_code('', '
$ timedatectl
Local time: Fri 2021-12-24 16:23:51 EST
Universal time: Fri 2021-12-24 21:23:51 UTC
RTC time: n/a
Time zone: America/New_York (EST, -0500)
System clock synchronized: no
NTP service: active
RTC in local TZ: no
')

I can set system clock to the correct time by first, stopping automatic time synchronization then, manually synchronizing:

$this->bbcode_second_pass_code('', '
$ sudo systemctl stop ntpd

$ sudo ntpd -gq
')

The output from the "ntpd" command adjusts the system clock forward approx 18 hours i.e.$this->bbcode_second_pass_code('', '+65983.561187 s')

To test if the correct time will "stick" I reboot the machine. It consistently resets to $this->bbcode_second_pass_code('', 'Fri 2021-12-24 16:23:51 EST')

How do I troubleshoot this issue?
ctucker
 
Posts: 1
Joined: Sat Dec 25, 2021 3:49 pm

Re: system time resets to incorrect time after reboot

Postby ufo6000 » Sun Dec 26, 2021 11:54 am

Your device has not RTC, so the time is lost after every reboot.

Saving the time/date to a last known valid value is done by fake-hwclock.service, incl. restore at boot.
Check if this service is enabled and running error-free, also fake-hwclock-save.timer.

You don't need ntpd, systemd-timesyncd will do well too.
I think ntpd does not like huge time steps, I saw you forced it already manually.
Instead of ntpd chrony will do better on a pi, but check out systemd-timesyncd first.
ufo6000
 
Posts: 117
Joined: Fri Jan 22, 2016 7:54 pm

Re: system time resets to incorrect time after reboot

Postby robg » Sun Dec 26, 2021 6:40 pm

Kindly post the output of `systemctl status` and `uname -a`.
robg
 
Posts: 186
Joined: Tue Jan 05, 2021 8:22 am


Return to User Questions

Who is online

Users browsing this forum: No registered users and 11 guests