You are not logged in.

#1 2011-10-21 21:57:50

synthead
Member
Registered: 2006-05-09
Posts: 1,337

Clock set to the wrong time at boot

This is on a new Toshiba NB505, if it matters.  When I boot it, it's set about 12 hours back.  I can do a soft reboot and the time will go back again.  Linux is the only OS on this guy, so no UTC/localtime problems.  The localtime file is set correctly (via rc.conf), and I can ntpdate time.nist.gov back to the correct time.  I have the feeling this has to do with the "hwclock" daemon, but running the command manually and even restarting the daemon doesn't seem to cause trouble.  What's up?

Offline

#2 2011-10-22 01:19:21

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,046

Re: Clock set to the wrong time at boot

First thing I'd check is the BIOS clock.
Set that to your local time (in case your rc.conf also has localtime) and the rest should get handled automatically.

Last edited by byte (2011-10-22 01:20:32)


1000

Offline

#3 2011-10-22 16:38:19

Yochai
Member
Registered: 2010-10-20
Posts: 33

Re: Clock set to the wrong time at boot

Let me describe my problem and let me know if you having the same happens to you.

My clock is set to

LOCALE="en_US.UTF-8"
DAEMON_LOCALE="no"
HARDWARECLOCK="UTC"
TIMEZONE="Asia/Jerusalem"
KEYMAP="us"
CONSOLEFONT=
CONSOLEMAP=
USECOLOR="yes"

...

DAEMONS=(!hwclock ... network ntpd ...)

Yet every time I shutdown the computer (and I do every night when I go to sleep) the BIOS clock is moving back a few months (but not to factory time).
If I will reset the BIOS time and won't load Arch but just restart the computer the error will not repeat, it happens only on Arch shutdown process.
I've been using hwclock till now and moved to ntpd in hopes it will solve it, but it didn't.
I actually have to fix the BIOS clock every time I restart the computer because the system won't load (as it appears to been shutdown in the future).

Offline

#4 2011-10-22 17:36:24

csergec
Member
Registered: 2009-09-29
Posts: 62

Re: Clock set to the wrong time at boot

Hi Yochai

I have the same config than you in /etc/rc.conf

If Arch is your lonely OS , you have to load the hwclock daemon.
If not ( meaning  dual boot with Windows for instance  )it is better to use "Localtime" in hardwareclock and still load hwclock

Serge

Offline

#5 2011-10-22 18:55:06

Yochai
Member
Registered: 2010-10-20
Posts: 33

Re: Clock set to the wrong time at boot

Hey csergec,

It isn't the issues.
My original conf was just hwclock, tried to add ntpd, didn't work, tried disabling hwclock didn't work.

I'm only booting Arch so it's something in my configuration, I'm just clueless to where.

Offline

#6 2011-10-22 20:46:03

alkuzad
Member
Registered: 2011-10-05
Posts: 12

Re: Clock set to the wrong time at boot

Did u set

HARDWARECLOCK="localtime"

?

Offline

#7 2011-10-23 16:24:20

Yochai
Member
Registered: 2010-10-20
Posts: 33

Re: Clock set to the wrong time at boot

I've now tried that too with no effect.

Offline

#8 2011-10-25 12:05:29

whereareyouall
Member
Registered: 2009-09-08
Posts: 13

Re: Clock set to the wrong time at boot

synthead wrote:

Linux is the only OS on this guy

I know, it is unlikely. But have you tried another OS like Windows? At least for five minutes? It really is rare, but there are computers where the internal clock just malfunctions ... (or the battery is a little loose ... or something like that)

Offline

#9 2011-10-25 13:09:15

synthead
Member
Registered: 2006-05-09
Posts: 1,337

Re: Clock set to the wrong time at boot

With the AC plugged in and the battery at 100%, I can reboot the computer without shutting it down and observe that the clock is wrong after it boots.

Offline

#10 2011-10-25 14:30:43

Stebalien
Member
Registered: 2010-04-27
Posts: 1,239
Website

Re: Clock set to the wrong time at boot

Do the outputs of the following commands agree?:

sudo hwclock --show
date

Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C

Offline

#11 2011-10-26 02:30:29

synthead
Member
Registered: 2006-05-09
Posts: 1,337

Re: Clock set to the wrong time at boot

After a reboot:

$ sudo hwclock --show
Tue 25 Oct 2011 02:29:24 PM EDT  -0.594851 seconds
$ date
Tue Oct 25 14:29:27 EDT 2011
$ sudo ntpdate time.nist.gov
25 Oct 22:29:21 ntpdate[1320]: step time server 192.43.244.18 offset 28674.054351 sec
$ sudo hwclock --show
Tue 25 Oct 2011 02:31:33 PM EDT  -0.063816 seconds
$ date
Tue Oct 25 22:29:33 EDT 2011

Offline

#12 2011-10-26 03:31:41

Stebalien
Member
Registered: 2010-04-27
Posts: 1,239
Website

Re: Clock set to the wrong time at boot

Have you tried manually saving your system clock (hwclock -w)?


Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C

Offline

#13 2011-11-02 07:41:09

virusso80
Member
From: Italy
Registered: 2007-03-09
Posts: 325

Re: Clock set to the wrong time at boot

