At 23:51 27.03.00, Godfrey Livingstone wrote:
>I have raid 1 working and am swapping onto /dev/md1 I am interested to know
>what modifacations you made to the startup scripts. We run redhat 6.1 with a
>patched (for raid and promise ide controller ) 2.14 kernel. Anyway what 
>scripts
>do I need to change and how.  Presumably by altering rc.sysinit and checking
>that the resynchronisation of the swap partation is complete (how?) before
>issusing the command "swapon -a" ?

Let's see:

1) rc.sysinit:
* remove swapon -a
* add

# Start up swapping.
/sbin/raidswapon &

after mount of /proc filesystem

* possibly comment out the "add raid devices" section; if you use raid 
autostart chances are that the code in this section won't help you but it 
WILL keep your system from comming up if there's anything bad in your 
raidtab (happened to me when I did some testing and forgot to remove the 
test - entries in raidtab).

my /sbin/raidswapon: (adapted from a post to this list - sorry, I don't 
remember the original author).

#!/bin/sh
#

RAIDDEVS=`grep swap /etc/fstab | grep /dev/md|cut -f1|cut -d/ -f3`

for raiddev in $RAIDDEVS
do
#  echo "testing $raiddev"
    while grep $raiddev /proc/mdstat | grep -q "resync="
    do
#     echo "`date`: $raiddev resyncing" >> /var/log/raidswap-status
       sleep 20
    done
    /sbin/swapon /dev/$raiddev
done

exit 0

This won't turn on swap on raid devices until resync has finished.

Bye, Martin

"you have moved your mouse, please reboot to make this change take effect"
--------------------------------------------------
  Martin Bene               vox: +43-316-813824
  simon media               fax: +43-316-813824-6
  Andreas-Hofer-Platz 9     e-mail: [EMAIL PROTECTED]
  8010 Graz, Austria
--------------------------------------------------
finger [EMAIL PROTECTED] for PGP public key

Reply via email to