[SOLVED] Hardware clock

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

[SOLVED] Hardware clock

Postby morgano » Apr 22nd, '24, 12:39

I got confused by time jump in system journal log during boot in one computer i maintain:

Code: Select all
   apr 22 11:18:58 aspire7-kajsa systemd-networkd[809]:     ** dont mind it said on this line, just see the time stamp **
   apr 22 11:39:18 aspire7-kajsa systemd-timesyncd[997]: System clock time unset or jumped backwards, restored from recorded timestamp: Mon 2024-04-22 11:39:18 CEST
   apr 22 11:39:18 aspire7-kajsa systemd-timesyncd[997]: The system is configured to read the RTC time in the local time zone. This mode cannot be fully supported. All system time to RTC updates are disabled.


So it seems that in beginning of booting system use hardware clock which is 21 minutes behind, then something suddenly realise it is wrong and correct it from then on.
As the last cited journal line say, should we change our installer so it always sets up systems to UTC instead (or what is the opposite of local time here)?

I understand the difference may confuse some programs
Code: Select all
  [kajsa@aspire7-kajsa ~]$ date ; sudo hwclock -r
  mån 22 apr 2024 11:53:23 CEST
  2024-04-22 11:32:37.253448+02:00



For now, i set hwclock to system time:
Code: Select all
   [kajsa@aspire7-kajsa ~]$ sudo hwclock -w


And now time corresponds

Code: Select all
   [kajsa@aspire7-kajsa ~]$ date ; sudo hwclock -r
   mån 22 apr 2024 12:25:11 CEST
   2024-04-22 12:25:11.374088+02:00


But apparently it may drift off far. How to avoid that?
Last edited by morgano on Apr 24th, '24, 22:49, edited 2 times in total.
At home & work Mandriva since 2006, Mageia 2011. Thinkpad T40, T43, T60, T400, T510, Dell M4400, M6300, Acer Aspire 7. Workstation using LVM, LUKS, VirtualBox, BOINC
morgano
 
Posts: 1494
Joined: Jun 15th, '11, 17:51
Location: Kivik, Sweden

Re: Hardware clock

Postby Germ » Apr 22nd, '24, 15:02

I used to set the system to local time but the last couple of years I've been using UTC. Although, I've never had your problem either before or after the change.
Starting in 1999: Mandrake > Mandriva > Mageia
Linux User #274693
User avatar
Germ
 
Posts: 725
Joined: Mar 30th, '11, 13:16
Location: Chelsea, Oklahoma USA

Re: Hardware clock

Postby doktor5000 » Apr 22nd, '24, 16:10

Best post the output of
Code: Select all
timedatectl
, and best don't use hwclock directly.
Also please mention whether this is a dual-boot system, it's relevant in what timezone the local clock is stored to the realtime clock.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18073
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Hardware clock

Postby morgano » Apr 22nd, '24, 23:24

Code: Select all
[kajsa@aspire7-kajsa ~]$ timedatectl
               Local time: mån 2024-04-22 23:18:38 CEST
           Universal time: mån 2024-04-22 21:18:38 UTC
                 RTC time: mån 2024-04-22 23:18:39
                Time zone: Europe/Stockholm (CEST, +0200)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: yes

Warning: The system is configured to read the RTC time in the local time zone.
         This mode cannot be fully supported. It will create various problems
         with time zone changes and daylight saving time adjustments. The RTC
         time is never updated, it relies on external facilities to maintain it.
         If at all possible, use RTC in UTC by calling
         'timedatectl set-local-rtc 0'.


This machine is effectively a Mageia 9 only system since previous alternate boot MSW10 killed itself and user have no need to have it fixed :)
At home & work Mandriva since 2006, Mageia 2011. Thinkpad T40, T43, T60, T400, T510, Dell M4400, M6300, Acer Aspire 7. Workstation using LVM, LUKS, VirtualBox, BOINC
morgano
 
Posts: 1494
Joined: Jun 15th, '11, 17:51
Location: Kivik, Sweden

Re: Hardware clock

Postby doktor5000 » Apr 23rd, '24, 18:14

If it's not dualboot then follow the advice
Code: Select all
timedatectl set-local-rtc 0

Also check the option --adjust-system-clock which should only be necessary once.

If the time drift from your logs still happens then it's probably a good time to replace the CMOS battery of your mainboard. ;)
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18073
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Hardware clock

Postby morgano » Apr 24th, '24, 22:48

Thank you :)
Code: Select all
[kajsa@aspire7-kajsa ~]$ timedatectl set-local-rtc 0 --adjust-system-clock
[kajsa@aspire7-kajsa ~]$ timedatectl
               Local time: ons 2024-04-24 22:41:16 CEST
           Universal time: ons 2024-04-24 20:41:16 UTC
                 RTC time: ons 2024-04-24 22:41:18
                Time zone: Europe/Stockholm (CEST, +0200)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

The clock battery yes... Strange there generally seem to lack measurement facility for clock batteries on computers.
At home & work Mandriva since 2006, Mageia 2011. Thinkpad T40, T43, T60, T400, T510, Dell M4400, M6300, Acer Aspire 7. Workstation using LVM, LUKS, VirtualBox, BOINC
morgano
 
Posts: 1494
Joined: Jun 15th, '11, 17:51
Location: Kivik, Sweden

Re: [SOLVED] Hardware clock

Postby benmc » Apr 25th, '24, 08:40

morgano wrote:should we change our installer so it always sets up systems to UTC instead (or what is the opposite of local time here)?


Installer does offer local or UTC during install.
It pays to check that it is actually set as requested though, after install is completed.
benmc
 
Posts: 1218
Joined: Sep 2nd, '11, 12:45
Location: Pirongia, New Zealand

Re: [SOLVED] Hardware clock

Postby morgano » Apr 25th, '24, 11:04

Yes i remember now. Problem is that most users do not know enough to choose. Maybe there should be some short guiding text, and what to search in internet for.

https://wiki.archlinux.org/title/System ... le_systems
https://ubuntuhandbook.org/index.php/20 ... ot-ubuntu/

Optimally all systems should be set to use hardware clock as UTC; if another system use it another way, user should adjust that.
At home & work Mandriva since 2006, Mageia 2011. Thinkpad T40, T43, T60, T400, T510, Dell M4400, M6300, Acer Aspire 7. Workstation using LVM, LUKS, VirtualBox, BOINC
morgano
 
Posts: 1494
Joined: Jun 15th, '11, 17:51
Location: Kivik, Sweden


Return to Basic support

Who is online

Users browsing this forum: Google [Bot] and 1 guest