# Major Clock drift [SOLVED]

## thompsonmike

My clock is drifting some HUGE amounts. I have NTP running, and after a day it reports that it has corrected the clock by over -100 seconds.

If I turn the computer off, the clock jumps forward hours.

I am running 

```

Linux polaris 2.6.11-hardened-r15 #1 SMP Tue Jun 28 17:42:22 BST 2005 i686 AMD Athlon(tm) XP 2200+ AuthenticAMD GNU/Linux

```

Has any one got any ideas? I dont think it is the CMOS battery, as this machine is on for days and days and days, and it gains time, not loses time when off.

----------

## songpenguin

Well, if it happens when the computer it probably doesn't have anything to do with linux. When NTP reports correcting 100 seconds is that with the computer on or off. This might just affect your clock, in wich case you can try and compromise by having the computer sync with another computer frequently. http://gentoo-wiki.com/HOWTO_NTP . Of course, if it is a fried timing crystal there is probably more than just the time that is malfunctioning.

I have an idea: create a script or a program to ping at a regular interval over an isolated and reliable network at regular intervals and see from the other computer if the wacked computer is timing the pings correctly. Of course you could also make the program switch a serial pin but that would be more work and probably not tell you much more  :Smile: .

Hope this helps,

Songpenguin

----------

## thompsonmike

I am already syncing with NTP........

This affects the computer in when it is turned on, NTP just keeps it in check, but it appears to be a massive amount of corrections going on, then when the machine restarts, the Bios is correct. Linux loads and the time shoots forward a couple of hours.

----------

## songpenguin

Try running a test like I described earlier. And btw, what arch are you using and is it an unstable branch?

Also, this might be a realted post but also new. https://forums.gentoo.org/viewtopic-p-2572375.html#2572375

Hope this helps,

Songpenguin

----------

## thompsonmike

I am running i386 I think, not sure, but it definatly is not unstable (~x86)

I remember reading once before about AMD has a different clock scheme, and NTP was not working.

----------

## thompsonmike

It turned out that kernel 2.6 likes to have the hwclock preferences set

in /etc/conf.d/clock

and in there there is a option for syncing the software clock to the bios clock on shutdown. That was 

not happening, enabled it and the system syncs the software clock with the bios

Now all is happy.

----------

## songpenguin

Great, so the drifts have been going away? I had no idea that the software clock could drift that much untill you posted :-/. I think I'm going to set up the NTP daemon, before I only synced when I booted.

--

Songpenguin

----------

## atrus123

Man, I tried that too, but nothing has changed.

In fact, it seems like linux is changing the bios clock rather than vice-versa.  I set up hc syncing, and now whenever I reboot, the bios is set to the linux clock.. which is running about 3/4 faster.  The seconds in the bios are correct.  Just the hour changes.

I'm syncing with NTP, and it also fails to change the time.

I gain about three hours every hour.  Weird.

J.

----------

