LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Gentoo
User Name
Password
Gentoo This forum is for the discussion of Gentoo Linux.

Notices


Reply
  Search this Thread
Old 11-30-2011, 09:48 AM   #1
dr_berta
Member
 
Registered: Sep 2005
Location: Carpi (Modena) - Italy
Distribution: Ubuntu 20.04_x86_64 LTS; Slackware 13 64bit; Gentoo, Fedora, Yocto
Posts: 77

Rep: Reputation: 1
CMOS clock corrupted after reboot


Hi everybody,
I have a problem with a Panel PC having the following characteristics:
CPU Intel Celeron M 1GHz, SRAM 1GB, HDD 80GB, intel GMA graphic card, touch screen.
OS: Linux kernel 2.6.32-gentoo-r7

The problem is that random we found the CMOS clock corrupted: the time goes several days back.
This causes an error saying that "last boot was in the future" during the boot and requiring a disk consistency check.

Service ntpd is not enabled

In /etc/conf.d/clock we have the following settings:
CLOCK="UTC"
TIMEZONE="Europe/Rome"
CLOCK_SYSTOHC="no"

There is someone able to explain me how to fix the problem?

Regards
 
Old 11-30-2011, 09:51 AM   #2
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Is the battery OK? If it isn't, you will have problems.
 
Old 11-30-2011, 09:53 AM   #3
dr_berta
Member
 
Registered: Sep 2005
Location: Carpi (Modena) - Italy
Distribution: Ubuntu 20.04_x86_64 LTS; Slackware 13 64bit; Gentoo, Fedora, Yocto
Posts: 77

Original Poster
Rep: Reputation: 1
The battery seems OK. I'm expecting to see the time set to 01 Jan 1970 if the battery is not OK or to have the date of the last shutdown. Isn't it?
 
Old 11-30-2011, 07:32 PM   #4
yup
LQ Newbie
 
Registered: Aug 2003
Distribution: Fun/Gentoo
Posts: 5

Rep: Reputation: 0
Since the move to OpenRC, the clock settings are in /etc/conf.d/hwclock and the timezone information is in /etc/localtime and /etc/timezone. See here for details:

http://www.gentoo.org/doc/en/handboo...ap=7#doc_chap1
http://www.gentoo.org/doc/en/handboo...ap=8#doc_chap3
http://www.gentoo.org/doc/en/openrc-migration.xml
 
Old 12-01-2011, 09:46 AM   #5
dr_berta
Member
 
Registered: Sep 2005
Location: Carpi (Modena) - Italy
Distribution: Ubuntu 20.04_x86_64 LTS; Slackware 13 64bit; Gentoo, Fedora, Yocto
Posts: 77

Original Poster
Rep: Reputation: 1
My system doesn't have the openrc, but in any case I'm wondering how it could affect the clock on the CMOS

Regards
 
Old 12-01-2011, 10:34 AM   #6
cascade9
Senior Member
 
Registered: Mar 2011
Location: Brisneyland
Distribution: Debian, aptosid
Posts: 3,753

Rep: Reputation: 935Reputation: 935Reputation: 935Reputation: 935Reputation: 935Reputation: 935Reputation: 935Reputation: 935
Quote:
Originally Posted by dr_berta View Post
The battery seems OK. I'm expecting to see the time set to 01 Jan 1970 if the battery is not OK or to have the date of the last shutdown. Isn't it?
If the battery is gone, it normally doesnt keep the time/date of last shutdown.

With most BIOSes, the date wont go back to 1970, it goes back to the date of BIOS version (so if the BIOS version you are using is from 25-12-2005, thats the date it will go back to with no battery).

Last edited by cascade9; 12-02-2011 at 02:37 AM. Reason: typo
 
Old 12-09-2011, 04:09 AM   #7
dr_berta
Member
 
Registered: Sep 2005
Location: Carpi (Modena) - Italy
Distribution: Ubuntu 20.04_x86_64 LTS; Slackware 13 64bit; Gentoo, Fedora, Yocto
Posts: 77

Original Poster
Rep: Reputation: 1
If in the last CMOS versions we could have as default value the BIOS date, this is not a problem. The problem is that the wrong date I found was even not the BIOS date.

