Author Topic: UEFI, Windows 10, Linux and Setting the Time  (Read 2114 times)

0 Members and 1 Guest are viewing this topic.

Offline German_EETopic starter

  • Super Contributor
  • ***
  • Posts: 2399
  • Country: de
UEFI, Windows 10, Linux and Setting the Time
« on: October 27, 2019, 02:17:26 pm »
About six months ago I changed my workshop PC, the new unit is a multi-CPU beast made by Fujitsu and it has a UEFI BIOS. Windows 10 Home was loaded first so that I can talk to my bench instruments and then I loaded Linux Mint. All appeared fine and things have been running without problems until this Sunday.

Then the clocks went back one hour........................

Daylight saving isn't enabled in either the MS Windows or Linux install because until now I've just changed the CMOS time and then got on with life but UEFI seems to be different. I altered the time in the BIOS then found that Linux was correct but Windows 10 showed one hour ahead. So, I altered the time in Windows 10 only to find that the UEFI BIOS time was now one hour out, leading to an error in Linux. For the last fifteen minutes I've been chasing my own damn tail as I alter the CMOS time then find that Windows is incorrect, then alter the Windows setting which also changes the CMOS.

ARRGGGHHHH !  :scared:

Has anyone ever come across a Windows 10 PC that can change it's own UEFI settings, especially the time, and how do I make the system time a read only event?
Should you find yourself in a chronically leaking boat, energy devoted to changing vessels is likely to be more productive than energy devoted to patching leaks.

Warren Buffett
 

Offline Monkeh

  • Super Contributor
  • ***
  • Posts: 8154
  • Country: gb
Re: UEFI, Windows 10, Linux and Setting the Time
« Reply #1 on: October 27, 2019, 02:25:58 pm »
If you don't let the OS alter the RTC time, the drift will likely be a problem.

The issue here, is that Windows stores local time and Linux, by default, stores UTC. There should be some documentation on adjusting that behaviour for your distro somewhere.
 

Offline HoracioDos

  • Frequent Contributor
  • **
  • Posts: 344
  • Country: ar
  • Just an IT monkey with a DSO
 

Offline soldar

  • Super Contributor
  • ***
  • Posts: 3596
  • Country: es
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 
The following users thanked this post: ivan747

Offline German_EETopic starter

  • Super Contributor
  • ***
  • Posts: 2399
  • Country: de
Re: UEFI, Windows 10, Linux and Setting the Time
« Reply #4 on: October 27, 2019, 06:55:02 pm »
Thank you to the two of you, despite working with PCs since the days of DOS the cause of all this was unknown to me and the issue is now fixed.
Should you find yourself in a chronically leaking boat, energy devoted to changing vessels is likely to be more productive than energy devoted to patching leaks.

Warren Buffett
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 7529
  • Country: pl
Re: UEFI, Windows 10, Linux and Setting the Time
« Reply #5 on: October 29, 2019, 05:13:16 pm »
Setting the RTC to UTC is the sane thing to do and I always use that registry trick on dual-boot machines.
However, older versions of Windows had the peculiarity that automatic time synchronization set the RTC back to local time. I simply disabled it and only used NTP on Linux. I have no idea if it's still a problem today.
 
The following users thanked this post: WorBlux

Offline Monkeh

  • Super Contributor
  • ***
  • Posts: 8154
  • Country: gb
Re: UEFI, Windows 10, Linux and Setting the Time
« Reply #6 on: October 29, 2019, 05:16:42 pm »
Setting the RTC to UTC is the sane thing to do and I always use that registry trick on dual-boot machines.

To be fair there's valid argument for using local time as well. Yes, UTC is unambiguous from the software side, but for the user setting their clock or configuring automatic wakeup and such manually, it is not so obvious.

Mind you, I also make the argument that people should drum timezones into their head until they can talk to a TARDIS in its native language..

I suppose the solution is the BIOS (EFI these days) should learn timezones.
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 7529
  • Country: pl
