Hardware Installation Notes

Installing a Promise FastTrak 100 Tx2 RAID Controller on RedHat Linux

The install script supplied with the Promise FastTrak100 Tx2 is a piece of junk. There is very little chance of the system booting from the RAID controller, if you use this install script. Not only that but the liklihood that the pre-built device driver that Promise supplies you with will work with your kernel is slim. You may need to build the driver from scratch.

Here are the steps to take to build the Promise FastTrak device driver from scratch. Do all of the steps (1-15) with the target system attached to the regular IDE controller and the system booted from it.

  1. Download the latest Linux source code. Try the Promise download site or look at www.promise.com for downloads of the Linux source.

    If you select the latest "Partial Linux Source Code" (anything from version 1.03.0.2 up), the problems with the missing symbols should be resolved.

  2. Unzip the source code to the directory of your choice.
  3. Make sure that the proper kernel source is available and that you have configured the kernel build process so that you can build a kernel properly. See "Kernel Builds Under RedHat Linux" and perform at least steps 1-10, therein.
  4. The fabulous Promise source code has hard-coded path names in it. Ain't that swell? In order for it to compile correctly, you must include a symlink from /usr/src/linux to your kernel source. So, do something like:

    cd /usr/src
    ln -s linux-2.4.18-26.8.0 linux
  5. Switch to the FastTrak driver source directory.
  6. Edit the Makefile, if you wish. In the section marked by:

    ###########################################
    #choose a parameter for your system.
    #default is INDEP386

    Uncomment the line for the kind of FastTrak driver module you wish to build. Note that, although the comment says the default is "INDEP386", the default is really "DEP386".

    Here is a brief description of what they are:


    INDEP386 - A kernel independent version of the 586 code.
    DEP386 - A kernel dependent version of the 586 code. This includes the check for the kernel version, etc.
    SuSE_TB - Support for SuSE Linux and TurboLinux.
    MDK - Support for Mandrake Linux.
    SMP22x - For the SMP, 2.2.x kernel.

    Note that the parameter says "386" but it is for the 586 architecture. If you're getting the idea that the Promise guys in Taiwan are confused, join the club.

  7. Make the Promise FastTrak driver:

    cd /Promise/install/dir
    make

    Note that the "fasttrak.o" module is deleted by the Makefile, probably so that you won't confuse it with the "FastTrak.o" module. If you rerun the Makefile, this module will always be built.

  8. Copy the "FastTrak.o" module to the proper place in the big scheme of things, depending on your kernel version. For example:

    cp FastTrak.o /lib/modules/2.4.18-26.8.0/kernel/drivers/scsi
    cp FastTrak.o /lib/modules/2.4.18-26.8.0BOOT/kernel/drivers/scsi

    In this example, the kernel version is "2.4.18-26.8.0". If you've built any specialty kernels, you might want to copy this driver to them too. However, you may need to recompile it for the specialty kernel version before doing so.

    You can see all of the kernels on your system by looking in "/lib/modules".

  9. Build the module dependency tree (this should be done automatically at boot time but wouldn't you like to know that it actually works):

    /sbin/depmod -a

    The result of this command should be placed in "/lib/modules/kernel-ver/modules.dep".

    You can see if the FastTrak driver is there by doing a grep:


    grep "FastTrak" /lib/modules/kernel-ver/modules.dep

    You should see something like:


    /lib/modules/kernel-ver/kernel/drivers/scsi/FastTrak.o:
       /lib/modules/kernel-ver/kernel/drivers/scsi/scsi_mod.o
  10. Test out the newly built driver by loading it:

    /sbin/insmod FastTrak

    If you see an error that the kernel version doesn't match the version that the device driver was built with, you can change the version number in "/usr/src/linux/include/version.h" (if you're sure you know what you're doing). Otherwise perform steps 11-14 as shown in "Kernel Builds Under RedHat Linux" and then try again.

    To rerun the Makefile, you'll need to delete "wrapper.o", "ftlog.o" and "FastTrak.o" by hand, since "make clean" doesn't work.

  11. Add the FastTrak driver to the list of modules that should be loaded at startup. This list can be added to "/etc/rc.modules". The SCSI drivers should be loaded first. Add these lines to the file:

    #Promise FastTrak Driver
    insmod scsi_mod
    insmod sd_mod
    insmod FastTrak

    Note that this step may not be strictly necessary, since the drivers will probably get loaded automagically but it couldn't hurt.

  12. In order to boot off the FastTrak controller, Linux needs an initial RAM disk with the FastTrak and SCSI drivers included in it. Build this RAM disk as follows:

    /sbin/mkinitrd --preload scsi_mod --preload sd_mod --with FastTrak
       /boot/initrd-kernel-versionFastTrak.img kernel-version

    If your kernel version were "2.4.18-26.8.0", you would use:


    /sbin/mkinitrd --preload scsi_mod --preload sd_mod --with FastTrak
       /boot/initrd-2.4.18-26.8.0FastTrak.img 2.4.18-26.8.0
  13. The FastTrak controller will fake out the BIOS long enough to load the initial RAM disk off the RAID array (i.e. it will make the BIOS think that the RAID array is the boot device). However, once the boot loader takes over, you'll need to tell it that it is using the RAID array. This is done by altering the boot parameters.

    Hack "/etc/lilo.conf" (if you're using GRUB, you're on your own) and add a new section for the FastTrak controller (we'll assume in this example that the kernel version is "2.4.18-26.8.0"):


    image=/boot/vmlinuz-2.4.18-26.8.0 append="ide0=0x1f0,0x3f6,14
       ide1=0x170,0x376,15 ide2=0 ide3=0 ide4=0 ide5=0 ide6=0 ide7=0
       ide8=0 ide9=0"
          label=FastTrak"
          initrd=/boot/initrd-2.4.18-26.8.0FastTrak.img"
          read-only"
          root=/dev/sda3"

    Use the name of the initial RAM disk that you created in step 12 for the "initrd" parameter. Use the same partition for the "root" parameter that was used before but change the device from "hd" to "sd". For example, if the other sections say "root=/dev/hda3", make this one read "/dev/sda3". Note that "/dev/sda3" presumes that the RAID array that you are trying to boot from will be the first one.

    Do not make this new section the default, just yet. If the system fails to boot from the FastTrak RAID controller, you can switch back to the IDE controller in order to fix it.

    Write the new boot configuration to the boot partition using LILO:


    /sbin/lilo -v
  14. Now, its time to live dangerously. The clever guys who wrote the kernel didn't plan for situations like this where a drive might appear as one device or another, depending on how it is booted. So, the devices are always mounted from "/etc/fstab" and "/etc/mtab". There is no way to specify an alternate to these two tables at boot time. They must point to the correct devices for the system to boot.

    Make two copies of both these tables, one for the IDE drive and one for the FastTrak RAID drive. The RAID drive shows up as a SCSI device so call it "sda" and call the other one "hda":


    cp /etc/fstab /etc/fstab.hda
    cp /etc/fstab /etc/fstab.sda

    cp /etc/mtab /etc/mtab.hda
    cp /etc/mtab /etc/mtab.sda

    Using your favorite text editor, edit "/etc/fstab.sda" and "/etc/mtab.sda". Change all occurrences of "hda" to "sda" (this is assuming that the drive was originally mounted on "hda" and that the new RAID array will be array 1, which will appear on "sda").

  15. Now, copy "/etc/fstab.sda" and "/etc/mtab.sda" on top of "/etc/fstab" and "/etc/mtab":

    cp /etc/fstab.sda /etc/fstab
    cp /etc/mtab.sda /etc/mtab

    This is the absolute last step because once you do this, you will no longer be able to boot the drive on the IDE controller. If things get screwed up, you can mount the drive on a second Linux machine (you do have a second Linux machine, don't you?) and reset the mount and file system tables back to what they were. For example:


    mount /dev/hdc /mnt
    cp /mnt/etc/fstab.hda /mnt/etc/fstab
    cp /mnt/etc/mtab.hda /mnt/etc/mtab
    umount /mnt

    There is an alternative to this approach that doesn't involve living dangerously. It is possible to create a couple of mini root partitions that contain only "/etc" and, by extension, "/etc/fstab" and "/etc/mtab". These can then be pointed to by the "root" parameter in "lilo.conf". The partitions would have to have been created before hand, of course, and they would link all of the other directories in root to a common partition. It hardly seems worth it but it would allow one to switch back and forth between "hda" and "sda".

  16. Shut down the machine and switch the IDE drive to the RAID controller, IDE1 connector. Add the second drive to the IDE2 connector. Note that the second drive must be equal to or larger in size than the drive on IDE1. If you use an identical drive, this is the best of all possible worlds.
  17. Fire up the system and go through the steps to create a mirrored RAID array (mirrored RAID arrays are the only kind that this controller does well. If you are trying to set up some other kind of RAID configuration, you've bought the wrong controller). When the RAID controller BIOS asks you, have it duplicate the disk on IDE1 to the disk on IDE2.
  18. Once the mirrored RAID array is set up, the system should boot normally but the original IDE devices will be missing.

    If it does boot OK, you can proceed to the next step. Otherwise, put the disk from IDE1 into another machine and reset fstab/mtab. Once you've done that, you can boot it as a regular IDE drive and, hopefully, repair the problem. If you need to go back and forth, you can do so by attaching the single disk to the RAID controller and leaving the other disk off IDE2. The controller will whine but will let you boot from the array with only one disk. Problems with the driver can be fixed by going back and forth between the regular IDE controller and the FastTrak RAID controller without updating fstab/mtab. The driver must load OK and the system boot from the RAID controller to the point where it tries fstab/mtab before the system will boot using the modified fstab/mtab. If it passes this test and drops you into single user mode because it can't mount "/dev/hda3", the changes to fstab/mtab will likely spell success.

    If you do have to resort to this step, the RAID array will have to be rebuilt, once the second drive is added back to it. However, there is no point in doing so utill you are sure that the system boots all the way, since the RAID rebuild is a lengthy process, not to be repeated often (it took over four hours for a rebuild on a pair of 120G disks).

  19. You may still want to use a device that is attached to the original IDE controller (e.g. CDROM drive). If that is the case, removing one or two of the "ide=" parameters from the section you added to "/etc/lilo.conf" should allow the system to see the original IDE devices (we'll assume in this example that the kernel version is "2.4.18-26.8.0"):

    image=/boot/vmlinuz-2.4.18-26.8.0 append="ide0=0x1f0,0x3f6,14
       ide1=0x170,0x376,15 ide4=0 ide5=0 ide6=0 ide7=0 ide8=0 ide9=0"
          label=FastTrak
          initrd=/boot/initrd-2.4.18-26.8.0FastTrak.img
          read-only
          root=/dev/sda3

    Note that, if you do this, the FastTrak RAID controller will be misidentified as an IDE device (well, actually, it is an IDE device. It is the same, identical device as the Promise IDE controller with one jumper installed and a different revision of the PROM) and the RAID disks will show up as "/dev/hde", "/dev/hdg", etc. This is not a problem but you should not try to access these disks by those names.

  20. You can also make the "FastTrak" boot section the default by moving it to the top in "lilo.conf" or by changing the "default=" parameter in the common section. We also suggest renaming the "linux" section to "RegularIDE", as shown. Finally, change all occurrences of "/dev/hda" to "/dev/sda", except in the "RegularIDE" section. Here is the whole "/etc/lilo.conf" file:

    boot=/dev/sda
    map=/boot/map
    install=/boot/boot.b
    message=/boot/message
    prompt
    timeout=50
    lba32
    default=FastTrak

    image=/boot/vmlinuz-2.4.18-26.8.0 append="ide0=0x1f0,0x3f6,14
       ide1=0x170,0x376,15 ide4=0 ide5=0 ide6=0 ide7=0 ide8=0 ide9=0"
          label=FastTrak
          initrd=/boot/initrd-2.4.18-26.8.0FastTrak.img
          read-only
          root=/dev/sda3

    image=/boot/vmlinuz-2.4.18-26.8.0
          RegularIDE
          read-only
          root=/dev/hda3

    Write the updated boot configuration to the boot partition using LILO:


    /sbin/lilo -v
  21. Shutdown the system and reboot. It should come up unattended.
  22. If the system boots OK, you can switch back to the regular IDE controller at any time by copying the original fstab/mtab over top of the existing tables, swapping one drive back to the IDE controller and rebooting using the "RegularIDE" label at boot time.