0

I created a read-only system from this adafruit link (https://learn.adafruit.com/read-only-raspberry-pi/ ). I have a hwclock and want to change the datetime regularly. But calling

hwclock --set --date='2018-01-31 12:00:00'

results in an error, because it has to change the content of

/etc/adjtime

Do you have any idea what I could do?

In other cases, where write access was necessary I created virtual disks from RAM. But obviously this is not a good idea since it would delete everything in /etc/.

Can I do this with a symlink to another file and use a virtual disk there? If so could someone outline the steps for me. Thank you very much.

0

I have found the answer straightforward in the documentation of the hwclock command. There ist the option --noadjfile which disables the drift compensation (it requires the --localtime or --utc option).

So calling:

hwclock --set --date='2018-01-31 12:00:00' --noadjfile --utc
hwclock -s

sets the time in a read-only file system.

I pretty sure it is also possible to use the --adjfile to give a path to a virtual disk to make use of the drift compensation, but since I update the time requlary I do not need it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.