Hardware time ok, system time not ok

Nathan Stratton Treadway ubuntu.lists at nathanst.com
Wed Jan 19 19:22:41 UTC 2011


On Wed, Jan 19, 2011 at 09:11:57 -0300, Jorge Andres Brugger wrote:
> This is a standard practice? Sounds a little tricky ... Why the system 
> time goes crazy? (hw clock is ok)


Yes, if you want your system time to be as accurate as possible, leaving
ntpd running all the time is your best bet.  It will continually
compare your local (kernel) clock against the "true" time and adjust
the speed at which your clock runs so that it stays as accurate as
possible.

However, if your system time is really getting several minutes out of
whack within a few hours, then you are probably correct that something
else is going on, and it's likely to be worth trying to figure out what
that is.  Unfortunately there are many possibilities and it's hard to
guess here what would be the one on your system....

A couple ideas/things to look at:

  * really make sure that nothing else is trying to change your clock.

    For example, check your "ps" output and startup scripts to make sure
    that you aren't running "ntpd" or "openntpd" or anything like that,
    and make sure that there aren't any other cron jobs that might set
    the time.


  * make sure you aren't using any devices or device drivers that
    disable interrupts.

    (For example, I found that on my old Dell Inspiron 8000 laptop, if I
    installed the "i8k" module and then ran a program that continually
    showed me my battery status, the system would suddenly start loosing
    time like crazy -- apparently, the act of reading the battery status
    from the BIOS caused many timer interrupts to be lost.)


  * monitor the hwclock v.s. system time difference every minute over the
    course of a day to see if the times grow apart at a steady rate or in
    jumps.  (If it happens in jumps, try to figure out what else is going
    on on your system when those jumps happen.)


  * post here the midnight cron script that you are currently running to
    set the clocks.  Also, what does /var/lib/ntp/ntp.drift contain?


						Nathan




More information about the ubuntu-server mailing list