Skip to main content

Hardware clock failure in ISA system

In ISA systems /sbin/hwclock will fail to fetch the Hardware clock and will throw an error similar to below.
# hwclock
select() to /dev/rtc to wait for clock tick timed out

# hwclock --show
select() to /dev/rtc to wait for clock tick timed out

But the --directisa option of hwclock will work here.
# /sbin/hwclock --directisa

So as a permanent solution we can rename the existing binary /sbin/hwclock and create a new Wrapper as below

1. Find the version of hwclock
# hwclock --version
2. Rename the binary by suffixing the version number
# cd /sbin
# mv hwclock hwclock-x.y
3. Create a wrapper for the hwclock-x.y named hwclock
# cat > hwclock << HERE
#!/bin/bash
/sbin/hwclock-x.y --directisa \$@
HERE

4. Give necessary execute permission and reboot the server
# chmod +x hwclock
5. Check the hardware clock, System Time, NTP, etc.
To synchronize system time with Hardware clock we can use hwclock --hctosys

And an optional reboot
# reboot

If your system is not ISA the we can try the RTC driver as well. The first thing we have to ensure is the RTC driver is loaded using the below steps.
# lsmod|grep rtc
This will show something like below
rtc 15329 0

If you are not getting any, then the rtc driver has not loaded. You need to load it

# modprobe rtc

Comments

Popular posts from this blog

Check remote UDP connectivity from Linux

Hi there, You all know how to check TCP port connectivity from a Linux or UNIX machine to a remote machine using telnet as per th example below $ telnet 127.0.0.1 25 but we can't adopt TELNET to check UDP connectivity. Linux and most of the UNIXes come with a network layer utility called nc (abbreviation for netcat) which is very useful to check UDP connectivity and to explore a lot with both TCP and UDP. An example is shown below # nc -v -u -z -w 3 172.24.16.131 123 Connection to 172.24.16.131 123 port [udp/ntp] succeeded!

The best putty package available

Bored of Black screened Task bar filling putty? Issues with porting Saved sessions from machine to machine? Do you like tabbed SSH sessions? Start using portaputty instead of normal putty and link it with puttycm . Puttycm supports sessions to be saved in its own Database files. You can use the Putty sessions you have saved already right inside putty. You can have any number of databases which allow you to arrange Remote servers in folders and convenient namings. I personally recommend creating Database with puttycm rather than using the sessions saved in putty which doesn't offer any option to create folders and saving sessions under that directory tree. You can even save username/password to get it logged automatically and there is an option to pass commands to be run soon after login. I can't recommend this since some bug was found with these options. Portaputty is a variant of putty which stores all the Configuration data in text files instead of MS Window

PING.sh

#!/usr/bin/env bash ## Ping all machines in a Network PING="$(which ping) -c 1 -W 1" echo "Enter Subnet(eg:192.168.0)" read Subnet echo "Do you want to PING the entire network or a RANGE of IPs ? Enter your choice" echo 1. Ping Entire Network echo 2. Ping a RANGE read choice if [ $choice = 1 ]; then { echo Pinging..... for((i=1;i<255;i++)); do ${PING} ${Subnet}.${i} > /dev/null 2> /dev/null if [ $? -eq 0 ]; then echo -e "${Subnet}.${i} is up" fi done } fi if [ $choice = 2 ]; then { echo Enter the Starting IP of Range read a echo Enter the Last IP of Range read b echo Pinging..... for((i=$a;i<$b;i++)); do ${PING} ${Subnet}.${i} > /dev/null 2> /dev/null if [ $? -eq 0 ]; then echo -e "${Subnet}.${i} is up" fi done } fi exit 0