PDC-202xx IDE RAID with Mandrake 8.2 Howto

Jinn Koriech

v0.1 - April 13, 2002


This HOWTO describes how to set up the PDC-20265 RAID-1 under Linux Mandrake 8.2. It addresses the use of the ATARAID module which is maintained by Arjan van de Ven at http://people.rehat.com/arjanv/pdcraid/ataraidhowto.html. The ATARAID module is included in the late 2.4.x kernels. This module now supports RAID 1 as well as RAID 0. I do not go into any detail about setting up striped RAID in this document - only mirrored RAID.

If you have any questions please see the references at the bottom of this howto.


1. Introduction

The reason this HOWTO was written is because none of the documentation I came accross when setting up the PDC-20265 indicated how to use it to provide RAID-1 services. After a few emails on the ataraid mailing list I managed to set up a box with RAID-1 running on Fasttrack(tm) Lite BIOS with the PDC 20265 chipset. These instructions should help for setting up the Highpoint 370 IDE RAID controller, though I have no way of testing.

There is plenty of documentation for hardware and software based RAID so I'm not going into any kind of explanation about it. From my understanding Promise Fasttrack(tm) IDE RAID falls somewhere inbetween the two as it uses a BIOS hack to facilitate RAID, hence requiring some form of OS based support - in this case the ATARAID module. In addition the ATARAID module does not use ide-scsi emulation or any of the Software RAID functionality provied by the linux kernels.

In addition, my understanding is that the PDCRAID module as outlined on the Promise website is not needed to get the ATARAID approach working.

Some of the information in this HOWTO may seem trivial - I myself was new to RAID before I wrote this.

1.1 Disclaimer, Feedback & Credits

I welcome all feedback, good or bad, on the content of this document. I have done my best to ensure that the instructions and information herein are accurate and reliable, but I don't know everything and I don't keep up on kernel development or RAID. Please let me know if you find errors or omissions. When writing, please indicate the version number of the document you're referencing. Be kind.

My thanks goes out to Murty Rompalli for having written out some instructions for Red Hat 7.2. Without that I would have been here for weeks! You can find his documentation at http://solar.murty.net/~murty.

1.2 Requirements

This HOWTO assumes you are using a late 2.4.x series kernel. You will need two IDE hard drives, and ofcourse, a motherboard with the PDC-20265 chipset.

 

2. RAID Setup

My approach to setting up RAID-1 may seem a bit long winded. If you know a better way around this please let me know and I will make your notes available with this document.

2.1 Preparing to RAID

I used Mandrake 8.2 in this setup, but I expect you can use just about any distro and get it working with this approach.

This is what you need:

Now lets get started.

2.2 Installing Mandrake (or any other distro)

Because Mandrake doesn't support (out of the box) the peculiar approach that the PDC-20265 chipset uses for RAID I plugged only one of the hard drives in to begin with and installed on that as though it was a normal setup. The only difference was a follows:

  1. Make sure the Fasttrack(tm) RAID is turned on in the BIOS - but no drives are connected to it at the moment.
  2. When booting from the CD-ROM I selected 'expert'.
  3. During the first text based prompts to load drivers I skipped loading anything.
  4. When prompted in the gui to load a scsi module I selected to load the ataraid module. I belive this just makes it easier when you go to upgrade from a standard drive to a RAID-1 setup.
  5. Continue with the installation as you need and come back when you've booted into your new system.

2.3 Rebuilding the kernel

Now you should be logged in to your new system.

What you need to do next is build a new kernel with Promise Fasttrack(tm) support compiled in statically. Don't bother trying to use the stock kernel as I spent hours trying without success. Simply download the latest stable version from www.kernel.org

cd /usr/src

mv linux linux-2.4.x

tar zxvf linux-2.4.18.tar.gz

mv linux linux-2.4.18

ln -s linux-2.4.18 linux

cd linux

make menuconfig

The following was taken from Murty Rompalli's own instructions:

Enable all the following in the kernel statically (NOT as modules):

ATA/IDE/MFM/RLL Support -->
  <*> ATA/IDE/MFM/RLL Support
    IDE/ATA/ATAPI Block Devices -->
  <*> Enhanced ATA/IDE/MFM/RLL disk/cdrom/tape/floppy support
      <*> Include IDE/ATA-2 Disk Support
      [*] Use multi-mode by default
      Include IDE/ATAPI CDROM support
  [*] Generic PCI IDE chipset support
        [*] Sharing PCI IDE interrupt support
        [*] Generic PCI Bus master DMA support
        [*] Use PCI DMA by default when available
        [*] Intel PIIXn chipset support
          [*] PIIXn tuning support
      [*] Promise PDC202{46|62|65|67|68} support
        [*] Special UDMA Feature
        [*] Special FastTrack Feature
      [*] VIA 82CXXX chipset support
      <*> Support for IDE RAID controllers
        <*> Support Promise Software RAID (fasttrack)
   

