UEFI, Windows 10, Linux and Setting the Time - Page 1
Forum section: electronics / general

author: German_EE
author_rank: Super Contributor
timestamp: October 27, 2019, 02:17:26 pm
content: 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 !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?

author: Monkeh
author_rank: Super Contributor
timestamp: October 27, 2019, 02:25:58 pm
content: 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.

author: HoracioDos
author_rank: Frequent Contributor
timestamp: October 27, 2019, 03:11:58 pm
content: Hello.I guess this is what you need.http://www.webupd8.org/2014/09/dual-boot-fix-time-differences-between.htmlhttp://ubuntuhandbook.org/index.php/2016/05/time-differences-ubuntu-1604-windows-10/

author: soldar
author_rank: Super Contributor
timestamp: October 27, 2019, 06:26:27 pm
content: https://wiki.archlinux.org/index.php/System_time#UTC_in_Windows

author: German_EE
author_rank: Super Contributor
timestamp: October 27, 2019, 06:55:02 pm
content: 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.

author: magic
author_rank: Super Contributor
timestamp: October 29, 2019, 05:13:16 pm
content: 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.

author: Monkeh
author_rank: Super Contributor
timestamp: October 29, 2019, 05:16:42 pm
content: Quote from: magic on October 29, 2019, 05:13:16 pmTo 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.

author: magic
author_rank: Super Contributor
timestamp: October 29, 2019, 05:44:07 pm
content: Quote from: Monkeh on October 29, 2019, 05:16:42 pmYou probably setup those things from the OS anyway and OS's are zone-aware. Not a problem.Quote from: Monkeh on October 29, 2019, 05:16:42 pmNo, 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.Quote from: Monkeh on October 29, 2019, 05:16:42 pmHell. 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.

author: Monkeh
author_rank: Super Contributor
timestamp: October 29, 2019, 05:53:06 pm
content: Quote from: magic on October 29, 2019, 05:44:07 pmThere'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.

author: magic
author_rank: Super Contributor
timestamp: October 29, 2019, 06:33:15 pm
content: Quote from: Monkeh on October 29, 2019, 05:53:06 pmGlad that we can at least agree on thatFYI, UEFI supports a standardized way of deleting all its configuration, which it cannot recover on the next reboot and bricks itself.This was discovered when Linux made it visible in /sys and somebody ranrm -rf /by accident.

author: LeonR
author_rank: Regular Contributor
timestamp: October 31, 2019, 02:39:34 am
content: 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.

author: ivan747
author_rank: Super Contributor
timestamp: November 30, 2019, 06:58:39 pm
content: Quote from: magic on October 29, 2019, 06:33:15 pmSeriously? Is that still possible? I've done rm -rf on / for fun before, but never under UEFI fortunately.

author: magic
author_rank: Super Contributor
timestamp: November 30, 2019, 08:45:29 pm
content: Of course. There is no known bounds to the incompetence of x86 firmware developershttps://lwn.net/Articles/674940/https://www.phoronix.com/scan.php?page=news_item&px=MTI4ODQThe 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

author: SiliconWizard
author_rank: Super Contributor
timestamp: December 01, 2019, 05:52:26 pm
content: Well, if any of the UEFI required files are in a directory mounted in the filesystem, of course 'rm -rf /' will delete them.