102-500 practice question 19 of 30

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?

Full set: 233 questions
Answer options
A: date -d '+ 1 day'
B: hwclock --systohc --localtime Correct answer
C: ntpdate pool.ntp.org
D: time hwclock
Correct Answer:
B. hwclock --systohc --localtime
Explanation

In a dual-boot system with Windows, the time discrepancy often occurs because Linux assumes the hardware clock (RTC) is set to Coordinated Universal Time (UTC), while Windows defaults to using local time. The hwclock --systohc --localtime command resolves this by setting the hardware clock from the current system time and simultaneously configuring the system to interpret the hardware clock as being in local time. This creates a persistent configuration that aligns Linux's timekeeping with Windows, preventing time shifts after rebooting between operating systems.

Why Incorrect

A. date -d '+ 1 day': This is a temporary, one-time fix for the system clock and does not address the underlying hardware clock configuration issue.
C. ntpdate pool.ntp.org: This synchronizes the system clock with the internet but does not fix the incorrect interpretation of the hardware clock's time standard.
D. time hwclock: The time command is a utility to measure the execution time of another command; it does not modify any time settings.

References

- hwclock(8) Linux man page. Section: "The --localtime or --utc option". It states, "This is a choice the user must make... If you get it wrong, you will see annoying time jumps when you reboot..."

- Red Hat Enterprise Linux 7 System Administrator's Guide, Chapter 16. "Configuring the Date and Time". It details the use of hwclock and the distinction between UTC and local time for the hardware clock.

- Arch Linux Wiki, "System time", Section 3.1.1 "UTC in Windows". This document explicitly describes the dual-boot time conflict and recommends configuring Linux to use local time for the RTC as a solution.

Scroll to Top