nerdexam
CompTIA

LX0-104 · 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 dual-booting Linux and Windows, to prevent the Linux system time from constantly being set backward, the hwclock --systohc --localtime command should be used to configure the hardware clock to store local time.

Administrative Tasks

Question

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?

Options

  • Adate -d '+ 1 day'
  • Bhwclock --systohc --localtime
  • Cntpdate pool.ntp.org
  • Dtime hwclock

How the community answered

(34 responses)
  • A
    12% (4)
  • B
    79% (27)
  • C
    6% (2)
  • D
    3% (1)

Why each option

When dual-booting Linux and Windows, to prevent the Linux system time from constantly being set backward, the `hwclock --systohc --localtime` command should be used to configure the hardware clock to store local time.

Adate -d '+ 1 day'

`date -d '+ 1 day'` only adjusts the system time temporarily for the current session and does not address the underlying issue of how the hardware clock is interpreted or synchronized on reboots.

Bhwclock --systohc --localtimeCorrect

Windows typically expects the hardware clock (RTC) to store local time, while Linux often defaults to assuming the hardware clock stores UTC. Running `hwclock --systohc --localtime` tells Linux to read the system time and then set the hardware clock to that time, treating the hardware clock as if it stores local time, thus synchronizing the hardware clock with the system's local time for both operating systems.

Cntpdate pool.ntp.org

`ntpdate pool.ntp.org` synchronizes the system time with a Network Time Protocol (NTP) server but does not resolve the conflict in how the hardware clock is read or written by different operating systems.

Dtime hwclock

`time hwclock` is a command to measure the execution time of the `hwclock` command and does not perform any time correction or synchronization.

Concept tested: Linux hardware clock configuration, dual boot time sync

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

Topics

#system time#hwclock#time synchronization#dual boot

Community Discussion

No community discussion yet for this question.

Full LX0-104 Practice