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.

/etc/fstab: Spaces in the source path

In order to mount a directory, image or device with a space in the file path such as:


/mnt/box/downloads/OS/Windows 7 SP1/en_windows_7_with_sp1_dvd.iso ==> /tftpboot/images/windows7

one can type in:


mount -t udf -o loop /mnt/box/downloads/OS/Windows\ 7\ SP1/en_windows_7_with_sp1_dvd.iso /tftpboot/images/windows7/

However, in order to add this entry to the fstab file, one must replace spaces with \040:


# cat /etc/fstab
/mnt/box/downloads/OS/Windows\0407\040SP1/en_windows_7_with_dvd.iso /tftpboot/images/windows7 udf ro,loop,auto 0 0

VirtualBox 4.0.8 Headless on CentOS 5

I was trying to setup VirtualBox on my Athlon 2600+ server under my desk to run Windows XP. The following are the steps which I used to install and use Virtual Box:


Install VirtualBox on CentOS 5

wget http://download.virtualbox.org/virtualbox/4.0.8/VirtualBox-4.0-4.0.8_71778_rhel5-1.i386.rpm
yum -y install libGLU SDL
rpm -ivh VirtualBox-4.0-4.0.8_71778_rhel5-1.i386.rpm


Setting up a VM


As per the documentation at: http://www.virtualbox.org/manual/ch07.html#idp11472496

VBoxManage createvm --name "WindowsXP" --ostype WindowsXP --register
VBoxManage modifyvm "WindowsXP" --memory 256 --acpi on --boot1 dvd --nic1 bridged --bridgeadapter1 eth0
VBoxManage createhd --filename "WindowsXP.vdi" --size 10000
VBoxManage storagectl "WindowsXP" --name "IDE Controller" --add ide --controller PIIX4
VBoxManage storageattach "WindowsXP" --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium "WindowsXP.vdi"
VBoxManage storageattach "WindowsXP" --storagectl "IDE Controller" --port 0 --device 1 --type dvddrive --medium /mnt/box/downloads/OS/windows_xp-sp3.iso
VBoxManage modifyvm "WindowsXP" --vrde on

To start the newly created virtual machine, run:

VBoxHeadless --startvm "WindowsXP" 


Making Remote Desktop Work


By default, the Virtual Box install does not come with the extension pack which enables VRDE. If you attempt to start the VM with VRDE enabled:

VBoxHeadless --startvm "WindowsXP" --vrde on

You will see this error in your log file:

VRDE: VirtualBox Remote Desktop Extension is not available.

To install the extension pack, download the latest extension pack at: http://download.virtualbox.org/virtualbox/

For example:

wget http://download.virtualbox.org/virtualbox/4.0.8/Oracle_VM_VirtualBox_Extension_Pack-4.0.8-71778.vbox-extpack
VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.0.8-71778.vbox-extpack

Changing the DVD drive ISO

First, unmount the image by running:

VBoxManage storageattach "WindowsXP" --storagectl "IDE Controller" --port 0 --device 1 --type dvddrive --medium emptydrive

then remount the drive as shown above.

yum crashing with “thread.error: can’t start new thread”

While attempting to install a package on a VPS, I encountered:

[root@drache ~]# yum install php-mysql
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in ?
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 309, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 178, in main
    result, resultmsgs = base.doCommands()
  File "/usr/share/yum-cli/cli.py", line 345, in doCommands
    self._getTs(needTsRemove)
  File "/usr/lib/python2.4/site-packages/yum/depsolve.py", line 101, in _getTs
    self._getTsInfo(remove_only)
  File "/usr/lib/python2.4/site-packages/yum/depsolve.py", line 112, in _getTsInfo
    pkgSack = self.pkgSack
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 661, in 
    pkgSack = property(fget=lambda self: self._getSacks(),
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 501, in _getSacks
    self.repos.populateSack(which=repos)
  File "/usr/lib/python2.4/site-packages/yum/repos.py", line 232, in populateSack
    self.doSetup()
  File "/usr/lib/python2.4/site-packages/yum/repos.py", line 79, in doSetup
    self.ayum.plugins.run('postreposetup')
  File "/usr/lib/python2.4/site-packages/yum/plugins.py", line 179, in run
    func(conduitcls(self, self.base, conf, **kwargs))
  File "/usr/lib/yum-plugins/fastestmirror.py", line 181, in postreposetup_hook
    all_urls = FastestMirror(all_urls).get_mirrorlist()
  File "/usr/lib/yum-plugins/fastestmirror.py", line 333, in get_mirrorlist
    self._poll_mirrors()
  File "/usr/lib/yum-plugins/fastestmirror.py", line 376, in _poll_mirrors
    pollThread.start()
  File "/usr/lib64/python2.4/threading.py", line 416, in start
    _start_new_thread(self.__bootstrap, ())
thread.error: can't start new thread

The solution was to disable the fastest mirror plugin by editing /etc/yum/pluginconf.d/fastestmirror.conf:

cat /etc/yum/pluginconf.d/fastestmirror.conf
[main]
enabled=0
verbose=0
socket_timeout=3
hostfilepath=/var/cache/yum/timedhosts.txt
maxhostfileage=10
maxthreads=15
#exclude=.gov, facebook

Event ID 9: iaStor0 did not respond within the timeout period

Just tonight, after 40 mins after waking my computer from sleep, my CDROM empty drive started to randomly attempt to read/seek and hang the entire system. The hard disk activity light was also constantly on. Thinking that it was some sort of issue with a rogue program trying to open a file on a CDROM and failing, I rebooted my computer. It took forever to get past BIOS, and the computer hung on the “Starting Windows” screen while booting windows.

At the end, I disconnected the SATA cable connecting the CDROM and attempted to boot the computer again. This time, without the CDROM drive connected, the computer boots as it always had! Looking at Window’s system logs, the error “The device, \Device\Ide\iaStor0, did not respond within the timeout period.” began flooding the logs approximately 40 minutes after my computer turned on. The full error goes as follows:

- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
  <Provider Name="iaStorV" /> 
  <EventID Qualifiers="49156">9</EventID> 
  <Level>2</Level> 
  <Task>0</Task> 
  <Keywords>0x80000000000000</Keywords> 
  <TimeCreated SystemTime="2011-03-02T08:09:59.225343600Z" /> 
  <EventRecordID>8079</EventRecordID> 
  <Channel>System</Channel> 
  <Computer>win7</Computer> 
  <Security /> 
  </System>
- <EventData>
  <Data>\Device\Ide\iaStor0</Data> 
  <Binary>0F0005000100000000000000090004C00100000000000000000000000000000000000000000000000000000000</Binary> 
  </EventData>
  </Event>

A quick google search turned up that it is most probably some issue with the Intel RAID firmware I have on my motherboard. Now, I’m left with one question: What suddenly caused this error to occur? There was no hardware or software changes. The computer had no problems for the past 3 years prior to tonight.

At any rate, I have no problems living without a DVD drive. Who uses those these days anyway (other than to reinstall windows, still haven’t gotten PXE boot to work for WinPE).


Addendum: I recently needed to read some DVDs and replugged in the DVD drive without issue. I’ve no idea why this error occured, but it appeared to have resolved itself during the 2 months when it was completely unplugged from my computer.