LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-05-2004, 04:22 AM   #1
jogurt666
Member
 
Registered: Nov 2003
Location: Poland => Mazowieckie => Ok'a
Distribution: Gentoo
Posts: 176

Rep: Reputation: 30
i can't set my hardware clock


lately i've got problems with my system clock. each time i boot my system it shows different month, day and hour. i've tried to set my hardware clock by initially setting system clock using
Code:
# date MMDDhhmmCCYY
and than
Code:
# hwclock --systohc
well it sets the hardware clock properly, but after i reboot, the same problem appearers. what the hell is wrong?
 
Old 08-05-2004, 07:45 AM   #2
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 55
could it be a problem with the battery on your mainboard being too old and having not enough power to provide for saving your cmos settings beyond the time the computer is turned off?

If its old that could be - there are other reasons for that too.
One way to check this (that I know of) is to set your hardwareclock in the bios-setup and check if it still set correctly after having turned off - waited a while - and turned back on your system.
A low battery would also make you loose all other bios settings - but I'm not sure if the system would even boot without a battery - never tried it!
 
Old 08-05-2004, 09:10 AM   #3
jogurt666
Member
 
Registered: Nov 2003
Location: Poland => Mazowieckie => Ok'a
Distribution: Gentoo
Posts: 176

Original Poster
Rep: Reputation: 30
well the battery is rather good, i've got this mainboard no longer than 2 years, what's more time set in bios is correct. it's as if the hardware clock set random date each time i boot my system. it happens even when i just reboot.
 
Old 08-05-2004, 10:22 AM   #4
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 55
uups

I did not try this one here but: I have in the script, which sets my hardware-clock, a different parameter - actually it seems to be just the opposite of what you are using to set your clock!

I have there a script, which sets the clock using a command like this:

"hwclock --hctosys --utc=0" -while you use "hwclock --systohc"

Is this causing your trouble?

I'm using LFS and did not make this myself (actually I'm glad if I can figure out, how these scripts work most of the time...) - but, here is my script for an example:

------------------------------------snip
#!/bin/bash
# Begin $rc_base/init.d/setclock - Setting Linux Clock

# Based on setclock script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org

source /etc/sysconfig/rc
source $rc_functions
source /etc/sysconfig/clock

CLOCKPARAMS="--hctosys"

case "$UTC" in
yes|true|1)
CLOCKPARAMS="$CLOCKPARAMS --utc"
;;
no|false|0)
CLOCKPARAMS="$CLOCKPARAMS --localtime"
;;
esac

echo "Setting clock..."
hwclock $CLOCKPARAMS
evaluate_retval

# End $rc_base/init.d/setclock

---------------------------------snip
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
System clock correct, hardware clock wrong karlovac Linux - General 5 01-16-2009 07:19 PM
system clock,hardware clock varunbihani Linux - Newbie 2 07-23-2005 09:04 AM
setting the hardware clock.. kurrupt Linux - Hardware 1 08-25-2004 11:00 PM
Hardware and System Clock GruiX Linux - Software 5 02-09-2004 01:28 PM
Hardware Clock... philfighter General 0 08-18-2001 10:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:19 AM.

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