Adventures In Tech

Icon

A technology blog by Ross Macduff

DMA disk kernel errors

At work I was seeing the following errors in /var/log/messages on a RHEL5 box

 Nov  2 10:35:26 host kernel: hdc: dma_intr: status=0x51 { DriveReady SeekComplete Error }
 Nov  2 10:35:26 host kernel: hdc: dma_intr: error=0x84 { DriveStatusError BadCRC }
 Nov  2 10:35:26 host kernel: ide: failed opcode was: unknown

My initial thought was that this was a sign of a failing disk so I ran smartctl on it. The results of that showed that the drive was healthy.  A quick google indicated that these errors indicate an issue with incorrectly set DMA parameters.

When I set this box up I failed to notice that hdc was attached to the bus with a 40-pin cable.  For some reason the kernel was not seeing this limitation during boot and incorrectly set the drive to use UDMA mode 4, which as far as I know is not possible with a 40-pin cable.  I manually set the drive to use UDMA mode 2 with

 hdparm -X  udma2 /dev/hdc

After that, the errors were no longer showing up.

I wasn’t sure if the bus that this drive was on supported higher UDMA transfer rates so I put in an 80-pin cable.  The system came up and strangely enough the drive was seen as supporting only UDMA2.  That indicated to me that the bus could not support the higher UDMA rates so I put the 40-pin cable back in.

Now when the system came back up it was automatically setting it at UDMA3. Now this was the same setup I had when the drive was being seen as supporting UDMA4.  This time, though, there were none of the above errors in the logs, so I was happy.

Still I am not sure how UDMA3 was being supported on a 40-pin cable.  I thought that an 80-pin cable was required.  Need to read more on the ATA specs.

References

  1. AT Attachment, http://en.wikipedia.org/w/index.php?title=AT_Attachment&oldid=250645856 (last visited Nov. 13, 2008).
  2. man hdparm

Filed under: Hardware, Sysadmin, linux

DD-WRT on a WRT54G v5

For those of you who have a Linksys WRT54G and have pondered installing one of the open source linux firmware packages, here are a few tidbits that might help you out if you decide to actually go ahead.

For starters, you will have to see what version your WRT54G is (take a look under your router). My initial plan to install OpenWRT was foiled when I discovered that the version of my router (v. 5) ran a proprietary version of Linux called VXWorks. VXWorks is installed on versions 5 to 8 of the WRT54G and some other models.   All prior versions are supported by OpenWRT.

Thankfully, another popular open source firmware replacement, DD-WRT provides a method of flashing the VXWorks firmware to allow DD-WRT to be installed. It took me all of 15 minutes following these instructions to get the new firmware up and running (this included a 5 minute period where I mistakenly thought that I had bricked my router).

My primary impetus for going with one of these alternate firmwares was so that I could properly route multiple public facing IP addresses. This was easily accomplished using DD-WRT with the aid of some instructions found here: http://www.wrtrouters.com/guides/multipleips/.  Additional iptable rules can be added through the DD-WRT GUI by navigating to Administration -> Commands.

Resources:

  1. OpenWRT – http://openwrt.org/
  2. DD-WRT – http://www.dd-wrt.com/
  3. Supported Hardware – http://www.dd-wrt.com/wiki/index.php/Supported_Devices
  4. Supported Hardware (OpenWRT) – http://wiki.openwrt.org/TableOfHardware
  5. Flashing WRT54G v5/6 for DD-WRT – http://www.bitsum.com/openwiking/owbase/ow.asp?WRT54G5_CFE
  6. Routing multiple IPs – http://www.wrtrouters.com/guides/multipleips/

Filed under: Hardware