ntp won't work on read-only Raspberry Pi
I found this question while facing a similar issue.
The issue turned out to be that systemd
's PrivateTmp
feature does not work in a read-only configuration.
- Be sure to install
ntp
andntpdate
sudo apt install -y ntp ntpdate
Copy
/lib/systemd/system/ntp.service
to/etc/systemd/system/ntp.service
cp /lib/systemd/system/ntp.service /etc/systemd/system/ntp.service
Open
/etc/systemd/system/ntp.service
and comment outPrivateTmp=true
.sudo nano /etc/systemd/system/ntp.service
Now, it should work correctly!
As an additional step I have also now mounted /var/lib/ntp
as tmpfs
as recommended here
- Open
/etc/fstab
and addtmpfs /var/lib/ntp tmpfs nosuid,nodev 0 0
at the end of file.sudo nano /etc/fstab
I didn't find this necessary in my case but there are additional insights into running on a read-only filesystem there.