I've got an AMD Athlon XP-2500+ host (Shuttle MN31 motherboard, nForce 2 IGP + MCP-T chipset) running 32-bit Ubuntu 9.10 (i686 2.6.31-20-generic kernel). Unfortunately, it appears that the clock drift on it is so bad (it advances close to an extra second every minute) that ntpd can't keep the machine in sync.
How do I deal with this so I can get ntpd working?
The solution is to use the adjtimex package to let your kernel know how much time really elapses during each kernel tick. If it's idea is different from reality, the system clock will run more quickly or more slowly. I quote from Making NTP Work on Hardware with Large Clock Drift:
The issue may be one of several clocks or timers are particularly inaccurate or possibly defective oscillator or timer / clock (including RTC) passive components (quartz crystal, and any related capacitors). If this is the cause you may not be able to entirely work around it, if accurate time is critical to you.
The nVidia nForce2 chipset for motherboards is known to be very erratic. There is also the possibility that APIC and ACPI, Variable Speed Processors, and Front Side Bus (FSB) Spread Spectrum (SS) oscillators / clock issues effecting accuracy. One potential software (kernel) issue is with some versions of 2.6.x kernel mis-detecting the TSC (timestamp counter) frequency, and some AMD processors adjust TSC based on the processor's core clock speed (i.e for power-saving, similar to SpeedStep in Intel processors).
If you haven't already, look at NTP documentation for Troubleshooting problems with NTP.
If none of the above reduce the clock's erratic behaviors, then you can Manually Calibrate it using adjtimex and NTP. Be sure to delete any existing NTP drift files
/var/lib/ntp/ntp.drift
on Ubuntu, may be located in /etc/ntp/ on some other Unix/Linux systems) or entries in ntp.conf.Apologies for possibly stating the obvious, but ensure you have 3 or 4 reachable NTP servers included in the NTP config file (typically
/etc/ntp.conf
or similar). And please use (public) servers "close" to you. Most ISP or network providers offer free access to their own internal NTP server, use it. otherwise use public servers from http://pool.ntp.org/, preferably located in your province/state or at least country.My current hack is to run ntpdate once a minute from root's crontab. This moves the time back by just under a second every minute. I'm not very happy with this solution. However, it does demonstrate the consistency of the drift:
You can edit the configuration file (/etc/ntp.conf, usually) to set a couple of helpfull things, such as minpoll:
Try removing the "-g" option from ntpd's command line options.