LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-16-2011, 09:08 AM   #1
heavytull
LQ Newbie
 
Registered: Apr 2006
Posts: 15

Rep: Reputation: 0
hwclock principle - what I actually do not find clear


The goal with hwclock is to adjust the hardware clock either at boot time or regularly by taking the system clock as a reference since its drift is usually in the order of 1 µs from what is said in the man page of hwclock.
What I don't understand is why is it written that the user should regularly adjust the hardware clock for hwclock to calculate its drift?
When you have two clocks, one of which being used as a reference, a periodic checking should be enough to measure the drift of the inaccurate clock. And when the drift amount is memorised along with the time at which the whole system is shut down, this should be enough to adjust the inaccurate clock to the right time at boot time.
 
Old 12-16-2011, 10:10 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
UNIX/Linux is more concerned with "system time" than "hardware clock time". While running the OS does not periodically adjust itself to hwclock unless you've told it to do so. It simply runs and tries to keep rack of clock ticks. Network Time Protocol is used to try to keep running system time in sync with reliable time sources external to your OS and hardware.

However, when you shutdown the system ONLY the hardware clock is running. On boot up the hardware clock is read to set the initial system time (otherwise it would default back to January 1, 1970). Therefore it becomes important that on shutdown you set the hardware clock to have the current system time (which is presumably accurate before the shutdown) so that system time is as close to accurate on reboot. If you then have ntp setup your system time will deal with any drift the hardware clock had during the downtime.

Since only the hardware clock is running during downtime and there is no way for the system to know how long it was down without relying on the hardware clock's time at boot there is now way to keep track of how much time it may have actually drifted while down. You seem to be assuming that hardware clock drift will always be the same but that isn't necessarily the case. It might be affected by a weak battery or strong magnetic fields from adjacent servers or even by the dreaded cosmic ray that vendors love to blame for many things.
 
Old 12-16-2011, 11:04 AM   #3
heavytull
LQ Newbie
 
Registered: Apr 2006
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by MensaWater View Post
UNIX/Linux is more concerned with "system time" than "hardware clock time".
...
If you then have ntp setup your system time will deal with any drift the hardware clock had during the downtime.

...
You seem to be assuming that hardware clock drift will always be the same but that isn't necessarily the case. It might be affected by a weak battery or strong magnetic fields from adjacent servers or even by the dreaded cosmic ray that vendors love to blame for many things.
If your system has ntp, then the adjtime file is useless unless the network is down for long time and you have to use the computer anyway during that time.

I agree the hardware clock might drift due to some external influence, but the hwclock man page clearly shows that the linux clock system wants to tackle with the "systematic drift" of the clock.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Nokia and Microsoft Struggle to Find Clear Mobile Message LXer Syndicated Linux News 0 12-15-2011 03:20 AM
I am sure it has been discussed... but I could not seem to find a clear answer. abovenbeyond Linux - Software 2 08-20-2008 08:29 PM
basic principle behind linux subsystrem sitthar Linux - General 3 04-08-2006 08:05 AM
Where can I find clear xp screen shots caleb star General 2 12-07-2004 08:43 AM
where can i find clear informations about SERVICES in MANDRAKE 9.0? kublador Linux - Distributions 2 07-06-2003 01:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration