Dual Boot - Different Time in Windows and Linux

Example image

This post discuss the issue on time synchronisation faced on a computer having multiple Operating System in a dual boot scenario.





  • You have installed Windows as well as Linux in the same instance.You would have observed an odd behaviour on time synchronisation while switching across operating system.The users generally observe that the time is different every time they switch between operating system in a dual boot environment, no matter how many they fix it manually.

  • So how do we solve this?

    Let's say the BIOS maintains the clock in local time zone. Now Windows by default believes the BIOS maintains the time in local time zone and hence doesn't require correction or updates. But we have to tell Linux Operating system that the hardware clock indeed is maintained in local time zone and not in UTC. This update will overall resolve the issue that has been demanding manual update of time when switching across operating system in the same computer.

    Now how we do this.

    In your system, type the command timedatectl . From the result validate the Universal time, Local Time and RTC Time. In the result

    • Universal time is the actual time in UTC.
    • Local Time is the Operating System clock.
    • RTC time is the hardware clock and timezone is the time zone configured in BIOS set up.
    If you would want the the Linux operating system to consider RTC time in local time zone, then execute the command
    timedatectl set-local-rtc 1 --adjust-system-clock
    If you would want the the linux operating system to consider RTC time in Universal time zone, then execute the command
    timedatectl set-local-rtc 0 --adjust-system-clock

  • Every computer assembled has a special chip system that performs the basic check on all the hardware components in the computer and it has the instruction to load the hardware when system in booted. If a coordinated logical operating system is found, then it will pass the control of execution further to the operating system. But irrespective of the above fundamental steps on starting up an system, it is observed that the time in a computer remains updated even when it is switched off and even before we connect or synchronise time with a server. This indeed happens through BIOS Battery which is a small lithium coin cell which keeps this special chip active even when the system is turned off. Any system that has a BIOS battery that fails to function due to aging or any damage will require the time to be updated every time we start our system.

    Now having walked through the fundamental accord on this topic, we should understand that the time is constantly updated by the power supplied through the BIOS Battery. And the BIOS has the updated time which will be read by the Operating system when booted. So in an active system, there are two clocks. The first one being active permanently based on power supplied by BIOS Battery and the second one is the Operating System Clock, that reads the time from BIOS on initial booting. Then on it keeps updating the time on the Operating System clock then on.

    So now the scenario should become self explainable. It is very much as in you have 3 watch at your house and what happens if each of this watch is on different timezone or for that matter believes that other watches are in different time zone. Hence converting time read from one watch ultimately results in wrong projection of time, if there isn't a clarity between multiple operating system clocks and the hardware clock. So every time you change the time in your system, it also gets updated on the hardware clock, because the time maintained by the Operating system in never retained after shutdown.

    So between Windows, Linux and Hardware, the default clock behave as such. During the initial set up of a computer, the hardware clock and timezone is set up appropriately. And having loaded two operating system that will use the time retained by the BIOS will behave as below. Windows by default believes that the Hardware clock is set to local time zone. Hence on boot, it read the value directly from the BIOS and uses it as such without any conversion. Linux by default believe that the Hardware clock is set to UTC time zone. Hence on boot, it reads and converts the value from UTC to local time zone configured on the Linux environment. So considering the above default behaviour, we have to update the reality to the Operating system on how the hardware clock is being maintained across both operating system. You have to validate the timezone configured in BIOS is UTC or Local Timezone. Then you have to convey the same to one of the operating system that would require correction.

Comments

  1. While traditional means of business management encourage the use of spreadsheets and static presentations, Inetsoft eliminates endless amounts of rows and columns and facilitates the automation of processes.

    ReplyDelete
You are welcome to share your thoughts with us in comments!