You corrected the running system's clock with `date -s`, but after the next power cycle the machine came back with the old wrong time. Which command copies the corrected system clock into the hardware (RTC) clock?
LPIC-1 Exam 102-500, objective 108. Essential system services medium
Draft — not checked yet. This question was written from the published exam objectives and cites the clause it comes from, but nobody has yet read it against that clause and signed for it.
It is kept out of search results and out of mock exams until they have. Read the source below before you take the answer as settled.
The options
Correct hwclock --systohc
Correct. --systohc (short form -w) writes the current system time into the hardware real-time clock, which is the clock the machine reads at the next boot.
Not correct hwclock --hctosys
Wrong, and the exact opposite direction. --hctosys (short form -s) sets the system clock from the hardware clock, which would restore the wrong time.
Not correct hwclock --show
Wrong. --show (short form -r) only reads and prints the hardware clock. It changes nothing.
Not correct hwclock --adjust
Wrong. --adjust applies the accumulated drift correction recorded in /etc/adjtime to the RTC. It compensates for the RTC's own inaccuracy; it does not copy the current system time into it.
Why
Linux keeps two clocks: the system clock maintained by the kernel, and the battery-backed hardware clock in the machine. date reads and writes only the system clock. hwclock bridges them: -w/--systohc pushes system to hardware, -s/--hctosys pulls hardware to system. On a systemd host, `timedatectl set-time` sets both at once, and enabling NTP synchronisation also causes the RTC to be updated periodically.
Where this comes from
- Cited
- LPI exam objective 108.1
- What it says
- Set the system date and time, and set the hardware clock to the correct time in UTC.
Practise this
Reading one question is not practice. The trainer will draw a set from objective 108 and space the ones you get wrong.