Re: UEFI, Windows 10, Linux and Setting the Time
« Reply #7 on: October 29, 2019, 05:44:07 pm »
To be fair there's valid argument for using local time as well. Yes, UTC is unambiguous from the software side, but for the user setting their clock or configuring automatic wakeup and such manually, it is not so obvious.
You probably setup those things from the OS anyway and OS's are zone-aware. Not a problem.

Mind you, I also make the argument that people should drum timezones into their head until they can talk to a TARDIS in its native language..
No, that's no the argument I make. Macs run their RTCs in UTC and I bet 99% of users don't know about it or don't even realize there is a decision to be made in the first place. It simply is not a problem if software is written correctly. It only is a problem on PC because of the established custom of setting the RTC to local time with all the entailing clusterfuck.

I suppose the solution is the BIOS (EFI these days) should learn timezones.
Hell. No.
Software sucks, doesn't it?
Now imagine software produced by companies who don't even make money selling software. This is what PC firmware is. Bottom of the barrel garbage.
And time zones and DST are difficult to get right. The fact that regulations change around the world doesn't help either. Imagine needing a BIOS update because Russia decided to ditch DST.
« Last Edit: October 29, 2019, 05:48:15 pm by magic »
 

Offline Monkeh

  • Super Contributor
  • ***
  • Posts: 8154
  • Country: gb
Re: UEFI, Windows 10, Linux and Setting the Time
« Reply #8 on: October 29, 2019, 05:53:06 pm »
And time zones and DST are difficult to get right. The fact that regulations change around the world doesn't help either. Imagine needing a BIOS update because Russia decided to ditch DST.

There's no reason timezone data can't be updated from the OS in a standardised format.

Sorry, I should keep sensible ideas away from PC firmware. You really are right there.
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 7529
  • Country: pl
Re: UEFI, Windows 10, Linux and Setting the Time
« Reply #9 on: October 29, 2019, 06:33:15 pm »
Sorry, I should keep sensible ideas away from PC firmware. You really are right there.
Glad that we can at least agree on that :-+

FYI, UEFI supports a standardized way of deleting all its configuration, which it cannot recover on the next reboot and bricks itself.
:-DD

This was discovered when Linux made it visible in /sys and somebody ran rm -rf / by accident. |O
 

Offline LeonR

  • Regular Contributor
  • *
  • Posts: 160
  • Country: br
  • PC hardware enthusiast
Re: UEFI, Windows 10, Linux and Setting the Time
« Reply #10 on: October 31, 2019, 02:39:34 am »
I suggest setting up clock sync to a NTP. From my experience it's less of a pain in the ass with daylight savings, atc.
 

Offline ivan747

  • Super Contributor
  • ***
  • Posts: 2046
  • Country: us
Re: UEFI, Windows 10, Linux and Setting the Time
« Reply #11 on: November 30, 2019, 06:58:39 pm »
Sorry, I should keep sensible ideas away from PC firmware. You really are right there.
Glad that we can at least agree on that :-+

FYI, UEFI supports a standardized way of deleting all its configuration, which it cannot recover on the next reboot and bricks itself.
:-DD

This was discovered when Linux made it visible in /sys and somebody ran rm -rf / by accident. |O

Seriously? Is that still possible? I've done rm -rf on / for fun before, but never under UEFI fortunately.
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 7529
  • Country: pl
Re: UEFI, Windows 10, Linux and Setting the Time
« Reply #12 on: November 30, 2019, 08:45:29 pm »
Of course. There is no known bounds to the incompetence of x86 firmware developers :-DD

https://lwn.net/Articles/674940/
https://www.phoronix.com/scan.php?page=news_item&px=MTI4ODQ

The rm -rf problem has been resolved by making the kernel filter out removal of problematic variables. It shouldn't work today, but I dare you to try ;D
« Last Edit: November 30, 2019, 08:47:10 pm by magic »
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15926
  • Country: fr
Re: UEFI, Windows 10, Linux and Setting the Time
« Reply #13 on: December 01, 2019, 05:52:26 pm »
Well, if any of the UEFI required files are in a directory mounted in the filesystem, of course 'rm -rf /' will delete them.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf