LFCS · Question #523
On a dual boot system, every time the system is booted back into Linux the time has been set backward by one day. Which of the following commands will correct the problem?
The correct answer is B. hwclock --systohc --localtime. When a dual-boot system shows time discrepancies in Linux after booting into another OS, it usually indicates a conflict in how the operating systems interpret the hardware clock (RTC).
Question
Options
- Adate -d '+ 1 day'
- Bhwclock --systohc --localtime
- Cntpdate pool.ntp.org
- Dtime hwclock
How the community answered
(46 responses)- A2% (1)
- B83% (38)
- C11% (5)
- D4% (2)
Why each option
When a dual-boot system shows time discrepancies in Linux after booting into another OS, it usually indicates a conflict in how the operating systems interpret the hardware clock (RTC).
The `date -d '+ 1 day'` command would simply advance the system date by one day, which is a temporary fix and does not address the underlying issue of how Linux interprets the hardware clock.
The `hwclock --systohc --localtime` command configures the system to interpret the hardware clock (RTC) as local time and then saves the current system time to the RTC using this interpretation. This resolves issues where Windows sets the RTC to local time and Linux incorrectly interprets it as UTC, causing the apparent time shift.
The `ntpdate pool.ntp.org` command synchronizes the system time with an NTP server, but it does not reconfigure how Linux interacts with the hardware clock, so the problem would likely reoccur on reboot.
The command `time hwclock` would measure the execution time of the `hwclock` command, not configure the hardware clock settings to resolve time discrepancies.
Concept tested: Hardware clock synchronization in dual-boot systems
Source: https://man7.org/linux/man-pages/man8/hwclock.8.html
Topics
Community Discussion
No community discussion yet for this question.