1

So I'm having quite a bit of trouble trying to get my system to set the hardware clock's time. Here is what I did just now, everything has worked, right? The first and last command seem to indicate that I have changed the hardware clock's time.

[omed@localhost ~]$ sudo hwclock -r
Fri 19 Aug 2011 12:15:59 PM MDT  -0.407669 seconds
[omed@localhost ~]$ sudo ntpdate 0.pool.ntp.org
19 Aug 12:16:21 ntpdate[1816]: step time server 76.73.0.4 offset 94694401.172566 sec
[omed@localhost ~]$ date
Tue Aug 19 12:16:26 MDT 2014
[omed@localhost ~]$ sudo hwclock -w
[omed@localhost ~]$ sudo hwclock -r
Tue 19 Aug 2014 12:16:41 PM MDT  -0.329495 seconds

However, a few notes about the device is that it's an intel Q7 (image here) module plugged into a carrier board designed by someone else. The RC uses a battery that isn't actually on the device, but comes from a battery on the carrier board. The RTC does store and save time set through the BIOS, however, if I power the system off and back on (without doing standard shutdown, literally just cutting power to the board), after logging in, this happens:

[omed@localhost ~]$ sudo hwclock -r
Fri 19 Aug 2011 12:23:02 PM MDT  -0.580141 seconds

issuing a poweroff command and then power-cycling the device does save the time to the RTC successfully, however doing a 'clean' shutdown is not an option, what does linux do during shutdown that it doesn't do when I run hwclock? The calibration time and drift time from the RTC also show the correct date for drift/calibration (August 2014, as below), but doesn't actually display the correct time (for some reason it still thinks it's 2011).

[omed@localhost ~]$ sudo hwclock -r -D
...
Last drift adjustment done at 1408472197 seconds after 1969
Last calibration done at 1408472197 seconds after 1969
...
Time read from Hardware Clock: 2011/08/19 18:26:45
Hw clock time : 2011/08/19 18:26:45 = 1313778405 seconds since 1969
Fri 19 Aug 2011 12:26:45 PM MDT  -0.877045 seconds

The system is a special distro based around embedded systems (timesys bowler 14), however, it is based on fedora 14 and is close enough that it can be treated as fedora.

  • I removed the fedora tag as this is very unlikely to be a distro specific issue. – goldilocks Aug 20 '14 at 15:34
  • What options is hwclock called with during poweroff? I know some x86 machines require --directisa, for example. I think the options are in a file under /etc/sysconfig on Fedora, if not they'll be elsewhere under /etc (on Debian, it's HWCLOCKPARS in /etc/default/hwclock). – Gilles Aug 20 '14 at 21:06
  • Coming from the initscripts (rc.d), it's just hwclock --systohc and nothing else. In /etc/sysconfig all I see see is an ntpdate option to sync the hardware clock, set to no, which is OK – alexmherrmann Aug 20 '14 at 21:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.