lm_sensors: sensors-detect finds a sensor but cannot load module

After installing lm_sensors and running sensors-detect, the following happens:

*omitting first part of sensors-detect output*

Now follows a summary of the probes I have just done.
Just press ENTER to continue: 

Driver `w83627hf':
  * ISA bus, address 0x290
    Chip `Winbond W83637HF/HG Super IO Sensors' (confidence: 9)

Do you want to overwrite /etc/sysconfig/lm_sensors? (YES/no): 
Starting lm_sensors: loading module w83627hf No sensors found!
Make sure you loaded all the kernel drivers you need.
Try sensors-detect to find out which these are.
[FAILED]

Unloading i2c-dev... OK

From the above, it is obvious that a sensor is found, but the module is not being loaded. Check dmesg to see if there is an ACPI conflict:

w83627hf: Found W83637HF chip at 0x290
ACPI: I/O resource w83627hf [0x295-0x296] conflicts with ACPI region IP__ [0x295-0x296]
ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
i2c /dev entries driver
w83627hf: Found W83637HF chip at 0x290
ACPI: I/O resource w83627hf [0x295-0x296] conflicts with ACPI region IP__ [0x295-0x296]
ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
i2c /dev entries driver
w83627hf: Found W83637HF chip at 0x290
ACPI: I/O resource w83627hf [0x295-0x296] conflicts with ACPI region IP__ [0x295-0x296]
ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver



To resolve this issue, add acpi_enforce_resources=lax to the boot parameters:

hiddenmenu
title CentOS (2.6.32-71.el6.x86_64)
        root (hd0,0)
        kernel /vmlinuz-2.6.32-71.el6.x86_64 ro root=UUID=75da8d80-9b93-4ea1-8f3c-0ce53b3b4d5c rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=us SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto acpi_enforce_resources=lax rhgb quiet
        initrd /initramfs-2.6.32-71.el6.x86_64.img

Booting Linux without a Graphics Card

I have a spare Pentium 4 computer lying around. Unfortunately, it has no video card; nor did it have an onboard integrated graphics card. In order to install CentOS 6, I had to ‘borrow’ a card from another computer. While I had the card installed, I ensured the BIOS did not halt on any errors and it booted off PXE after HD. After testing the boot process a few times, I ‘returned’ the card to its rightful place – leaving the pentium 4 without a card and me hoping the computer still works.

Upon turning the computer on, the POST process would beep a morse code “long short short” signifying there is no graphics card and the computer would freeze (The numlock key on the keyboard froze). After unplugging the hard drive and hard resetting the computer, it would by default boot via PXE without a problem (I can see tftp and nfs traffic as it began booting ubuntu). This proved that the computer indeed was getting past POST without a problem.

After hitting my head against the wall for a few hours, it appears that grub needs to be set into console mode otherwise grub will cause the boot process to hang. To resolve this, the following changes were made in /boot/grub/menu.lst

default=0
timeout=5
#splashimage=(hd0,0)/grub/splash.xpm.gz
serial --unit=0 --speed=9600 --parity=no --stop=1
terminal --timeout=2 serial

Note that the splash image is commented out and the boot mode is now set to use the serial port (which the computer doesn’t have)

Once this was set, the computer boots without a problem.

Pentium 4 @ 2.93GHz Benchmark

The following is the benchmark results of:

Pentium 4 @ 2.93GHz
MS-7091 Motherboard
1 GB memory
1 80GB IDE 7.2k HDD

cat /proc/cpuinfo

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 15
model           : 4
model name      : Intel(R) Pentium(R) 4 CPU 2.93GHz
stepping        : 9
cpu MHz         : 2933.260
cache size      : 1024 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 1
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx 
fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc pebs bts pni dtes64 monitor ds_cpl tm2 cid cx16 xtpr
bogomips        : 5851.95
clflush size    : 64
cache_alignment : 128
address sizes   : 36 bits physical, 48 bits virtual
power management:

free -m
             total       used       free     shared    buffers     cached
Mem:           997        716        280          0         32        509
-/+ buffers/cache:        174        822
Swap:         1023          0       1023

The benchmark results follows:

