LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-03-2016, 02:18 PM   #1
drgibbon
Senior Member
 
Registered: Nov 2014
Distribution: Slackware64 15.0
Posts: 1,217

Rep: Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942
14.2 not getting hardware time on boot up (resets to 1970)


On my ThinkPad X200 (with libreboot), the system time is being reset to Thursday Jan 1st 1970 on every reboot with 14.2 (there was no problem on 14.1). I tried everything here, but nothing sticks after a reboot. The error in dmesg is;

Quote:
Setting system time from the hardware clock (localtime): hwclock ioctl(RTC_RD_TIME) to /dev/rtc to read the time failed: Invalid argument
The same error occurs with 'hwclock --show' from the command line. The only thing that makes 'hwclock' work is running 'hwclock --systohc --localtime' but this doesn't seem to persist after a reboot.
 
Old 07-03-2016, 02:44 PM   #2
Keruskerfuerst
Senior Member
 
Registered: Oct 2005
Location: Horgau, Germany
Distribution: Manjaro KDE, Win 10
Posts: 2,199

Rep: Reputation: 164Reputation: 164
Then the Bios battery is empty.
 
Old 07-03-2016, 02:49 PM   #3
drgibbon
Senior Member
 
Registered: Nov 2014
Distribution: Slackware64 15.0
Posts: 1,217

Original Poster
Rep: Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942
Quote:
Originally Posted by Keruskerfuerst View Post
Then the Bios battery is empty.
And this occurred at the exact moment I installed 14.2? I found this bug report, but it doesn't help me too much.
 
Old 07-03-2016, 03:03 PM   #4
Gerard Lally
Senior Member
 
Registered: Sep 2009
Location: Leinster, IE
Distribution: Slackware, NetBSD
Posts: 2,177

Rep: Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761
Quote:
Originally Posted by drgibbon View Post
And this occurred at the exact moment I installed 14.2?
Before installing 14.2 had you been hibernating the laptop or doing a complete shutdown? I could be wrong here, but I think you wouldn't have noticed a dead CMOS battery if you had been hibernating. Only when you booted from USB or DVD to install 14.2 would the problem have become apparent. Again, I could be wrong about this.
 
Old 07-03-2016, 03:05 PM   #5
drgibbon
Senior Member
 
Registered: Nov 2014
Distribution: Slackware64 15.0
Posts: 1,217

Original Poster
Rep: Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942
Quote:
Originally Posted by gezley View Post
Before installing 14.2 had you been hibernating the laptop or doing a complete shutdown? I could be wrong here, but I think you wouldn't have noticed a dead CMOS battery if you had been hibernating. Only when you booted from USB or DVD to install 14.2 would the problem have become apparent. Again, I could be wrong about this.
I had never bothered to set up hibernation on 14.1 (fully encrypted with LUKS/LVM), so always a complete shutdown.

I suppose I could install 14.1 again to test it.
 
Old 07-03-2016, 03:11 PM   #6
drgibbon
Senior Member
 
Registered: Nov 2014
Distribution: Slackware64 15.0
Posts: 1,217

Original Poster
Rep: Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942
On second thought Keruskerfuerst might be right if the 14.1 installation was just getting the time from NTP always, although I don't remember the time ever being 1970 if I had the WiFi switched off. I will have to test it and report back.
 
Old 07-03-2016, 03:20 PM   #7
drgibbon
Senior Member
 
Registered: Nov 2014
Distribution: Slackware64 15.0
Posts: 1,217

Original Poster
Rep: Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942
Well, booting from a freshly copied Ubuntu LiveUSB at least shows the proper date and time (although it still gives this error about reading the hardware clock). Hard to understand what's going wrong.
 
Old 07-03-2016, 03:22 PM   #8
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Just change the battery...

By which I just mean that there is no need look for any other cause until you do that.

What are the odds that it would go dead during the same time as the new install?

Ask it a different way, what are the odds of the battery eventually going dead? 100%.

