Correcting Clock Drift Manually

All computer systems show clock drift over time - the system time gradually deviates from accurate or "true" time. For many applications, it is important that servers and clients be working to the same time standard, and that drift be prevented or corrected.

Various methods have been devised to correct drift. The simplest and most reliable way is to implement Network Time Protocol (NTP) and receive accurate time signals from a server that is dedicated to that task and maintained to a very high standard of accuracy. This is discussed in NTP on Luna Network HSM 7.

Some situations might not permit maintaining a constant connection to an NTP server. Here we show an example of drift (over several days) and describe how to correct it using the appliance's sysconf drift local drift-correction commands.

To establish time drift and set drift correction

1.Begin drift measurement. This also sets the time. In order to establish the drift and its correction, accurate time must be used when beginning and ending drift measurement. One method is to use NTP on a different computer that has no connection to the Luna Network HSM 7.

lunash:> sysconf drift startmeasure -currentprecisetime <hh:mm:ss>

NOTE   The Luna Network HSM 7 appliance must run uninterrupted for several days to allow a clock drift to occur. Other testing can be done, but nothing that would potentially change the system time (no power-cycles, for example) or the exercise would need to be restarted.

You can check the status of the drift measurement at any time to ensure it has not been interrupted:

lunash:> sysconf drift status

2.Allow the drift measurement system to run for a minimum of 3 days before issuing the stop command. Issue the stopmeasure command with the current accurate time:

lunash:> sysconf drift stopmeasure -currentprecisetime <hh:mm:ss>

The drift measurement is automatically stored.

3.Initialize drift correction. It is best to do this immediately after stopping the measurement cycle, or it might be necessary to redo the measurement. This also resets the current time:

lunash:> sysconf drift init -currentprecisetime <hh:mm:ss>

4.You can check the status of drift correction at any time:

lunash:> sysconf drift status

To set the drift correction rate manually:

1.Set the drift rate (in seconds per day):

lunash:> sysconf drift set

2.Set the current precise time and begin drift correction:

lunash:> sysconf drift init -currentprecisetime <hh:mm:ss>

3.Let drift correction run for at least 3 days, and then check the time against an accurate source to ensure that the drift correction is effective:

lunash:> status time