How to fix the issue of changes to the hardware time in Linux not taking effect?
If changing the hardware time in a Linux system doesn’t take effect, you can try the following solution:
- Check the system time synchronization service: Ensure that the system time synchronization service (like ntp) is correctly configured and running. You can use the following command to check the status of the ntp service:
- Check the status of the NTP service.
- Force synchronize time: Use the following command to force synchronize hardware time and system time:
- Update the system clock to the hardware clock.
- Check the hardware clock driver module: Sometimes the hardware clock driver module may not be loaded correctly. You can use the following command to check if the hardware clock driver module is loaded.
- Show all currently loaded kernel modules that contain “rtc” in their names.
- If no output is generated, you can try loading the hardware clock driver module.
- Load the rtc module.
- Check BIOS settings: In some cases, BIOS settings may prevent hardware time changes from being effective. Please enter the BIOS setup interface and verify that the system time and clock settings are correct.
- Try using alternative time synchronization services, such as chrony or systemd-timesyncd, if you are currently using ntp.
If the above methods cannot solve the issue, it is recommended to reinstall the operating system or contact the system administrator for further investigation and repair.