What are the odds that you will be using the system for some purpose, including fresh install, when you notice it has happened?

Last edited by astrogeek; 07-03-2016 at 03:37 PM. Reason: Typos, added comment
 
Old 07-03-2016, 03:39 PM   #9
drgibbon
Senior Member
 
Registered: Nov 2014
Distribution: Slackware64 15.0
Posts: 1,217

Original Poster
Rep: Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942
Quote:
Originally Posted by astrogeek View Post
Just change the bttery...
It's not dead I just tested changing the BIOS time with hwclock using a 14.1 boot USB; no problem at all. I can set the date, power down, and boot back into the 14.1 USB and the right time is reported from hwclock (with no errors). But then when I switch to 14.2, I'm back to 1970 and "ioctl(RTC_RD_TIME) to /dev/rtc to read the time failed: Invalid argument" from hwclock. So I'm certain that this is not a hardware/battery problem.
 
1 members found this post helpful.
Old 07-03-2016, 03:45 PM   #10
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Hmmm... interesting, but not conclusive.

Does it remain correct in the BIOS (I mean as seen in the BIOS setup), but only reported incorrectly by Slackware 14.2? Or after booting to 14.2, if you then enter the BIOS setup, does it also have an incorrect date/time?

The only definitive way to say it is not the battery, is to change the battery.

Last edited by astrogeek; 07-03-2016 at 03:58 PM.
 
Old 07-03-2016, 03:58 PM   #11
drgibbon
Senior Member
 
Registered: Nov 2014
Distribution: Slackware64 15.0
Posts: 1,217

Original Poster
Rep: Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942
Quote:
Originally Posted by astrogeek View Post
Does it remain correct in the BIOS (I mean as seen in the BIOS setup), but only reported incorrectly by Slackware 14.2? Or after booting to 14.2, if you then enter the BIOS setup, does it also have an incorrect date/time?
As far as I know, there is no BIOS setup with libreboot (just a grub payload). But I can put it this way:

1) Start with machine powered off.
2) Boot 14.1 USB -> Set time/date manually with 'date --set' -> sync with 'hwclock --systohc --localtime' (no error) -> Power down.
3) Boot 14.1 USB -> 'hwclock' returns the correct time/date (no error) -> Power down.
4) Boot 14.2 -> 'hwclock' returns "hwclock: ioctl(RTC_RD_TIME) to /dev/rtc to read the time failed: Invalid argument" -> System time is Thu 1st Jan 1970, 10AM -> Power down.
5) Boot 14.1 USB -> 'hwclock' returns Thu Jan 1st 1970 10AM (no error).

Perfectly repeatable unfortunately. No way the problem is a flat battery.

Last edited by drgibbon; 07-03-2016 at 04:06 PM. Reason: added one more step
 
1 members found this post helpful.
Old 07-03-2016, 04:10 PM   #12
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Way!

The fact that you must reset it in 14.1 indicates that it is in fact incorrect in the hardware clock (BIOS).

The fact that 14.1 reads it and 14.2 does not may result from any number of parameters from different access patterns, different timings, everything that has gone before during the boot which affects BIOS battery drain... with a marginal battery voltage one kernel might easily trip it while the other does not.

There _may_ be some other cause, but until you have actually changed the battery, you have not eliminated the battery as the possible cause. Eliminate the obvious first.

(Meanwhile, I am actually looking into other possible causes - but for confidence, how old is this system, and presumably the CMOS battery? What are the basic system specs, CPU, motherboard, etc.?)

Last edited by astrogeek; 07-03-2016 at 04:21 PM.
 
Old 07-03-2016, 04:31 PM   #13
drgibbon
Senior Member
 
Registered: Nov 2014
Distribution: Slackware64 15.0
Posts: 1,217

Original Poster
Rep: Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942
Quote:
Originally Posted by astrogeek View Post
Way!

