dmesg: Invalid time in clock: check and reset the date

Matthew Seaman m.seaman at infracaninophile.co.uk
Sat Oct 11 07:50:22 UTC 2008


Richard Smith wrote:
> Hi, I've just installed FreeBSD 7.0 Release along with Windows XP on my PC. I found that when I set the clock to the correct time&date, next time I boot into FreeBSD it changes and reports the wrong time&date. Both BIOS and Windows reports the time correctly.
> 
> dmesg shows the following message:
> Invalid time in clock: check and reset the date!
> 
> Can't figure out what's wrong... any help will be appreciated.

Is the time out by an exact number of hours?[*]  Does the offset
correspond to your localities' timezone offset from UTC?

If so, then what is happening is this: Windows will only deal with
one timezone at a time, and it expects the system clock (and
consequently the CMOS clock on the motherboard) to be set to the
local wall-clock time.

Unix in comparison allows each process to be run in an arbitrary
timezone, simply by setting the TZ environment variable.  It
expects the system clock and the CMOS clock to be set to UTC, and
it calculates the local offset as required.

When you reboot the machine, the internal system clock is set from
the cmos clock, so one or the other OS will end up thinking local
wall-clock time is UTC or vice-versa.  Unless you have the happy 
fortune to be living in this Sceptered Isle (but only during the wintertime), or in certain parts of West Africa that's going to
cause problems.

If you need to dual-boot, FreeBSD provides a mechanism for allowing
the CMOS clock to be set to wallclock time.  You can toggle the
setting using /usr/sbin/tzsetup -- if there is a zero length file /etc/wall_cmos_clock then your system is running in compatability
mode.  Note: this file should not appear on a box that is dedicated
to running FreeBSD[+] -- the tzsetup default is the /wrong/ choice
in this case.

	Cheers,

	Matthew

[*] Assuming you don't live in Newfoundland or one of the other odd
places with timezones that have a 30 minute offset.

[+] or that only dual boots to *BSD or Linux or MacOS X or Solaris
etc.

-- 
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
                                                  Kent, CT11 9PW

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 258 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20081011/be2e8290/signature.pgp


More information about the freebsd-questions mailing list