Archive for December, 2006

The modules needed for properly setting up lm-sensors on my Tyan motherboard are:

  • i2c-nforce2
  • lm85
  • k8temp

And the lowest version of lm-sensors with support for k8temp is 2.10.1.

I am still at a loss about reading the output, though.
# sensors
lm85-i2c-0-2d
Adapter: SMBus nForce2 adapter at 2d00
V1.5: +1.81 V (min = +0.00 V, max = +3.32 V)
VCore: +1.25 V (min = +0.00 V, max = +2.99 V)
V3.3: +3.25 V (min = +0.00 V, max = +4.38 V)
V5: +4.97 V (min = +0.00 V, max = +6.64 V)
V12: +12.06 V (min = +0.00 V, max = +15.94 V)
CPU_Fan: 0 RPM (min = 0 RPM)
fan2: 1626 RPM (min = 0 RPM)
fan3: 0 RPM (min = 0 RPM)
fan4: 0 RPM (min = 0 RPM)
CPU Temp: +40°C (low = -128°C, high = +127°C)
Board Temp:
+36°C (low = -127°C, high = +127°C)
Remote Temp:
+46°C (low = -127°C, high = +127°C)
CPU_PWM: 255
Fan2_PWM: 255
Fan3_PWM: 255
vid: +1.550 V (VRM Version 2.4)

lm85-i2c-0-2e
Adapter: SMBus nForce2 adapter at 2d00
V1.5: +1.80 V (min = +0.00 V, max = +3.32 V)
VCore: +1.25 V (min = +0.00 V, max = +2.99 V)
V3.3: +3.25 V (min = +0.00 V, max = +4.38 V)
V5: +4.97 V (min = +0.00 V, max = +6.64 V)
V12: +12.12 V (min = +0.00 V, max = +15.94 V)
CPU_Fan: 1167 RPM (min = 0 RPM)
fan2: 1218 RPM (min = 0 RPM)
fan3: 0 RPM (min = 0 RPM)
fan4: 0 RPM (min = 0 RPM)
CPU Temp: +33°C (low = -128°C, high = +127°C)
Board Temp:
+35°C (low = -127°C, high = +127°C)
Remote Temp:
+32°C (low = -127°C, high = +127°C)
CPU_PWM: 255
Fan2_PWM: 255
Fan3_PWM: 255
vid: +1.550 V (VRM Version 2.4)

lm85-i2c-1-2d
Adapter: SMBus nForce2 adapter at 2e00
V1.5: +1.81 V (min = +0.00 V, max = +3.32 V)
VCore: +1.25 V (min = +0.00 V, max = +2.99 V)
V3.3: +3.25 V (min = +0.00 V, max = +4.38 V)
V5: +4.97 V (min = +0.00 V, max = +6.64 V)
V12: +12.06 V (min = +0.00 V, max = +15.94 V)
CPU_Fan: 0 RPM (min = 0 RPM)
fan2: 1626 RPM (min = 0 RPM)
fan3: 0 RPM (min = 0 RPM)
fan4: 0 RPM (min = 0 RPM)
CPU Temp: +40°C (low = -128°C, high = +127°C)
Board Temp:
+36°C (low = -127°C, high = +127°C)
Remote Temp:
+46°C (low = -127°C, high = +127°C)
CPU_PWM: 255
Fan2_PWM: 255
Fan3_PWM: 255
vid: +1.550 V (VRM Version 2.4)

lm85-i2c-1-2e
Adapter: SMBus nForce2 adapter at 2e00
V1.5: +1.81 V (min = +0.00 V, max = +3.32 V)
VCore: +1.25 V (min = +0.00 V, max = +2.99 V)
V3.3: +3.25 V (min = +0.00 V, max = +4.38 V)
V5: +4.97 V (min = +0.00 V, max = +6.64 V)
V12: +12.12 V (min = +0.00 V, max = +15.94 V)
CPU_Fan: 1167 RPM (min = 0 RPM)
fan2: 1218 RPM (min = 0 RPM)
fan3: 0 RPM (min = 0 RPM)
fan4: 0 RPM (min = 0 RPM)
CPU Temp: +33°C (low = -128°C, high = +127°C)
Board Temp:
+35°C (low = -127°C, high = +127°C)
Remote Temp:
+32°C (low = -127°C, high = +127°C)
CPU_PWM: 255
Fan2_PWM: 255
Fan3_PWM: 255
vid: +1.550 V (VRM Version 2.4)

