[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-raid
Subject:    RE: Raidtools and rh5
From:       James Youngman <JYoungman () vggas ! com>
Date:       1998-02-03 10:32:52
[Download RAW message or body]

On 02 February 1998 21:27, Tuomo Pyhala[SMTP:tuomo@lesti.kpnet.fi] wrote:
> 
> IS there a version of raidtools which will cleanly compile under Redhat
> 5.0 (glibc)?

I am using raidtools-0.41.   I did have to patch the kernel of 
course.    I also wrote an /etc/rc.d/rc.raid which is called by rc.sysinit 
at the appropriate times.   It allows any filesystem except the root 
to be a RAID device.   It will also perform automatic repair if this 
is required.   I've tested it at RAID0 and RAID1.   I did test the repair 
feature and that worked too.

I modified the Red Hat 5.0 rc.sysinit slightly:-

--- /tmp/initscripts-stuff/etc/rc.d/rc.sysinit  Tue Dec 30 16:31:33 1997
+++ rc.sysinit  Tue Feb  3 10:26:41 1998
@@ -111,6 +111,12 @@
     USEMODULES=
 fi
 
+# JAY: raid support.
+if [ -f /etc/rc.d/rc.raid ]; then
+    . /etc/rc.d/rc.raid start
+fi
+
+
 if [ -x /sbin/depmod -a -n "$USEMODULES" ]; then
     # Get ready for kerneld if module support in the kernel
     echo -n "Finding module dependencies"



Also /etc/rc.d/init.d/halt should be modified:-



--- /tmp/initscripts-stuff/etc/rc.d/init.d/halt Tue Sep 16 15:12:05 1997
+++ init.d/halt Tue Feb  3 09:59:57 1998
@@ -46,6 +46,11 @@
 umount -a
 mount -n -o remount,ro /
 
+### JAY: RAID support.
+if [ -f /etc/mdtab ]; then
+    /sbin/mdstop -a
+fi
+
 echo "Remounting remaining filesystems (if any) readonly"
 mount | awk '/ext2/ { print $3 }' | while read line; do
     mount -n -o ro,remount $line




Here's rc.raid itself:-

From: 	root[SMTP:root@noisy.vggas.com]
Sent: 	03 February 1998 09:57
To: 	JYoungman
Subject: 	rc.raid

#! /bin/sh

# RAID initialisation (James Youngman <jay@gnu.org>)...

# Raid0 and linear mode cannot be rescued, but everything
# else has a /etc/raid[0-9].conf file.
#
raidrescue () {
if [ -x /sbin/ckraid ] ; then 
    echo RAID inconsistency.
    echo
    for mode in $modes
    do
        cf=/etc/${mode}.conf
        if [ -f $cf ]; then 
                /sbin/mdstop -a
                echo Running /sbin/ckraid --fix $cf
                /sbin/ckraid --fix $cf
        else
                echo Missing RAID configuration file $cf
        fi
    done
fi
unset mode
unset cf
}


if [ -f /proc/ksyms ]; then
    USEMODULES=y
else
    USEMODULES=
fi

# See how we were called.
case "$1" in
  start)
        # Manually load the required RAID modules....
        if [ -n "$USEMODULES" ]; then
            # Extract the active lines in /etc/mdtab
            modes=`grep raid /etc/mdtab | \
                        grep -v '^ *#' | sed 's/.*\(raid[0-9]\),.*/\1/'`
            for mode in $modes
            do
                echo Loading $mode module...
                modprobe $mode
            done
        fi
        unset mode

        if [ -f /etc/mdtab ]; then
            echo Initialising RAID configuration...
            if /sbin/mdadd -ar ; then
                echo RAID devices are OK
            else
                raidrescue
                # If our second startup attempt fails, we give up and 
                # rely on a manual repair.
                /sbin/mdadd -ar 
            fi
            echo
        fi
        unset modes
        ;;

  stop)
        if [ -f /etc/mdtab ]; then
             echo Shutting down RAID configuration...
            /sbin/mdstop -a
        fi
        ;;

esac



Please note that these diffs are against the initscripts that come with Red Hat 5.0;
there is an updated version of the initscripts package on ftp.redhat.com.  I expect these
diffs will be fine with the updated version too.
-- 
James Youngman                               VG Gas Analysis Systems
The trouble with the rat-race is, even if you win, you're still a rat.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic