Ubuntu time not updating
So I installed an NTP server onto my Windows machine which acutally has a clock in it, and I got my network switch (which doesn't have an RTC) to successfully update its software clock to this Windows NTPd. Not so successful: [[email protected] ~]# ntpd -ds listening on 127.0.0.1 ntp engine ready reply from 192.168.0.2: not synced, next query 655s ^Cntp engine exiting dispatch_imsg in main: pipe closed Lost child: child exited Terminating [[email protected] ~]# date Fri Jan 2 BST 1970 [[email protected] ~]# So it says that my 192.168.0.2 (my windows box) isn't synced. The problem was that the server wasn't fudging its stratum to 0 correctly, so the Pi was seeing the server as a stratum 16 and wouldn't touch it with a barge pole, thus the time wasn't being updated.
Can I tell it to ignore this like my network switch must? Note: I can't get the Raspberry Pi to update directly from the internet due to the way my network's set up. I managed to fudge the server's stratum to 0 so now the Pi updated off it happily.
I started digging and found out that the NTPd service is not updating the local time.
This is most likely only a recent problem since I had power failures before and never noticed problems with time. When I stop the service and run ntpd manually May 5 autohome ntpd: ntpd [email protected] Fri May 18 UTC 2012 (1) May 5 autohome ntpd: proto: precision = 1.000 usec May 5 autohome ntpd: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123 May 5 autohome ntpd: Listen normally on 1 lo 127.0.0.1 UDP 123 May 5 autohome ntpd: Listen normally on 2 eth0 192.168.1.120 UDP 123 May 5 autohome ntpd: peers refreshed May 5 autohome ntpd: Listening on routing socket on fd #19 for interface updates # /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help driftfile /var/lib/ntp/ntp.drift # Enable this if you want statistics to be logged.
restrict 127.0.0.1 #restrict ::1 # Clients from this (example!
I'm really happy with my Pi so far, but now that the website I'm developing on it is starting to need the time and date, I thought it was about time to get NTPd working.
#statsdir /var/log/ntpstats/ statistics loopstats peerstats clockstats filegen loopstats file loopstats type day enable filegen peerstats file peerstats type day enable filegen clockstats file clockstats type day enable # You do need to talk to an NTP server or two (or three).
#server ntp.your-provider.example # org maps to about 1000 low-stratum NTP servers.
Because the board doesn’t have a battery backup, this means that we need a way to set the time when the board is running.
Since I had to do this earlier today, I decided it would make a lot of sense to write it down for the next time that I need to do it.
After splitting disk to two partitions and going to dualboot with Ubuntu 15.10 I discovered weird error: When I reboot back to Windows, the time is X hours delayed, where X roughly equals amount of time I have been using ubuntu. Windows uses the CMOS clock to set the time, and Linux adds or removes the timezone difference to it.