k8temp-pci-00c3
Adapter: PCI adapter
Core0: +46°C
Core1: +47°C

k8temp-pci-00cb
Adapter: PCI adapter
Core0: +47°C
Core1: +51°C

There is no such thing as coolers for a Socket F. There isn’t enough information on the internet for me to actually say anything that I can vote for, but here is my experience.

On my Tyan Thunder n3600B there are two couples of retention brackets. These brackets are screwed around the socket and it is thus possible to use any cooler that is compatible with Socket AM2.

Since I was stupid enough to buy a couple of coolers that are too big to fit when placed close to each other (the sockets are a bit too close, but that’s what I get for getting an ATX motherboard) I also learned that coolers for Socket AM2 are compatible with Socket 754, and possibly all other recent AMD sockets. After all, it is just a clip and luckily the dimensions of that clip haven’t changed much.

In Vim, to move the cursor to a location where there is no character, use the “virtualedit” or “ve” commands. E.g., :set ve=all and then move around freely. I always keep forgetting that.

I’m building a new server, but since I am a little short on cash I managed to only buy two 500GB Western Digital hard drives. The logical solution would be to add them to a RAID-1. RAID-0 offers no redundancy in case of a crash, and RAID-5 is not possible if you believe what everyone is saying, including this Wikipedia article.

The truth is that RAID-5 requires only two drives to operate properly. The way RAID-5 works is that it stores the checksum of all data blocks in a stripe in a checksumming block on the same stripe. So, if you have only two disks you’ll get the data of one disk checksummed on the other and they’ll go on alternating as per the specification. In other words, by joining my two disks on a RAID-5 I’ll get almost the equivalent of a RAID-1. And if you don’t believe me, here is how to try it for yourselves.

First, create two empty files of about 100MB in size:
dd if=/dev/zero bs=100M count=1 of=diskA
dd if=/dev/zero bs=100M count=1 of=diskB

Bind them to a loopback device:
losetup /dev/loop/0 $PWD/diskA
losetup /dev/loop/0 $PWD/diskB

Create a RAID-5 on the two loop devices:
mdadm -C -n 2 -l 5 -a yes /dev/md/0 /dev/loop/[01]

Check the progress, it should be recovering one disk… wait until it is complete (or not, your choice).
cat /proc/mdstat
Perosnalities: [raid6] [raid5] [raid4]
md0 : active raid5 loop1[1] loop0[1]
102336 blocks level 5, 64k chunk, algorithm 2 [2/2] [UU]

Now make a filesystem and copy some files over:
mkreiserfs /dev/md/0
mount /dev/md/0 /mnt
rsync -avP /usr/portage/distfiles/ /mnt/

The rsync command will fail if you are copying more than 100MB but don’t sweat it too much. Get the md5 checksums of the original and the copied files:
cd /mnt; md5sum * > ~/md5sum-copied
cd /usr/portage/distfiles; ls /mnt | xargs md5sum > ~/md5sum-original

Except for the last file, the checksums should match. Now go ahead and fail a drive:
mdadm --fail /dev/md/0 /dev/loop/0

Repeat the md5summing process, did it match? It did. Try remounting the directory, it will still work.

But why would one want to go to all the trouble of using RAID-5 on two disks if it offers no advantages over RAID-1. Well, with recent kernels it is possible to grow existing RAID-5 arrays by adding new disks. I am planning on getting at least one more hard drive, possibly two. I could subsequently add them to the current two-disk setup and get a real RAID-5 with three or four disks. Here, try it out for yourselves:

dd if=/dev/zero of=disk2 bs=100M count=1
losetup /dev/loop/2 $PWD/disk2
mdadm --add /dev/md/0 /dev/loop/2
mdadm --grow -n 3 /dev/md/0

Now check /proc/mdstat for the reshaping process. Eventually it will finish and all you have to do then is resize your file systems and maybe partitions if you created partitionable arrays, and you’re done.

From an expandability point of view, RAID-5 on two disks does make a lot of sense.

Here is a short summary of how I am managing my SSL certificates

  • Edit /etc/ssl/openssl.cnf and add a section for each separate certificate authority, e.g. CA_servers CA_clients, CA_vpn
  • Use a safe umask: umask 077
  • Generate a private key
    • an unencrypted key (no password needed) openssl genrsa -out key.pem 2048
    • an encrypted key (with a password) openssl genrsa -aes256 -out key.pem 2048
  • Create a certificate request:openssl req -new -key key.pem -out req.pem
  • Sign the certificate: openssl ca -name CA_vpn -in req.pem -out cert.pem
  • Optionally add specific extensions to the signed certificate:
    • Prepare a section in /etc/ssl/openssl.cnf like this:
      [ext_server]
      nsCertType = server, client
    • Modify the signing command like this:
      openssl ca -name CA_vpn -in req.pem -out cert.pem -extensions ext_server