The fact that you must reset it in 14.1 indicates that it is in fact incorrect in the hardware clock (BIOS).
You do not understand. Nothing needs to be "reset" in 14.1, I was just making the point of showing that it had been set in the example to be clear (it's a non-persistent USB). Step 3 (powering down and booting back into 14.1) can be repeated ad infinitum (i.e. normal computer use), nothing changes with the hardware clock, nothing needs to be reset. The hardware clock stays accurate permanently; that's not difficult to understand. The only thing that introduces the failure is booting into 14.2 (step 4).

To put it as simply as possible, when I use only 14.1 there is never any problem with the hardware clock. The time persists across boots (even into a non-persistent USB). hwclock does not throw errors. As soon as I boot into 14.2, I get errors from hwclock and the time is reset to 1970.

The machine is this. Yes it's old. If I am inclined to, I will just return to 14.1 and let the issue rest. But I would like to use 14.2, hence I would like to see if I can fix this. Changing the battery is not the answer when I have already demonstrated that 14.1 functions as expected.
 
Old 07-03-2016, 04:46 PM   #14
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Quote:
Originally Posted by drgibbon View Post
You do not understand. Nothing needs to be "reset" in 14.1...
But from your steps above...

Quote:
Originally Posted by drgibbon View Post
...
4) Boot 14.2 -> 'hwclock' returns "hwclock: ioctl(RTC_RD_TIME) to /dev/rtc to read the time failed: Invalid argument" -> System time is Thu 1st Jan 1970, 10AM -> Power down.
5) Boot 14.1 USB -> 'hwclock' returns Thu Jan 1st 1970 10AM (no error).
...which would indicate that the hardware clock (i.e. battery) is in fact dead...

Differences in configuration between your 14.1 and 14.2 defaults may be masking that from your perspective in some way, but from here all indications are that the CMOS battery is toast.

I am not familiar at all with that brand, but it would be unusual if it did not have some UEFI/BIOS access. It might be worth looking into their support docs or even emailing them, but that could answer this and many other questions.

Anyway, I hope you get it sorted, just trying to helpful.

Hopefully someone else can jump in here with other ideas.

Last edited by astrogeek; 07-03-2016 at 04:50 PM.
 
Old 07-03-2016, 05:13 PM   #15
drgibbon
Senior Member
 
Registered: Nov 2014
Distribution: Slackware64 15.0
Posts: 1,217

Original Poster
Rep: Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942
Quote:
Originally Posted by astrogeek View Post
...which would indicate that the hardware clock (i.e. battery) is in fact dead...
The whole point of the exercise was to show that the hardware DOES keep time; except when 14.2 is booted. If the battery is really dead (hardware), how can it possibly be keeping time across a full power down and non-persistent boots of the Slackware 14.1 installer? What software could possibly make dead hardware work?

Quote:
Originally Posted by astrogeek View Post
Differences in configuration between your 14.1 and 14.2 defaults may be masking that from your perspective in some way, but from here all indications are that the CMOS battery is toast.
As I've tried to show many times; the hardware works. If this battery is "toast" then 14.1 must be a very magical release

Quote:
Originally Posted by astrogeek View Post
I am not familiar at all with that brand, but it would be unusual if it did not have some UEFI/BIOS access. It might be worth looking into their support docs or even emailing them, but that could answer this and many other questions.
Libreboot BIOS settings (not really a brand btw). Yes, I will keeping trying and contact the libreboot devs.

Quote:
Originally Posted by astrogeek View Post
Anyway, I hope you get it sorted, just trying to helpful.
I appreciate the effort.
 
2 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux resets every time is reboots or shuts down willblister Linux - Newbie 2 05-30-2015 07:40 PM
[SOLVED] ibus Chinese input resets to English every time Pedroski Linux - Software 5 08-24-2011 08:14 AM
system time since 1970 culin Programming 4 02-19-2007 02:43 AM
redhat 9.0 randomly resets time rioguia Linux - Newbie 2 09-21-2004 12:55 PM
Time resets magically.... itsjustme Linux - General 2 04-27-2003 09:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration