Author Topic: Clock not keeping correct time between reboots  (Read 4892 times)

Offline luikki

  • Hero Member
  • *****
  • Posts: 1422
Re: Clock not keeping correct time between reboots
« Reply #15 on: April 17, 2010, 09:24:55 AM »
thanks blackbird!

surely my problem is different. but then, i'm not sure if it is not related to pclinuxos 2010...
0-93, 2007 and 2009 never had this behavior ...  using or not the ntp servers...
and, again, a different linux flavor doesn't produce this effect... it shows the right software time and bios clock remains correct. ::)
i can live with it... but i like things to perform right.

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6849
  • MLU
Re: Clock not keeping correct time between reboots
« Reply #16 on: April 17, 2010, 09:59:46 AM »
Maybe ntpd is not ticked to start in System Services?


That's possible of course, but it wouldn't really explain the problem: ntpd keeps the system clock synchronized to a time server, while in this case it appears to be the hardware clock that refuses to be synchronized to the system clock....


Oh well I have to admit to being confused so   ;D

I don't know exactly what you mean by systen Vs hardware clocks ......  confusion due to hwclock command I guess which does not change the BIOS clock that I am aware of.

From what little I knew - or thought I knew - about these things I regarded it like this .....

BIOS clock ......  set it manually to local time.

System clock ... the clock of the OS. Normally shows the BIOS clock by default but can be changed. Adjustable in PCC, selecting a different time zone will show an offset time, can be kept in line by using NTP, or indeed can be adjusted by using the command hwclock.
It is my impression that neither hwclock nor NTP make any change to the BIOS clock.

So, if the BIOS clock is correct, and a repeatable 5 hour offset occurs, it seems most likely that the 5 hours is a time-zone offset being applied.


But it seems I am not correctly understanding the clocks and how they interact   >:(


Offline Galaxar

  • Full Member
  • ***
  • Posts: 121
Re: Clock not keeping correct time between reboots
« Reply #17 on: April 17, 2010, 10:20:41 AM »
Ok, just read all the posts! wow.  i went to bed with 6 replies and come back with 15!  :D 

Yes, my timezone is setting to Chicago, which is correct.  I tried setting it to Denver, using UTC, and then reboot and then the time was off by 6 hours.  Now, something interesting occurred this morning.  I went into PCC to set my time.  I went into the settings for my time and date and then pressed the OK button.  After a few seconds, a message popped up saying that it couldn't connect to my time server (I'm using the North American pool server), but my time was corrected!  Any ideas?

Oh, and the nptd service is enabled to start at boot.  Always was.


Galaxar

Online Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6475
  • I'm going South
Re: Clock not keeping correct time between reboots
« Reply #18 on: April 17, 2010, 11:03:30 AM »
Oh well I have to admit to being confused so   ;D

I don't know exactly what you mean by systen Vs hardware clocks ......  confusion due to hwclock command I guess which does not change the BIOS clock that I am aware of.

Try it with the --systohc option and it will. (Or with the -w option.)

The hardware clock is the same as the BIOS clock -- the only clock running when the computer is powered down. A.k.a. the CMOS clock and the Real Time Clock.

Quote
From what little I knew - or thought I knew - about these things I regarded it like this .....

BIOS clock ......  set it manually to local time.

Or programmatically in any number of ways, including using the command  hwclock --systohc.

And why set it to local time? That's a Windows thing.

Quote
System clock ... the clock of the OS. Normally shows the BIOS clock by default but can be changed.

It's normally synchronized to the BIOS (hardware) clock at boot, and if the BIOS clock is set to UTC, the system clock is adjusted according to your time zone. After that the system clock keeps time using any of several kernel clock sources, but it does not continuously show the time of the BIOS clock. The BIOS clock is just used to set the system clock.

Quote
Adjustable in PCC, selecting a different time zone will show an offset time, can be kept in line by using NTP, or indeed can be adjusted by using the command hwclock .

Yes.

Quote
It is my impression that neither hwclock nor NTP make any change to the BIOS clock.

The ntp daemon seems to do it only indirectly. On the other hand, in PCLinuxOS the hwclock command sets the BIOS clock directly in /etc/rc.d/init.d/halt.

Quote
So, if the BIOS clock is correct, and a repeatable 5 hour offset occurs, it seems most likely that the 5 hours is a time-zone offset being applied.

Yes -- if it weren't for the error message Galaxar reported. And the fact that the BIOS clock doesn't seem to be correct.

