The new server

OS installation take two

Highpoint didn't provide a URL to download older versions of their BIOS. But they DO include the BIOS file along with the (binary only) v1.1 driver for Red Hat. I downloaded the package and successfully flashed the BIOS to version 1.23; nearly two years old.

Since the older BIOS doesn't support RAID1+0 I built a new RAID0+1 array and booted from the Slackware CD. This time I was able to install the hpt374.o module and see a 160Gb /dev/sda. Installation of Slackware then proceeded smoothly.

Booting from the RAID array

Sadly, my troubles were not over yet. Highpoint's "opensource" driver can ONLY be compiled as a module. Needless to say, you can't boot from a controller if it requires a kernel module to operate. The solution was to set up a ramdisk.

Rather than bore you with the reasoning I'll just list the steps required to make the ramdisk.

Actually what follows is all a lie. I used lvmcreate_initrd to make a ramdisk and then added and removed a few files. In case you don't have this script you could make your ramdisk in the following way:

WITHOUT REBOOTING after installing Slackware, chroot to the new system which is mounted on /mnt:

chroot /mnt bash -login

Now you have a shell at the root of the recently installed system. The idea is to create a loopback filesystem, copy the necessary files on to it and then tell LILO to load this filesystem as a ramdisk.

First make a big empty file to hold the filesystem image. Ideally you would use a MINIX filesystem to save memory. lvmcreate_initrd made a 4.5Mb image and built an ext2 filesystem on it.

dd if=/dev/zero of=/boot/initrd-2.4.18 bs=1k count=4470
mke2fs -F /boot/initrd-2.4.18

I repeat that I'm only showing a commandline which would reproduce what the script did for me. In reality this ramdisk turned out to be much larger than necessary after I'd changed things...

Now mount the ramdisk image:

mount -o loop /dev/boot/initrd-2.4.18 /mnt

Populate the ramdisk with the /dev entries you'll need (hint: /dev/MAKEDEV) and files:

drwxr-xr-x    2 root     root         1024 Apr 16 23:45 bin/
-rwxr-xr-x    1 root     bin        532960 Feb 22  2002 bin/bash
-rwxr-xr-x    1 root     root        18256 Apr 16 23:45 bin/mkdir
lrwxrwxrwx    1 root     root            4 Apr 16 23:38 bin/sh -> bash
drwxr-xr-x   14 root     root        37888 Apr 16 23:38 dev/
drwxr-xr-x    2 root     root         1024 Apr 16 23:52 etc/
-rw-r--r--    1 root     root           65 Apr 16 23:38 etc/fstab
-rw-r--r--    1 root     root        12836 Apr 16 23:38 etc/modules.conf
drwxr-xr-x    3 root     root         1024 Apr 16 23:45 lib/
-rwxr-xr-x    1 root     root        83412 Apr 16 23:38 lib/
-rwxr-xr-x    1 root     root      1237848 Apr 16 23:38 lib/
-rwxr-xr-x    1 root     root         8840 Apr 16 23:38 lib/
-rwxr-xr-x    1 root     root        11648 Apr 16 23:38 lib/
drwx------    3 root     root         1024 Apr 17 13:16 lib/modules/
drwxr-xr-x    3 root     root         1024 Apr 17 14:37 lib/modules/2.4.18/
drwxr-xr-x    3 root     root         1024 Apr 17 13:15 lib/modules/2.4.18/kernel/
-rw-r--r--    1 root     root         2522 Apr 17 14:37 lib/modules/2.4.18/modules.dep
drwxr-xr-x    3 root     root         1024 Apr 17 13:15 lib/modules/2.4.18/drivers/
drwxr-xr-x    2 root     root         1024 Apr 17 13:15 lib/modules/2.4.18/drivers/scsi/
-rw-r--r--    1 root     root        70391 Apr 17 14:55 lib/modules/2.4.18/drivers/scsi/hpt374.o
-r-xr-xr-x    1 root     root          300 Apr 17 16:50 linuxrc
drwxr-xr-x    2 root     root         1024 Apr 16 23:51 mnt/
drwxr-xr-x    2 root     root         1024 Apr 16 23:38 proc/
drwxr-xr-x    2 root     root         1024 Apr 16 23:52 sbin/
-rwxr-xr-x    1 root     root         6288 Apr 16 23:45 sbin/chroot
-rwxr-xr-x    1 root     root        74748 Apr 16 23:44 sbin/fdisk
-rwxr-xr-x    1 root     bin        138828 May  7  2002 sbin/insmod
lrwxrwxrwx    1 root     root            6 Apr 16 23:38 sbin/modprobe -> insmod
-rwsr-xr-x    1 root     root        61356 Apr 16 23:44 sbin/mount
-rwxr-xr-x    1 root     root         3244 Apr 16 23:52 sbin/pivot_root

All these files should be copied from the live system. Notice in particular the file lib/modules/2.4.18/modules.dep. If the hpt374.o module is not already listed, add it to the file:


The linuxrc script looks like this:


# Load the HPT374 module
/sbin/modprobe hpt374

# Mount the array
/sbin/mount /dev/sda1 /mnt
/bin/mkdir -p /mnt/initrd

# Remount the array READ-ONLY!!!
/sbin/mount -o remount,ro /mnt

# chroot!
cd /mnt
/sbin/pivot_root . initrd
exec /sbin/chroot . /sbin/init </dev/console 2>/dev/console

This script will be run by the kernel in place of init after it boots. A combination of BIOS support and LILO will get the kernel loaded but it won't have any knowledge of the RAID card even though it was just booted from it. This script will load the correct module into the ramdisk and switch to the real root filesystem. Briefly, here's how it works.

First we load the module (duh) to support the RAID card. Next we mount the real root filesystem on /mnt (which is still inside the ramdisk, remember). It's mounted read-write so we can create /mnt/initrd, where to ramdisk will be "moved to" before launching the real init. With that directory safely created we remount the root filesystem in read-only mode, which is how the bootup scripts will expect to find it. Finally we call pivot_root to set the new root directory to /mnt and save the "old" root in /initrd (which is currently /mnt/initrd but will end up as plain /initrd) and then finish up with a chroot exec of the real init.

Of course you could spend some time beautifying the script and making it catch various errors if you wanted.

With the ramdisk in place, this LILO config will allow us to boot from the HPT374:

boot = /dev/sda
image = /boot/vmlinuz
  root = /dev/ram0
  initrd = /boot/initrd-2.4.18
  append = "init=/linuxrc"
  label = linux

If Highpoint ever release a proper Open Source driver, or when full support for this card arrives in the stable kernel, it will be possible to compile support for the card statically and avoid all this nonsense.

A final word to the wise

When you come to compile the latest kernel you will have to make sure you enable ramdisk and initrd support. Don't forget that the default ramdisk size is 4096k which is TOO SMALL to accomodate this ramdisk. Change it to 7000 or something to be on the safe side.

Jump to a section

intro | part 1: Hardware | part 2: OS installation | part 3: OS installation take two | part 4: The new home