Академический Документы
Профессиональный Документы
Культура Документы
v=oMnkXRdswO4
https://help.ubuntu.com/community/UbuntuTime#Multiple_Boot_Systems_Time_Conflicts
Operating systems store and retrieve the time in the hardware clock located on your
motherboard so that it can keep
track of the time even when the system does not have power.
Most operating systems (Linux/Unix/Mac) store the time on the hardware clock as
UTC by default,
though some systems (notably Microsoft Windows) store the time on the hardware
clock as the 'local' time.
This causes problems in a dual boot system if both systems view the hardware clock
differently.
The advantage of having the hardware clock as UTC is that you don't need to change
the hardware clock when moving
between timezones or when Daylight Savings Time (DST) begins or ends as UTC does
not have DST or timezone offsets.
Changing Linux to use local time is easier and more reliable than changing Windows
to use UTC, so dual-boot
Linux/Windows systems tend to use local time.
Note: This method was not initially supported on Windows Vista and Server 2008, but
came back with Vista SP2,
Windows 7, Server 2008 R2 and Windows 8/8.1.
To make MS Windows calculate the time from the hardware clock as UTC.
Create a file named WindowsTimeFixUTC.reg with the following contents and then
double click on it to merge
the contents with the registry:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
"RealTimeIsUniversal"=dword:00000001
Note: Windows Time service will still write local time to the RTC regardless of the
registry setting above on shutdown,
so it is handy to disable Windows Time service with this command (if time sync is
still required while in Windows
use any third-party time sync solution):
You can create a file with the following contents and then double-click it to merge
in the original changes, as above:
If Windows Time service was disabled, enable it again with the command:
To tell your Ubuntu system that the hardware clock is set to 'local' time:
edit /etc/default/rcS
add or change the following section
timedatectl set-local-rtc 1
Troubleshooting
Is NTP installed?
Run dpkg-query --list ntp\* and look for ntp-simple (pre 7.04) or ntp. The ntpdate
and ntp-doc packages may also be useful.
By default NTP uses /etc/ntp.conf. If /etc/ntp.conf.dhcp exists then the NTP daemon
assumes you're using DHCP
to redefine the NTP settings and it uses that file instead.
Your DHCP server must be configured to supply NTP servers (man dhcpd.conf may be
helpful).
Your client must be configured to use the supplied NTP servers. To do this, add
ntp-servers to the request
(or even require) line in /etc/dhcp3/dhclient.conf. You may wish to use the
default and prepend features as well
to provide default/additional NTP servers. Please see man dhclient.conf and man
dhcp-options for details.
Is NTP running?
NTP most commonly 'fails' if it cannot resolve the servers in its configuration
file at startup (this can happen
if DNS isn't available during boot). Also, if NTP is unable to keep the local clock
reasonably accurate it gives up
and terminates (see below).
Try sudo /etc/init.d/ntp status to check if NTP is running, and sudo
/etc/init.d/ntp restart to restart it if necessary.
$ cat /etc/cron.hourly/BOUNCE-NTP
#!/bin/sh
If your network or ISP have an NTP server they should be listed here. Failing that,
try ntp.ubuntu.com and/or the
NTP pool servers (http://www.pool.ntp.org/). 3 or 4 servers is plenty, and don't
use a server without permission
(see http://en.wikipedia.org/wiki/NTP_vandalism).
If host $servername fails then you may have DNS issues that need to be fixed
($servername is the name of a server listed
in your configuration file, see above).
If ntptrace $servername fails then you may have routing/firewall issues that need
to be fixed ($servername is the name of
a server listed in your configuration file, see above). NTP uses UDP port 123,
make sure these packets can are properly
NAT-ed through your gateway if necessary.
--numeric removes the DNS lookups. You can leave it off, but don't be surprised if
the resolved names don't match names
in the ntp.conf file.
Ideally you want a * and a few +'s in the fist column and a reach of 377
(see http://www.ntp.org/ntpfaq/NTP-s-trouble.htm#Q-MON-REACH)
delay is in milliseconds. It should be < 1 for local network servers, < 10 for ISP
servers over DSL and
ideally < 100 for wireless. offset is in milliseconds and is the current best guess
of the time difference
between your system and the server. The smaller the better! jitter is an estimate
the the local clock frequency error.
The smaller the better. If it's consistently high then your system may be drifting
(see below)