The strange behavior I found is the following:
I had the PC with the correct date inside working on it without problems. I didn't use it for 1 month, more or less, and when I switched it on again (in this case the system started correctly) I found a new date 2 months back with also a wrong time. Then I did a reboot and at the new boot I received the error of date inconsistency I reported in my first post and the system asked me to do a check of the disk. At this point I did a new reboot and I changed the date in the BIOS. This time the system did the boot properly, and I worked without problems.
After few days I switched on the PC and checking the BIOS I found the time back of some hours. Again I adjusted the time into the BIOS. Starting from that moment the device seems to work properly.

In the past I had a the same behavior doing a software change of date. I fixed the problem using the command "hwclock" (instead of the command "date") to change the date and time, doing an immediate reboot of the device after the change and avoiding the writing of the local time into the CMOS at the shutdown (CLOCK_SYSTOHC="no" in the etc/conf.d/clock file). This because I thought that something wrong was happening during the time writing on the CMOS.

Now the problem is back even without a change of date or time and happens randomly.

So I need to understand why this behavior happens to fix it because I have to use such type of PC on medical devices and I cannot accept that it is stopped in a such way having a wrong time and date.

Any ideas about it?
 
Old 12-11-2011, 07:24 PM   #8
yup
LQ Newbie
 
Registered: Aug 2003
Distribution: Fun/Gentoo
Posts: 5

Rep: Reputation: 0
Your CMOS battery is probably just getting old and that's what's causing your time to jump around like that when you leave your system switched off for a while.

PC CMOS clocks do not keep time very well. That's why you should run something like ntpd to keep good time.

I don't know what you mean by a "software" change of clock. "hwclock" is a computer program, so you're still using software to set your time.
 
Old 12-12-2011, 03:14 AM   #9
dr_berta
Member
 
Registered: Sep 2005
Location: Carpi (Modena) - Italy
Distribution: Ubuntu 20.04_x86_64 LTS; Slackware 13 64bit; Gentoo, Fedora, Yocto
Posts: 77

Original Poster
Rep: Reputation: 1
I know that CMOS don't keep time very well, but unfortunately I cannot have an internet connection (the device has to go in the operating room) to use ntpd, thus the only way is to let the user adjust the time acting through the user interface (this is the meaning of "software change of clock").
What I don't want is to see the device stopped with a command line screen asking for a disk control.
Is there a way to avoid this?

Regards
 
Old 12-12-2011, 10:34 AM   #10
dr_berta
Member
 
Registered: Sep 2005
Location: Carpi (Modena) - Italy
Distribution: Ubuntu 20.04_x86_64 LTS; Slackware 13 64bit; Gentoo, Fedora, Yocto
Posts: 77

Original Poster
Rep: Reputation: 1
Checking the dmesg for errors I found these rows:
Code:
[    0.082924] pci 0000:00:1d.7: PME# supported from D0 D3hot D3cold
[    0.082931] pci 0000:00:1d.7: PME# disabled
[    0.082981] * The chipset may have PM-Timer Bug. Due to workarounds for a bug,
[    0.082983] * this clock source is slow. If you are sure your timer does not have
[    0.082986] * this bug, please use "acpi_pm_good" to disable the workaround
[    0.083057] pci 0000:00:1f.0: quirk: region 0400-047f claimed by ICH4 ACPI/GPIO/TCO
[    0.083064] pci 0000:00:1f.0: quirk: region 0480-04bf claimed by ICH4 GPIO
[    0.083091] pci 0000:00:1f.1: reg 10 io port: [0x00-0x07]
So I'm wondering whether this message could have impact on the clock precision and could create my problem.
 
  


Reply



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
booting stops at 'setting up the cmos clock' sirius57 SUSE / openSUSE 1 12-08-2008 01:12 AM
linux changes cmos clock back to last logon Bryan Sparks Linux - General 3 02-01-2007 07:20 PM
Command for setting CMOS clock to UTC? as400 *BSD 6 04-24-2006 01:39 AM
Various clock issues: Clock shows wrong time only in Knoppmyth, & CMOS time change ? davidbix General 1 04-05-2006 09:58 PM
system clock vs. CMOS clock dtamajka Linux - General 7 12-11-2003 05:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Gentoo

All times are GMT -5. The time now is 05:09 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