nerdexam
CompTIA

LX0-104 · Question #566

On a dual boot system, every time the system is booted back into Linux the time has been set backward by two hours. Which of the following commands will correct the problem so it will not occur again?

The correct answer is C. hwclock --hctosys --localtime. This problem occurs in dual-boot systems because Windows usually assumes the hardware clock (RTC) stores local time, while Linux typically assumes UTC. The hwclock --hctosys --localtime command tells Linux to treat the hardware clock as local time, resolving the discrepancy.

Administrative Tasks

Question

On a dual boot system, every time the system is booted back into Linux the time has been set backward by two hours. Which of the following commands will correct the problem so it will not occur again?

Options

  • Antpdate pool.ntp.org
  • Bdate -d 'two hours'
  • Chwclock --hctosys --localtime
  • Dtime hwclock

How the community answered

(24 responses)
  • A
    13% (3)
  • B
    4% (1)
  • C
    79% (19)
  • D
    4% (1)

Why each option

This problem occurs in dual-boot systems because Windows usually assumes the hardware clock (RTC) stores local time, while Linux typically assumes UTC. The `hwclock --hctosys --localtime` command tells Linux to treat the hardware clock as local time, resolving the discrepancy.

Antpdate pool.ntp.org

`ntpdate` synchronizes the system time with an NTP server but does not permanently change how Linux interprets the hardware clock, so the problem would recur after reboot.

Bdate -d 'two hours'

`date -d 'two hours'` temporarily adjusts the system time but does not reconfigure how Linux interacts with the hardware clock, meaning the issue would return on reboot.

Chwclock --hctosys --localtimeCorrect

The `hwclock` command is used to read and set the hardware clock (RTC). The `--hctosys` option sets the system time from the hardware clock, and `--localtime` specifies that the hardware clock is set to local time rather than UTC, which is common in dual-boot setups with Windows. This configuration ensures that Linux correctly interprets the RTC, preventing time shifts upon reboot.

Dtime hwclock

`time hwclock` measures the execution time of the `hwclock` command itself and does not modify any system time settings or behavior.

Concept tested: Linux hardware clock management in dual-boot systems

Source: https://man7.org/linux/man-pages/man8/hwclock.8.html

Topics

#system time#hardware clock#dual boot#hwclock

Community Discussion

No community discussion yet for this question.

Full LX0-104 Practice