After trying to use jumbo frames on my newly upgraded network and realizing that one adapter is not enough, I simply left things as they were. Come today, my NFS mounted directories on the server were unaccessible and none of restarting the NFS server (just the NFS server process, not the machine itself) unmounting the directories or trying to mount them again helped. Eventually a little playing around with tcpdump on both the server and client
tcpdump -i any port 2049 revealed that the client was sending requests and the server the appropriate responses, but for some reason the responses were not reaching the client. Quickly disabling the jumbo frames on the server ip link set mtu 1500 dev lan and everything was back in order.
Conclusion: Jumbo frames are evil.

Update: The Gentoo Linux Wiki has a nice tip about jumbo frames and NFS and why it is not good to mix jumbo with standard frames.

Google webmaster tools will not verify a site by the file upload method if it does not return a proper 404 code on missing pages. With Wordpress and permalinks enabled, everything is redirected to index.php, which does exist and unless the PHP code itself overrides the return code, the response would be 200.
The solution is to simply edit headers.php in the theme and add the following to the beginning of the file:
<?php
if (is_404()) { header('HTTP/1.1 404 Not Found'); } ?>

As quoted on the VMware Knowledge Base, running a 64-bit guest operating system requires one of the following:

  • AMD Athlon 64, revision D or later
  • AMD Opteron, revision E or later
  • AMD Turion 64, revision E or later
  • AMD Sempron, 64-bit-capable revision D or later (experimental support)
  • Intel EM64T VT-capable processors (experimental support)

I don’t have such a processor so I should stop trying to run a 64-bit system in VMware.

The server that this blog is running on has served me well. It is running e-mail with SPAM and anti-virus filtering, officially mirroring several OSS projects and it is also serving several web pages. It is doing its job well, but it has been pushed too hard and it is time for a replacement. When putting it together (actually upgrading it from a Slot A Athlon) I had bought an ASUS P4S533-X motherboard which allowed my to go with a cheap Celeron running at 2.4GHz and reuse two of several PC133 512MB DIMMs (buying DDR would have been too much for me at that time). And it has run like that for quite a while.

When I decided to upgrade the machine, I decided that I’ll buy something that is going to run for a while. So I decided to go with a couple of the new dual core Opteron processors (the HE type) a reasonable TYAN motherboard and four pieces of 512MB DDR2 DIMMs (registered memory is still too expensive). So, it was hard enough to find a retailer carrying all these items in Japan… it seems that if you want to buy the latest and greatest gaming hardware you can step in any shop, but for server hardware you have to look high and low. Fortunately I did find a shop. MYSPEC.com obviously specialize in server hardware and have everything that I need. There is also PC-IDEA who do have plenty of stuff, but the prices of what I was looking for are a tad higher and the choice of CPUs non-existent. They do have plenty of Socket F motherboards, but the guys at MYSPEC.com did have what I need.

Anyway, the real problem appears to come when buying a cooler for the CPUs. Apparently such a thing as Socket F coolers does not exist. Well, not for us, ordinary people it doesn’t. Part of the fault seems to go to AMD, who apparently released two different specifications for the Socket F. It also seems that most of the currently released boards are compatible with the older Socket 940 coolers. I also read that TYAN are specifically including clips that would allow Socket 940 to be used with their Socket F motherboards. I cannot find the links now, but I guess I’ll get a couple of Socket F coolers and hope for the best. It’s frustrating… buying a 250,000 yen computer and being unable to find a cooler or at least some information as to what cooler to buy. It’s probably best to simply ask the guys that I’m buying from.

I got a new Intel Pro/1000 XT server adapter, a so-so switching hub (NetGear GS105) and I immediately upgraded my network. Since both the Intel adapter and the switch were jumbo frame compatible, I decided to try that feature out. Ran the following commands on the server (with the Intel adapter):
ip link set mtu 9000 dev lanand after a small delay everything seemed to be OK.

Ran the same command on my workstation — an Asus K8V SE Deluxe motherboard with an onboard Marvell Gigabit adapter. The screen froze and after a few seconds the computer rebooted. That’s with a vanilla 2.6.18.5 kernel. Gotta be more careful.