Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Hardware clock



On Fri, 19 Nov 1999 cprincipe at mindspring.com wrote:

> If you want a kludge when adjusting your time, you can adjust your
> time a couple of times in a row.  This alters the drift rate in
> /etc/adjustime (as far as I can tell.)

Yep.  I ended up figuring this out because I just had a similar problem
with my own RH 6.1 workstation.  All of a sudden, when you reboot your
system, the clock gets set to some strange time (in my case, exactly
1.5 hours fast), and despite resetting the time, after rebooting Linux 
it gets screwed up again... 

What you should do is this:


1) DELETE /etc/adjtime
2) Set the system time with 
   
  date -s 15:00   (this assumes it's 3pm - obviously use the right time!)

3) use the hwclock command to set the hardware clock, like this:

  hwclock --systohc

If your system is using UTC (Or Grenwich Mean Time as it was called
previously) be sure to also use the --utc option on hwclock.

Alternately, using 

  hwclock --set <time/date arg> 

a couple of times in succession should also work.


The problem was caused (at least in my case) by setting the time in a
manner not consistent with the way RH sets the system time (i.e. setting
the clock from the BIOS).

See the relevant discussion about the --adjtime option in the hwclock
manpage, and then look at /etc/rc.d/rc.sysinit to see what RH is doing to
set the clock, for specific details.

Basically, setting the system clock any way other than from Linux, using
hwclock screws up the system clock, because redhat adjusts the hardware
clock at boot time based on the difference between the system clock and
the hardware clock on two consecutive boots.  By setting the system clock
manually (from BIOS, or from within Windows), you completely hose that
scheme.

I don't particularly like the way RedHat does this by default, but so long
as you only change your hardware clock from Linux using hwclock, you will
never have any problem.  I do think they should ask you if you want to do
this when you install the system though... many Linux users are still
using multi-boot systems, and, for example, if you are in Windows when a
Daylight Savings Time change occurs and windows changes your clock, the
second time after that you boot into Linux your clock will be screwed up,
and most people will have no idea why...

Of course, this is probably mentioned in the Reference Guide, which
admittedly I did not read...  :)


-- 
Derek D. Martin
Senior UNIX Systems/Network Administrator
Arris Interactive
derek.martin at ne.arris-i.com

-
Subcription/unsubscription/info requests: send e-mail with
"subscribe", "unsubscribe", or "info" on the first line of the
message body to discuss-request at blu.org (Subject line is ignored).




BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org