Monday, March 24, 2008

Setting the computer hardware clock (BIOS or CMOS) from inside a running Linux system

Normally after setting the date and time in Linux (for example using the NTP service or ntpdate, you can set the hardware clock to match with the following command:

hwclock --systohc

That way when you reboot, your clock will still be correct (or close to it).

I've discovered that this method does not work on the newer Dells, such as our 1U PowerEdge 1850s. Supposedly this has something to do with the kernel RTC module, and hardware changes. However, the following command appears to set the clock just fine on the problematic Dell servers:

hwclock --systohc --directisa