Quote
But it seems I am not correctly understanding the clocks and how they interact   >:(

Who is?  ;D
« Last Edit: April 25, 2010, 06:47:57 PM by blackbird »
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Offline Galaxar

  • Full Member
  • ***
  • Posts: 121
Re: Clock not keeping correct time between reboots
« Reply #19 on: April 17, 2010, 11:14:17 AM »
Actually, my BIOS clock is correct.  Strange, huh?  Also, would this have anything to do with ACPI?  I can only use acpi=ht or acpi=off on this laptop.  if I try to use acpi=on or acpi=force, it locks up during bootup.

Galaxar

Online Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6475
  • I'm going South
Re: Clock not keeping correct time between reboots
« Reply #20 on: April 17, 2010, 11:54:10 AM »
Actually, my BIOS clock is correct.

But is it set to local time or to UTC? (We seem to be getting back to my very first question.)
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Offline Galaxar

  • Full Member
  • ***
  • Posts: 121
Re: Clock not keeping correct time between reboots
« Reply #21 on: April 17, 2010, 12:02:59 PM »
local time. it's 1:02 pm here now, so it'll say 13:02.

Galaxar

Online Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6475
  • I'm going South
Re: Clock not keeping correct time between reboots
« Reply #22 on: April 17, 2010, 12:16:03 PM »
local time. it's 1:02 pm here now, so it'll say 13:02.

Then UTC should be set to false in /etc/sysconfig/clock. (You can set it from the GUI, but check the file anyway.)
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Offline Galaxar

  • Full Member
  • ***
  • Posts: 121
Re: Clock not keeping correct time between reboots
« Reply #23 on: April 17, 2010, 12:29:45 PM »
Ok, did that, rebooted.  same result.  5 hours back.  *sigh*

Galaxar

Online Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6475
  • I'm going South
Re: Clock not keeping correct time between reboots
« Reply #24 on: April 17, 2010, 01:07:50 PM »
Ok, did that, rebooted.  same result.  5 hours back.  *sigh*

Which makes one suspect that JohnBoy is correct after all. The difference between GMT and US Central Standard Time is six hours. The difference between GMT and your Daylight-Saving Time is five hours.
(Which still doesn't explain why your BIOS clock can't be set at shutdown.)

How do you know that your BIOS clock is correct?
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Offline Galaxar

  • Full Member
  • ***
  • Posts: 121
Re: Clock not keeping correct time between reboots
« Reply #25 on: April 17, 2010, 01:17:50 PM »
Quote
Which makes one suspect that JohnBoy is correct after all. The difference between GMT and US Central Standard Time is six hours. The difference between GMT and your Daylight-Saving Time is five hours.

Exactly what i am thinking.


Quote
How do you know that your BIOS clock is correct?

Because I checked it in the BIOS screen.   :D ;D

Galaxar

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6849
  • MLU
Re: Clock not keeping correct time between reboots
« Reply #26 on: April 17, 2010, 02:30:14 PM »
Quote from: blackbird
Quote from: JohnBoy
From what little I knew - or thought I knew - about these things I regarded it like this .....

BIOS clock ......  set it manually to local time.

Or programmatically in any number of ways, including using the command  hwclock --systohc.

And why set it to local time? That's a Windows thing.

 ;D ;D ;D .....  maybe because all clocks in my house are set to local time   :D   indeed why set it to anything else?  ;)

The hwclock command name is a bit of a misnomer it seems to me.
Using hwclock -r  or indeed hwclock in PCLOS seems to return the system time.
In PCC I can change the time and the time reported by hwclock reports the change.
If the BIOS clock is then checked it reports the time originally set ..  it has not been changed.
So using the GUI provided in PCC does not appear to change the BIOS clock, but the system time.
Rebooting I think retains the system time set rather than syncing to the BIOS clock again.

Still trying to get rid of my confusion   ;) ;)

Offline luikki

  • Hero Member
  • *****
  • Posts: 1422
Re: Clock not keeping correct time between reboots
« Reply #27 on: April 17, 2010, 03:09:20 PM »
and i'm even more confused... ::)  (and frustrated ... it's no big deal but something is not right...)
here,  bios clock is always one hour behind, login screen clock is one hour fast and software clock is correct for my local time...
hwclock has a mind of its  own. sometimes shows the correct local/bios time... sometimes shows one hour fast...
once again: it only happens with 2010 b2, minime 2010 and 2010 final...

Online Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6475
  • I'm going South
Re: Clock not keeping correct time between reboots
« Reply #28 on: April 17, 2010, 04:07:32 PM »
Using hwclock -r  or indeed hwclock in PCLOS seems to return the system time.

Well, according to the documentation hwclock -r and hwclock -show should "read the Hardware Clock and print the time on Standard Output" -- but "in local time, even if you keep your Hardware Clock in Coordinated Universal Time". And that's what the commands seem to do here.

When your computer has been running for a few hours, try the commands
Code: [Select]
hwclock -r && dateThe first one should give you the BIOS time, the second the system time.

Then run
Code: [Select]
hwclock -w and repeat the first two commands.

Quote
In PCC I can change the time and the time reported by hwclock reports the change.

Here too. I don't know what drakclock actually changes, but it seems to have an effect on both system time and hardware time. (And on my ntp daemon, which just got a mild nervous breakdown from all my time changes.)

Quote
If the BIOS clock is then checked it reports the time originally set ..  it has not been changed.

This I'll have to check tomorrow. I don't want to reboot tonight, and you obviously wouldn't trust whatever hwclock reports.

Quote
So using the GUI provided in PCC does not appear to change the BIOS clock, but the system time.
Rebooting I think retains the system time set rather than syncing to the BIOS clock again.

How would the system time be retained after a shutdown if it isn't written to the BIOS clock and restored on reboot?
« Last Edit: April 17, 2010, 04:16:49 PM by blackbird »
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Online Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6475
  • I'm going South
Re: Clock not keeping correct time between reboots
« Reply #29 on: April 17, 2010, 04:13:30 PM »
and i'm even more confused... ::)  (and frustrated ... it's no big deal but something is not right...)
here,  bios clock is always one hour behind, login screen clock is one hour fast and software clock is correct for my local time...
hwclock has a mind of its  own. sometimes shows the correct local/bios time... sometimes shows one hour fast...
once again: it only happens with 2010 b2, minime 2010 and 2010 final...


Precisely what does your /etc/sysconfig/clock look like? (I should probably have asked Galaxar the same question....)
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D