LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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-10-2004, 04:23 AM   #1
xround
Member
 
Registered: Oct 2003
Location: France
Distribution: RH9
Posts: 84

Rep: Reputation: 15
time modified when booting


Hello,

I installed the RH9 a few month ago, on my K6-2 500Mhz, and on my i5150 dell laptop. I have a multiboot on both, with windows installed on other partitions. And I have the same following problem : everytime I boot, the time is modified, it is a 2 hours.
For instance, let's say it 7 am. If I boot twice without correcting the time, it will be then nearly 11 am.
Does anyone know the origin of this problem, and how I can resolve it ?


Cheers, xround.
 
Old 08-10-2004, 08:24 AM   #2
Riichard
Member
 
Registered: Sep 2003
Location: 3rd Rock
Distribution: Mepis 6.5.02
Posts: 106

Rep: Reputation: 15
You could try replacing the motherboard cmos battery.
 
Old 08-10-2004, 10:27 AM   #3
xround
Member
 
Registered: Oct 2003
Location: France
Distribution: RH9
Posts: 84

Original Poster
Rep: Reputation: 15
My laptop is rather new (it is a dell i5150 laptop I bought 8 months ago). Are sure it would solve the problem ?

Cheers, xround
 
Old 08-10-2004, 11:20 PM   #4
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
hi,

I know nothing about RH9 so i can't help with particulars

Posix traditionally uses UTC (Universal Time Coordinated) time ie. Greenwich Mean Time
Winblows on the other hand uses local time format.

Linux can use either so when you dual boot with windows you need to use local time
on your Linux system

check out a file /etc/sysconfig/clock
your ZONE (timezone) there should be correct and you should have
UTC=false

ok there is another file /etc/localtime that has to be correct
you have a program there on redhat (i hope) called "tzselect"
run that and follow along
when you are done write the last line on a text editor
it's you timezone i will call it variable $TIMEZONE
when i put $TIMEZONE you put the timezone you got fron tzselect
now (as root )
cp --remove-destination /usr/share/zoneinfo/$TIMEZONE /etc/localtime

OK now the last thing (this doesn't really sound like your problem though)
when your system boots up it reads the time from the BIOS hardware clock
if your time is still comming up all screwy after the changes above
then your hardware clock isn't keeping good time (alot of hardware clocks don't)
possible battery issue i don't use laptops so i don't know about that
so one sort of ok solution is to write the correct time out to the BIOS durring shutdown
that way at least it gets set periodically
(it is possible RH is doing this already i don't know)
read your bootscript /etc/rc.d/init.d/setclock or something to that effect and see
to write localtime to your hardware clock
and you can run this as root anytime
hwclock --systohc --localtime
look for that in the stop section of the script
if it's not there put it in in the proper plae or just before you shutdown run the command
you can put an alias in your root .bashrc like
alias set_hwclock='hwclock --systohc --localtime'
or something like that
here is another fun command for your root .bashrc if your system has ntpdate
alias set_sysclock='/usr/sbin/ntpdate 132.239.254.49'
 
Old 08-11-2004, 09:24 AM   #5
xround
Member
 
Registered: Oct 2003
Location: France
Distribution: RH9
Posts: 84

Original Poster
Rep: Reputation: 15
Hi foo_bar_foo,

I tried your advice and the problem seems to be fixed.
Quote:
Linux can use either so when you dual boot with windows you need to use local time on your Linux system
I have the multiboot windows + linux.

Quote:
check out a file /etc/sysconfig/clock
your ZONE (timezone) there should be correct and you should have
UTC=false
I had UTC=false. Also I had "TZ=Europe/Paris" set in file /etc/sysconfig/cloc.


Then I used tzselect, and had finally TIMEZONE=Europe/Paris.

Quote:
cp --remove-destination /usr/share/zoneinfo/$TIMEZONE /etc/localtime
The file /etc/localtime was a link to usr/share/zoneinfo/Europe/Paris, so I had to remove it before copying physically to /ets/localtime

Finally, I reboot under my RH9, and time was ok.
I also rebooted under windows, then rebooting back to RH9. And clock didn't change.

I don't really understand which things I did modify during this procedure, but it seems to be solved.
Well many thanks.

PS : I doubted my CMOS battery was failing, be cause booting under windows, the clock never changed. However thanks to you all.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
CD not booting at installation time! cucolin@ Fedora - Installation 4 04-14-2004 12:34 AM
Booting time very high azazel77 Linux - Newbie 2 03-28-2004 08:05 AM
Where can I look for the config file for modified date and time ForumKid Linux - General 1 09-19-2003 08:05 AM
suse booting time??? radmanxx Linux - Software 2 03-07-2003 09:39 PM
PHP last time modified script time way off GabeF Programming 2 11-05-2002 08:05 PM

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

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