Skip to content

Commit dce4fdf

Browse files
authored
Update time-sync.md
Fixing a few discrepancies and making sure we are using sudo to run commands.
1 parent 9123c87 commit dce4fdf

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

articles/virtual-machines/linux/time-sync.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ There are some basic commands for checking your time synchronization configurati
7171
Check to see if the integration service (hv_utils) is loaded.
7272

7373
```bash
74-
lsmod | grep hv_utils
74+
$ sudo lsmod | grep hv_utils
7575
```
7676
You should see something similar to this:
7777

@@ -89,13 +89,13 @@ install the updated driver. When the PTP clock source is available, the Linux de
8989
See which PTP clock sources are available.
9090

9191
```bash
92-
ls /sys/class/ptp
92+
$ ls /sys/class/ptp
9393
```
9494

9595
In this example, the value returned is *ptp0*, so we use that to check the clock name. To verify the device, check the clock name.
9696

9797
```bash
98-
cat /sys/class/ptp/ptp0/clock_name
98+
$ sudo cat /sys/class/ptp/ptp0/clock_name
9999
```
100100

101101
This should return `hyperv`, meaning the Azure host.
@@ -141,7 +141,7 @@ makestep 1.0 -1
141141
Here, chrony will force a time update if the drift is greater than 1 second. To apply the changes restart the chronyd service:
142142

143143
```bash
144-
systemctl restart chronyd && systemctl restart chrony
144+
$ sudo systemctl restart chronyd && sudo systemctl restart chrony
145145
```
146146

147147
### Time sync messages related to systemd-timesyncd
@@ -160,7 +160,7 @@ Aug 1 12:59:45 vm-name systemd-timesyncd[945]: Synchronized to time server 185.
160160
You can disable it by using:
161161
162162
```bash
163-
systemctl disable systemd-timesyncd
163+
$ sudo systemctl disable systemd-timesyncd
164164
````
165165
In most cases, systemd-timesyncd will try during boot but once chrony starts up it will overwrite and become the default time sync source.
166166

@@ -193,7 +193,7 @@ ntp:
193193
driftfile /var/lib/chrony/chrony.drift
194194
logdir /var/log/chrony
195195
maxupdateskew 100.0
196-
refclock PHC /dev/ptp_hyperv poll 3 dpoll -2
196+
refclock PHC /dev/ptp_hyperv poll 3 dpoll -2 offset 0 stratum 2
197197
makestep 1.0 -1
198198
```
199199

0 commit comments

Comments
 (0)