After you enabled static features as shown above, make any more changes that you would like to make to suit your environment.

Finally, save the kernel configuration. It is saved to .config in the current directory. Please back up this file. If you dont do so, you will regret it later. Copy .config file in a blank floppy or in /root

Before building the kernel make sure you move the current kernel out of the way and adjust /etc/lilo.conf to that effect - that way if your new kernel doesn't boot you have something to fall back on. Believe me this is of utmost importance - I forgot to do this the first time and the kernel wouldn't boot. I had to start from scratch!

Now, build and install the kernel like you normally do, by typing:

make dep ; make clean ; make && make install
make modules && make modules_install

According to Murty the new kernel should not need an initrd= line in /etc/lilo.conf. At this point I reboot into the new kernel without moving to the RAID yet just to make sure I've created a working kernel. Once that is successful you can go onto preparing to move to RAID.

2.4 Preparing to move to RAID

Now adjust /etc/lilo.conf and /etc/fstab as follows:

  1. In /etc/lilo.conf locate the
    root=/dev/hdaX
    line for the kernel you just built and change this to
    root=/dev/ataraid/d0pX
    where X is the partition number as on /dev/hdaX.
     
     
  2. At the command prompt type
    /usr/lilo
  3. Now edit /etc/fstab and replace any references to /dev/hda with /dev/ataraid/d0p. For example:
    Before
    /dev/hda1 / ext3 defaults 1 1
    none /dev/pts devpts mode=0620 0 0
    none /dev/shm tmpfs defaults 0 0
    /dev/hda6 /home reiserfs notail 1 2
    /dev/scd0 /mnt/cdrom auto user,iocharset=iso8859-15,exec,codepage=850,ro,noauto 0 0
    /dev/fd0 /mnt/floppy auto user,iocharset=iso8859-15,sync,exec,codepage=850,noauto 0 0
    none /proc proc defaults 0 0
    /dev/hda5 swap swap defaults 0 0
     
    After
    /dev/ataraid/d0p1 / ext3 defaults 1 1
    none /dev/pts devpts mode=0620 0 0
    none /dev/shm tmpfs defaults 0 0
    /dev/ataraid/d0p6 /home reiserfs notail 1 2
    /dev/scd0 /mnt/cdrom auto user,iocharset=iso8859-15,exec,codepage=850,ro,noauto   0 0
    /dev/fd0 /mnt/floppy auto user,iocharset=iso8859-15,sync,exec,codepage=850,noauto 0 0
    none /proc proc defaults 0 0
    /dev/ataraid/d0p5 swap swap defaults 0 0

    Remember to save your changes. Trying to reboot at this point will not work - you can only boot off the RAID now unless you revert to the old fstab.

2.5 Moving to RAID

Alright - we're almost there. Now you're going to move the drives to the RAID channel. To do this as quick as possible I found that it's best to reconfigure the CMOS before unplugging the hard drive.

  1. Enter the setup and select None on Primary IDE (where the hard drive was connected). Now save the changes and power down the system.
  2. Plug the drive you just installed the OS onto into the Primary RAID IDE channel. On my motherboard this was labelled IDE3. Plug the drive you want to mirror to into the Secondary IDE channel (on my mobo - IDE4).
  3. Make sure all the cables are in good and power up.
  4. Enter the FastTrack(tm) setup utility (CTRL-F on my BIOS)
  5. Clear any existing defined arrays.
  6. Set up a new mirrored array. When defined set the utility to duplicate the drive with the new OS onto the second drive. Make sure you get this right or you'll lose all your hard work. This stage can take a very long time depending on the size of your drive. Be patient.
  7. When the duplication is complete cross your fingers and reboot using the new kernel you built. If everything comes up without any errors - time to crack open that beer (or carton of milk)!!
  8. To make sure you have RAID functioning type
    df -k
    You should see references to /dev/ataraid/d0pX instead of /dev/hdaX.
  9. In addition you can check dmesg to see the initialization message generated by the ataraid module. It should look something like:
    ataraid/d0: ataraid/d0p1 ataraid/d0p2 < ataraid/d0p5 ataraid/d0p6 >
    EXT3 FS 2.4-0.9.17, 10 Jan 2002 on ataraid(114,1), internal journal

Some tips from Murty:

 

3. References


Jinn Koriech

April 13, 2002