cancel
Showing results for 
Search instead for 
Did you mean: 

Slow Clock

custos
Aspiring Pro
Posts: 315
Thanks: 50
Fixes: 2
Registered: ‎28-06-2007

Slow Clock

I have just installed Xubuntu on a Laptop after using Ubuntu on my Dell Inspiron 530 without any problems. The Laptop is a much lower spec with a 1.6MHz Celeron M and about 750M of RAM available to the OS. Both machines run Vista as well and I dual boot using Grub.
The odd thing is that on the Laptop the clock slows down when running Xubuntu -  I have just done this test:
I booted into the Xubuntu memory test option and that took about an hour. I then re-booted into the BIOS but the clock was still correct. However as soon as I actually ran Xubuntu the clock started losing time. After about an hour I re-booted again into the BIOS and the hardware clock was over 2 minutes slow! Obviously the OS uses the hardware clock as a reference when it starts up but then starts to alter it.
Left on it's own or running Vista the hardware clock keeps very good time.
Can anyone help?
dick:red All caps title fixed as per forum rules.
17 REPLIES 17
Steve
Seasoned Pro
Posts: 6,853
Thanks: 336
Registered: ‎13-07-2009

Re: Slow Clock

Sounds to me as this may be a bug with the operating system,do some investigation into that and see what you can come up with,sorry i cant help you further but thats what i think it could be.
If life gives you lemons, make lemonade.
Oldjim
Resting Legend
Posts: 38,460
Thanks: 787
Fixes: 63
Registered: ‎15-06-2007

Re: Slow Clock

It's not a bug it's a feature - gives you more time to do things  Cool
VileReynard
Hero
Posts: 12,616
Thanks: 582
Fixes: 20
Registered: ‎01-09-2007

Re: Slow Clock

If you have Xbuntu configured to use a ntp server, it may or may not adjust the hardware clock.
It can do this - but Linux would normally compute an adjustment to your hardware clock and use this.
I believe it's possible to update your hardware clock periodically...
See http://tldp.org/HOWTO/Clock-2.html for a long description about time. Smiley

"In The Beginning Was The Word, And The Word Was Aardvark."

Steve
Seasoned Pro
Posts: 6,853
Thanks: 336
Registered: ‎13-07-2009

Re: Slow Clock

@oldjim-is that what it is ;D, pity i dont have this feature as my wall clock in the lounge has a habit of going blooming 5 min fast no matter how many times i put it back, so if i had this feature on my pc then this would balance things out a bit!! Grin
If life gives you lemons, make lemonade.
MrC
Grafter
Posts: 525
Thanks: 4
Registered: ‎17-07-2008

Re: Slow Clock

Quote from: custos
Obviously the OS uses the hardware clock as a reference when it starts up but then starts to alter it.

The linux kernel itself doesn't affect the hardware clock. However some distributions do resynchronise the OS clock to the hardware clock at shutdown time, usually by running
hwclock --systohc
in a shutdown script. It's feasible that this could be being run in cron to resynchronise on a regular basis so might be worth a check.
You can run (as root)
hwclock --show
at any time to display the current hardware clock value and compare it to the OS clock value.
A quick Google shows that others have seen similar problems and that some motherboards are more prone. An example is http://ubuntuforums.org/showthread.php?t=75281.
HairyMcbiker
All Star
Posts: 6,792
Thanks: 266
Fixes: 21
Registered: ‎16-02-2009

Re: Slow Clock

Must admit I usually fix my clock to the atomic one as soon as I setup the OS. On xUbunbu Click on System. Date & time, then click the padlock to unlock the change, then Click Configuration to select Keep synced, and then Select Servers and enter ntp.plus.net as the time server and press Add.
On Mint, choose Time & Date from the control panel and follow the same steps.
VileReynard
Hero
Posts: 12,616
Thanks: 582
Fixes: 20
Registered: ‎01-09-2007

Re: Slow Clock

Well I'm running Ubuntu (and have done for years on this machine) and the hardware clock shows:-
Quote
jeremy@HECTOR:~$ sudo hwclock --show
Tue 02 Mar 2010 19:12:21 GMT  -0.859949 seconds

But I'm using ntpd to get the time off of the internet...

