linux

AVM ISDN drivers and Linux 2.6

I had the pleasure of trying to get an AVM Fritz ISA card working under linux 2.6 this week. While drivers for AVM’s premium equipment is in Linux mainline, these drivers are not. The used to be obtained from AVM’s ftp site, but these days, if you look there, all that you’ll find is old 2.4. drivers, and a notice saying future drivers are available in SuSE.

Before I continue, I wish that all hardware vendors that write linux drivers would get them mainlined. I’ve begged AVM to do this before.

I tried porting the old driver to a modern 2.6 kernel, but while I could get it to compile, I never actually got it to work :-)

For the record, and for googlers, here’s how you build these buggers:

  • You read gentoo’s ebuild
  • This points you to somewhere on ftp.suse.com where you can download a 2.6 compatible version of the driver. The URL given didn’t work for me, but I poked around with similar URLs, and came up with the goods
  • You’ll see a sed command that adds some includes to everything. Run this.
  • You’ll also find a whole pile of patches, needed for recent kernels.
  • Really old cards might not be actively patched, but many of the changes in other drivers are applicable to all of them, i.e. in the patch for fritz.pcmcia, the entire atomic_xchg function is removed; this must happen for fritz.classic, too.

I got the fritz.classic driver working with Linux 2.6.21.1, thanks to Gentooers :-)

Linux on-line Software RAID reshaping

I first read about on-line Software RAID reshaping a year ago on LWN. Today I tried it on a live system (that's too big to be backed-up first :-))

I added 2 250GB drives to my existing RAID5 array of 4, making for a 1.2TiB array. The reshape took a while...:

md0 : active raid5 sdb1[4] sda1[5] sdf1[2] sde1[3] sdd1[1] sdc1[0]
      732587712 blocks super 0.91 level 5, 64k chunk, algorithm 2 [6/6] [UUUUUU]
      [>....................]  reshape =  1.9% (4800784/244195904) finish=397.4min speed=10034K/sec

But when it was done:

$ df -h
/dev/md0              1.2T  657G  509G  57% /mnt/storage

This is one of the reasons why I love software RAID, while you have a kak load more I/O through the PCI(E) bus than you would with hardware RAID, you get the flexibility of the highest-end hardware controllers on a normal PC motherboard.

And of course, should things go pear-shaped, I don't need to find an identical controller, I just have to find a box with 6 SATA sockets.

HOWTO reshape

Lets say you have 4 SATA drives, /dev/sda to /dev/sdd, and you are adding a new one /dev/sde.

Check that everything is happy:

$ cat /proc/mdstat
md0 : active raid5 sdd1[3] sdc1[1] sdb1[2] sda1[0]
      937705728 blocks level 5, 128k chunk, algorithm 2 [4/4] [UUUU]

Partition the new drive (clone sdas partition table onto sde):

# sfdisk -d /dev/sda | sfdisk /dev/sde

Add the new drive:

# mdadm -a /dev/md0 /dev/sde1

Grow the RAID:

# mdadm --grow -n5 /dev/md0

Watch the progress:

$ watch cat /proc/mdstat

Grow the filesystem:

# resize_reiserfs /dev/md0

See the extra space:

$ df -h

Horrific performance with 3ware RAID

I’ve been enjoying our server at UK2.net. It’s a pretty speedy machine (although a little light on RAM - I suspect that they don’t want people running Xen), and it’s connected to a fat pipe. But I’ve been experiencing a lot of bad lockups.

I traced the problem to postmaping the uceprotect.net RBL file. They recommend that you rsync this file from them, and then postmap it into a fast lookup database for postfix, rather than using their DNSRBL service. But running the postmap was taking my box 40 mins. The same operation, on a loaded, lower-spec, 2 year old server took 2 mins (yes this server also has RAID1 on the volume concerned). On my UK2 box, while the postmap was running, the machine became totally unresponsive, and it could take a minute or two to log in, serve a web page, or even execute a basic command like ps.

Clearly something wasn’t right. And it was something in the IO system. The only answer is the 3ware RAID controller. (It’s a 8006-2, doing RAID-1) I know these controllers have a big buffer, so I looked up the 3ware website, for tuning guidance. I followed it to the letter, and things didn’t really improve. I tried the deadline scheduler, and tweaking the buffers, but it only got marginally better.

Personally, I’ve always used software RAID, even for RAID-5, and I’ve never had bad performance like that. And having the RAID in a portable format has really helped with recovery in the past. I understand that Windows monkeys have to use hardware RAID (because their software RAID sucks so much), but is this kind of performance normal?

I’ve asked UK2 to chuck my controller and give me software RAID :-)

Update

I’ve now got software RAID 1, and postmap runs in 25 seconds. That’s what I call a 60x speed improvement :-)

Oh, and the system is totally responsive while the postmap runs.

Cross compile kernel

I decided I wanted a 64bit kernel for my UK2 server (seeing as it’s an Athlon X2, and I wanted an ubuntu amd64 chroot to work on it).

After a little playing around, this is how you do it:

  • Get your kernel
  • Extract it
  • make menuconfig ARCH=x86_64
  • Create some linux-amd64-gcc, linux-amd64-ld, etc. wrappers. Some need -m64 options. Others autodetect what’s required. (I made a tarball of my wrappers, but they’ve been lost.)
  • CONCURRENCY_LEVEL=4 make-kpkg --append-to-version '-londonpride' --revision '1.00' --rootcmd fakeroot --arch amd64 kernel_image
  • Extract the control.tar.gz from the deb, edit control file, and change the architecture to i386.
  • Install

Unfortunaly, in the week after this, my machine died of disk corruption. This is the 2nd time it’s happened. I hope UK2 don’t use dodgy hardware…

Syndicate content