Author Topic: How to set hwclock (BMC) to correct date?  (Read 7020 times)

MPC7500

  • Hero Member
  • *****
  • Posts: 587
  • Karma: +41/-1
    • View Profile
    • Twitter
How to set hwclock (BMC) to correct date?
« on: January 23, 2021, 05:51:45 am »
Hello everyone,

does anyone know how to set / to sync the hwclock?
I'm connected to the internet, but the clock dosen't sync.

Thanks in advance

Borley

  • Full Member
  • ***
  • Posts: 176
  • Karma: +16/-0
    • View Profile
Re: How to set hwclock (BMC) to correct date?
« Reply #1 on: February 25, 2022, 09:56:59 am »
hwclock --set has not worked. I think my system has just been using Gnome location service to grab the network time each time it boots.

MPC7500

  • Hero Member
  • *****
  • Posts: 587
  • Karma: +41/-1
    • View Profile
    • Twitter
Re: How to set hwclock (BMC) to correct date?
« Reply #2 on: February 25, 2022, 07:02:05 pm »

Borley

  • Full Member
  • ***
  • Posts: 176
  • Karma: +16/-0
    • View Profile
Re: How to set hwclock (BMC) to correct date?
« Reply #3 on: February 28, 2022, 03:12:09 pm »
"Error: Date and time settings could not be saved" when I try to manually set date and time. Setting NTP servers for synchronization works, however.

ClassicHasClass

  • Sr. Member
  • ****
  • Posts: 464
  • Karma: +35/-0
  • Talospace Earth Orbit
    • View Profile
    • Floodgap
Re: How to set hwclock (BMC) to correct date?
« Reply #4 on: March 01, 2022, 03:33:58 pm »
I just use NTP (I have a stratum 1 server on the local network).

Borley

  • Full Member
  • ***
  • Posts: 176
  • Karma: +16/-0
    • View Profile
Re: How to set hwclock (BMC) to correct date?
« Reply #5 on: March 25, 2023, 10:12:55 am »
A problem is, once the hardware clock does update, it just seems stuck forever on that time and date. Maybe the CMOS battery needs replacing?

Corvidae

  • Newbie
  • *
  • Posts: 25
  • Karma: +11/-0
    • View Profile
Re: How to set hwclock (BMC) to correct date?
« Reply #6 on: March 25, 2023, 01:28:52 pm »
My BMC time was incorrect / not updating when I got my system, it was a while ago but I think this is what I did to get it working:

  • I replaced the CMOS battery that came with the system - the voltage was about on the line between being OK and too low, so I'm not sure if that was neccessary, but it didn't hurt.
  • I set the time sync method to manual as described here, on the BMC command line.
  • I then set the time using hwclock on the BMC command line, and confirmed that it set properly with timedatectl (and that NTP was disabled)

From what I have found, hwclock in a booted system does not work for setting the time. IPMI also didn't work for me, but I might have just been using that incorrectly. Lastly, I keep the BMC disconnected from the network (I use serial to connect to it), not sure if that makes any difference.

Borley

  • Full Member
  • ***
  • Posts: 176
  • Karma: +16/-0
    • View Profile
Re: How to set hwclock (BMC) to correct date?
« Reply #7 on: March 26, 2023, 11:11:26 am »
Thanks, I just replaced the CMOS battery and checked voltages. The original from factory battery was still at 3.1V. The new one was at 3.12V. I'm not sure that makes much of a difference.

So I went through the BMC web interface and what really did it was checking the "Time Owner" property which was left on "BMC". After I changed it to "Both", I was then able to successfully update and save the RTC time.

I rebooted and for the first time in months, haven't had to manually set the system time through desktop settings. We'll see if it keeps up from here on out 👍 (or if it will forever be in stasis at "March 26, 2023, 11:3...").

Corvidae

  • Newbie
  • *
  • Posts: 25
  • Karma: +11/-0
    • View Profile
Re: How to set hwclock (BMC) to correct date?
« Reply #8 on: March 26, 2023, 01:45:30 pm »
Thanks, I just replaced the CMOS battery and checked voltages. The original from factory battery was still at 3.1V. The new one was at 3.12V. I'm not sure that makes much of a difference.

So I went through the BMC web interface and what really did it was checking the "Time Owner" property which was left on "BMC". After I changed it to "Both", I was then able to successfully update and save the RTC time.

I rebooted and for the first time in months, haven't had to manually set the system time through desktop settings. We'll see if it keeps up from here on out 👍 (or if it will forever be in stasis at "March 26, 2023, 11:3...").

I didn't know about the "Time Owner" setting - that explains why my attempts at setting the clock on the host side have failed. Hopefully your system clock keeps ticking!