Hi all, I have same issues on ALL pc (laptop/desktop) with arch. I'm not able to have clock correctly set on boot. The only way (i know) to set is through ntpd, but everytime it is the same issue. I can not think it's a battery issue. I have a dual boot, but i only use arch, rarely windows. rc.conf time is set to local time. I even realized that boot time is wrong. if i set it correctly...after few time, it goes wrong again.

this is what i have after ntpd sets time. Every boot it's the same problem.

[root@jily ~]# date
Wed Nov  2 07:39:27 CET 2011
[root@jily ~]# hwclock 
Wed 02 Nov 2011 09:28:16 AM CET  -0.739496 seconds

after using hwclock -w time is temporary set but next boot presents the issue again. sad

It seems to be not only an issue of mine. Could please help me how to fix this?

Thanks in advance

Offline

#14 2011-11-06 20:58:16

ozar
Member
From: USA
Registered: 2005-02-18
Posts: 1,686

Re: Clock set to the wrong time at boot

virusso80 wrote:

Hi all, I have same issues on ALL pc (laptop/desktop) with arch. I'm not able to have clock correctly set on boot.

Hello

If you haven't done so already, be sure to check the wiki page regarding time settings and read through it several times to make sure you are following the concept and directions correctly:

https://wiki.archlinux.org/index.php/Time

My machine wouldn't reboot with the correct time either whenever I'd use "UTC" in rc.conf, but once I realized that the hardware clock (BIOS/CMOS) needed to be set with UTC rather than local time and the UTC change was made to rc.conf, it worked properly on all reboots.  If you run Arch and Windows on the same machine, I'd recommend setting everything to UTC.


oz

Offline

#15 2011-11-06 21:02:24

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Clock set to the wrong time at boot

Offline

#16 2011-11-09 02:45:37

pouar
Member
Registered: 2011-11-03
Posts: 55
Website

Re: Clock set to the wrong time at boot

i had a similar issue recently, i got it working by uninstalling then reinstalling ntp, disabled hwclock (or ntpd) daemons from rc.conf  stopped the daemons, reboot, then added the hwclock/ntpd daemon back to rc.conf but configured the daemon to be started last. it worked for me so it might work in your case.

Last edited by pouar (2011-11-09 02:46:29)


Yep, I'm a diaperfur now, I guess

while :;do if windows sucks;then mv windows /dev/null;pacman -Sy linux;fi;done
for i in {\ metal,core,grind};do echo death$i rules\!;done

Offline

#17 2011-11-09 10:06:30

tomegun
Developer
From: France
Registered: 2010-05-28
Posts: 661

Re: Clock set to the wrong time at boot

My generic suggestions to anyone who suffers from RTC problems:
Set HARDWARECLOCK to UTC in rc.conf
Delete /var/lib/hwclock/adjtime (it will be regenerated)
Do not use the hwclock daemon in rc.conf
Set the time and timezone correctly in BIOS.

Offline

#18 2011-12-12 18:37:42

Mr. Alex
Member
Registered: 2010-08-26
Posts: 623

Re: Clock set to the wrong time at boot

Hello. Had the same problem and I sort of figured out how to fix it, at least this method worked for me:

1. Delete hwclock from rc.conf autorun (if not done).
2. Add ntpd there and copy it's config from https://wiki.archlinux.org/index.php/NTP but do not include "driftfile" option!
3. Adjust your BIOS clock if incorrect.

Fixed my problem.

Offline

#19 2011-12-12 20:10:25

virusso80
Member
From: Italy
Registered: 2007-03-09
Posts: 325

Re: Clock set to the wrong time at boot

Mr. Alex wrote:

Hello. Had the same problem and I sort of figured out how to fix it, at least this method worked for me:

1. Delete hwclock from rc.conf autorun (if not done).
2. Add ntpd there and copy it's config from https://wiki.archlinux.org/index.php/NTP but do not include "driftfile" option!
3. Adjust your BIOS clock if incorrect.

Fixed my problem.

does it work even without internet connection?

Offline

#20 2011-12-13 10:40:13

Mr. Alex
Member
Registered: 2010-08-26
Posts: 623

Re: Clock set to the wrong time at boot

Virusso80, yes. Even after several reboots without Internet connection and then two reboots with Internet connection there was no such problem on my Arch.

Offline

#21 2022-03-13 19:44:55

zim0369
Member
From: India
Registered: 2022-02-06
Posts: 1
Website

Re: Clock set to the wrong time at boot

I was facing a similar problem & I always had to `sudo ntpd -gq` on every reboot.

I was able to solve it by:

1. Going into the BIOS and setting the correct time & date.
2. Ran: `sudo ntpdq -gq`
3. sudo hwclock --systohc
4. Reboot. Worked!


Linux and Rust enthusiast

Offline

#22 2022-03-13 19:51:45

HalosGhost
Forum Fellow
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,097
Website

Re: Clock set to the wrong time at boot

zim0369 wrote:

a similar problem

These are probably the operative words in your post. The last post in this thread was from over 10 years ago; in all likelihood, this problem is at least a fair bit different. Please do reread the Code of Conduct you agreed to when you registered today (link in my signature for ease). Please pay particular attention to the guidelines linked from that document regarding the BBS specifically.

Closing.

All the best,

-HG

Offline

Board footer

Powered by FluxBB