========================================================================
   BYTE UNIX Benchmarks (Version 5.1.2)

   System: server: GNU/Linux
   OS: GNU/Linux -- 2.6.32-71.el6.x86_64 -- #1 SMP Fri May 20 03:51:51 BST 2011
   Machine: x86_64 (x86_64)
   Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
   CPU 0: Intel(R) Pentium(R) 4 CPU 2.93GHz (5851.9 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSCALL/SYSRET
   CPU 1: Intel(R) Pentium(R) 4 CPU 2.93GHz (5851.0 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSCALL/SYSRET
   09:54:59 up 58 min,  1 user,  load average: 0.00, 0.01, 0.00; runlevel 3

------------------------------------------------------------------------
Benchmark Run: Sun Aug 28 2011 09:54:59 - 10:22:57
2 CPUs in system; running 1 parallel copy of tests

Dhrystone 2 using register variables        9237768.7 lps   (10.0 s, 7 samples)
Double-Precision Whetstone                     1526.3 MWIPS (9.8 s, 7 samples)
Execl Throughput                               1453.5 lps   (29.9 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks        260995.2 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks           80632.3 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks        557034.8 KBps  (30.0 s, 2 samples)
Pipe Throughput                              558617.5 lps   (10.0 s, 7 samples)
Pipe-based Context Switching                  47254.6 lps   (10.0 s, 7 samples)
Process Creation                               4953.0 lps   (30.0 s, 2 samples)
Shell Scripts (1 concurrent)                   2069.1 lpm   (60.0 s, 2 samples)
Shell Scripts (8 concurrent)                    310.8 lpm   (60.0 s, 2 samples)
System Call Overhead                         598237.8 lps   (10.0 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0    9237768.7    791.6
Double-Precision Whetstone                       55.0       1526.3    277.5
Execl Throughput                                 43.0       1453.5    338.0
File Copy 1024 bufsize 2000 maxblocks          3960.0     260995.2    659.1
File Copy 256 bufsize 500 maxblocks            1655.0      80632.3    487.2
File Copy 4096 bufsize 8000 maxblocks          5800.0     557034.8    960.4
Pipe Throughput                               12440.0     558617.5    449.0
Pipe-based Context Switching                   4000.0      47254.6    118.1
Process Creation                                126.0       4953.0    393.1
Shell Scripts (1 concurrent)                     42.4       2069.1    488.0
Shell Scripts (8 concurrent)                      6.0        310.8    518.1
System Call Overhead                          15000.0     598237.8    398.8
                                                                   ========
System Benchmarks Index Score                                         436.7

------------------------------------------------------------------------
Benchmark Run: Sun Aug 28 2011 10:22:57 - 10:51:06
2 CPUs in system; running 2 parallel copies of tests

Dhrystone 2 using register variables        9042652.5 lps   (10.0 s, 7 samples)
Double-Precision Whetstone                     1577.6 MWIPS (9.8 s, 7 samples)
Execl Throughput                               1535.1 lps   (29.9 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks        187110.7 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks           51088.8 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks        534814.5 KBps  (30.0 s, 2 samples)
Pipe Throughput                              540751.4 lps   (10.0 s, 7 samples)
Pipe-based Context Switching                  71007.1 lps   (10.0 s, 7 samples)
Process Creation                               6744.7 lps   (30.0 s, 2 samples)
Shell Scripts (1 concurrent)                   2378.1 lpm   (60.0 s, 2 samples)
Shell Scripts (8 concurrent)                    311.5 lpm   (60.1 s, 2 samples)
System Call Overhead                         808664.0 lps   (10.0 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0    9042652.5    774.9
Double-Precision Whetstone                       55.0       1577.6    286.8
Execl Throughput                                 43.0       1535.1    357.0
File Copy 1024 bufsize 2000 maxblocks          3960.0     187110.7    472.5
File Copy 256 bufsize 500 maxblocks            1655.0      51088.8    308.7
File Copy 4096 bufsize 8000 maxblocks          5800.0     534814.5    922.1
Pipe Throughput                               12440.0     540751.4    434.7
Pipe-based Context Switching                   4000.0      71007.1    177.5
Process Creation                                126.0       6744.7    535.3
Shell Scripts (1 concurrent)                     42.4       2378.1    560.9
Shell Scripts (8 concurrent)                      6.0        311.5    519.2
System Call Overhead                          15000.0     808664.0    539.1
                                                                   ========
System Benchmarks Index Score                                         450.1

Mounting a smb share using fstab

Suppose I have a server at 10.1.1.5 with a samba share. In order to mount it automatically every time my machine boots up, I’ll need to have an entry in /etc/fstab:

//10.1.1.5/Volume_1 /mnt/box cifs credentials=/etc/cifspasswd 0 0

The credentials file contains:

username=leo
password=mypassword

The first time I ran mount -a, I got the following error:

root@server:~# mount -a
mount: wrong fs type, bad option, bad superblock on //box/Volume_1,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

with dmesg showing:


CIFS VFS: No username specified
CIFS VFS: cifs_mount failed w/return code = -22

To resolve this, install cifs-utils

yum -y install cifs-utils

Blocking IPs after X many SSH auth failures

Although there are scripts like DenyHosts, I wanted something that I could run without needing python. What I came up with is a simple one-liner shell command:


cat /var/log/secure*|grep Bye|awk '{print $9}'|sort|uniq --count | awk '$1 >= 50{print "sshd: " substr($2, 0, length($2)-1)}' >> /etc/hosts.deny

That should dump all the IPs in your /var/log/secure which failed at least 50 ssh authentication into your hosts.deny file.

One caveat with this is that multiple IPs will be added to the deny.hosts file if this is ran multiple times. However, this should be easily resolved by saving the IPs in a separate file, and then removing duplicate values using sort & uniq before being dumped into the hosts.deny file.