Previous Next Contents

5. Building the RAID file system.

This description is for my RAID1 system described in the system specs. Your system may have a different RAID architecture, so modify as appropriate. Please read the man pages and QuickStart.RAID that come with the raidtools-0.42 My /etc/raid1.conf contains:

        # raid-1 configuration
        raiddev                 /dev/md0
        raid-level              1
        nr-raid-disks           2
        nr-spare-disks          0

        device                  /dev/hda4
        raid-disk               0

        device                  /dev/hdc4
        raid-disk               1

5.1 Step by Step procedures for building production RAID file system.

For my RAID1 system I did a complete install of:

        linux-2.0.32 with raid145 patch

Create and format the raid device.

        mkraid /etc/raid1.conf
        mdcreate raid1 /dev/md0 /dev/hda4 /dev/hdc4
        mdadd -ar
        mke2fs /dev/md0
        mkdir /md
        mount -t ext2 /dev/md0 /md
Create the reference files that reboot will use, this may be different on your system.
        cat /proc/mdstat | grep md0 > /dosa/linux/raidgood.ref
        cat /proc/mdstat | grep md0 > /dosc/linux/raidgood.ref
Use Slackware-3.4 or another distribution to build your OS
Specify '/md' as the target, and the source whatever your normally use. Select and install the disksets of interest except for the kernel. Configure the system, but skip the section on lilo and kernel booting. Exit setup.

Install 'pthreads'

        cd /usr/src/linuxthreads-0.71
edit the Makefile and specify

        make install
Install 'raidtools'
        cd /usr/src/raidtools-0.42
        configure --sbindir=/md/sbin --prefix=/md/usr
fix the raidtools make install error
        cd /md/sbin
        rm mdrun
        rm mdstop
        ln -s mdadd mdrun
        ln -s mdadd mdstop
Create /dev/mdx
        cp -a /dev/md* /md/dev
Add the system configuration from the current system (ignore errors).
        cp -dp /etc/* mnt/etc
        cp -dp /etc/rc.d/* mnt/etc/rc.d         (include the new rc.6)
        mkdir  mnt/lib/modules
        cp -a  /lib/modules/2.x.x mnt/lib/modules <--- your current 2.x.x
Edit the following files to correct them for your file system
        cd /md

        etc/fstab       correct for real root and raid devices.
        etc/mdtab       should work OK
        etc/hosts.equiv         and related files
        etc/rc.d/rc.inet1       correct ip#, mask, gateway, etc...
        etc/rc.d/rc.S           remove entire section on file system status
                        # Test to see if the root partition isread-only
                to but not including:
                        # remove /etc/mtab* so that mount will .....
                                This avoids the annoying warning that
                                the ramdisk is mounted rw.
        etc/rc.d/rc.xxxxx       others as required
        root/.rhosts            if present
        home/xxxx/xxxx          others as required

    WARNING:    The above procedure moves your password and shadow
                files onto the new file system!!!!!

    WARNING:    You may not wish to do this for security reasons.
Create any directories for mounting /dev/disk... as may be required that are unique to your system. Mine need:
        cd /md          <--- new file system root
        mkdir dosa                      dos partition mount point
        mkdir dosc                      dos mirror mount point
The new file system is complete. Make sure and save the md reference status to the 'real' root device and you are ready to boot.

mount the dos partitions on dosa and dosc

        cat /proc/mdstat | grep md0 > /dosa/linux/raidgood.ref
        cat /proc/mdstat | grep md0 > /dosc/linux/raidgood.ref

        mdstop /dev/md0

Previous Next Contents