"In The Beginning Was The Word, And The Word Was Aardvark."

custos
Aspiring Pro
Posts: 315
Thanks: 50
Fixes: 2
Registered: ‎28-06-2007

Re: Slow Clock

OK - well I have installed the time server facility and the time corrected on the hour. I could not see any way of forcing an update and I don't know how often it will update. However it is still running slow of course and within a few minutes was many seconds behind 'real' time again.
Just to clarify:
The OS clock starts to run slowly immediately Xubuntu is running. The OS and hardware clocks do not stay synchronised but the OS clock loses approximately 2 minutes and 10 seconds every hour and the hardware clock is usually a little ahead but still slow. When I shut down Xubuntu the hardware clock stops losing time but is left at whatever time the OS clock was at exit. I can correct this using the BIOS or by running Vista, where I unusually use the time server update (manually) to get things back to normal.
I need the clock to be accurate to within a second or so and it normally is, so unless I can sort this out using Xubuntu is not going to be an option.
VileReynard
Hero
Posts: 12,616
Thanks: 582
Fixes: 20
Registered: ‎01-09-2007

Re: Slow Clock

I suspect that you've installed the "lightweight" NTP client "ntpdate"
In the package description its says:-
Quote
NTP, the Network Time Protocol, is used to keep computer clocks
accurate by synchronizing them over the Internet or a local network,
or by following an accurate hardware receiver that interprets GPS,
DCF-77, NIST or similar time signals.
ntpdate is a simple NTP client that sets a system's clock to match
the time obtained by communicating with one or more NTP servers.  It
is not sufficient, however, for maintaining an accurate clock in the
long run.  ntpdate by itself is useful for occasionally setting the
time on machines that do not have full-time network access, such as
laptops.
If the full NTP daemon from the package "ntp" is installed, then
ntpdate is not necessary.

"In The Beginning Was The Word, And The Word Was Aardvark."

Ben_Brown
Grafter
Posts: 2,839
Registered: ‎13-06-2007

Re: Slow Clock

Quote from: MrC
The linux kernel itself doesn't affect the hardware clock.

That's not necessarily true. From the hwclock man page:
Quote
You should be aware of another way that the Hardware Clock is kept synchronized in some systems. The Linux kernel has a mode wherein it copies the System Time to the Hardware Clock every 11 minutes
...
This mode (we'll call it "11 minute mode") is off until something turns it on. The ntp daemon xntpd is one thing that turns it on. You can turn it off by running anything, including hwclock --hctosys, that sets the System Time the old fashioned way.
To see if it is on or off, use the command adjtimex --print and look at the value of "status". If the "64" bit of this number (expressed in binary) equal to 0, 11 minute mode is on. Otherwise, it is off.
If your system runs with 11 minute mode on, don't use hwclock --adjust or hwclock --hctosys. You'll just make a mess.

HairyMcbiker
All Star
Posts: 6,792
Thanks: 266
Fixes: 21
Registered: ‎16-02-2009

Re: Slow Clock

It might be worth having a look <a href="http://ubuntuforums.org/showpost.php?p=8610450&postcount=12">here</a> for a solution,
custos
Aspiring Pro
Posts: 315
Thanks: 50
Fixes: 2
Registered: ‎28-06-2007

Re: Slow Clock

Thanks for that - I have just done what is suggested and added clocksource=tsc to the grub menu and so far the clock is running correctly! I had seen some of those posts already but a lot of the stuff on the Ubuntu help forums is difficult for a novice like me to follow 🙂
I will leave it running while I take the dog for a walk and see how it is later.
jim:quote
HairyMcbiker
All Star
Posts: 6,792
Thanks: 266
Fixes: 21
Registered: ‎16-02-2009

Re: Slow Clock

If it is still ok then you will need to follow the guide in post 17 (I think) to install it as default.
custos
Aspiring Pro
Posts: 315
Thanks: 50
Fixes: 2
Registered: ‎28-06-2007

Re: Slow Clock

Quote from: Hairy
If it is still ok then you will need to follow the guide in post 17 (I think) to install it as default.

The clock was still correct after more than an hour. I have edited and saved grub and after a re-boot everything seems fine. I must try and work out what I have done now!
Thanks for your help.