If the compatibility options for devfs are disabled, multidisk devices will only be availible as /dev/md/[num] instead of /dev/md[num]. This will break the checkfs and halt.sh scripts The following is a patch to these files agains rc-scripts-1.4.1 that should make them work in this circumstance and hopefully will not break them for anyone else. The patch also ensures that a commented parts of raidtab will be ignored. If a raid device is started that doesn't apear in the raidtab file, the halt script will not work properly with this patch. --- checkfs 2002-09-29 11:31:01.000000000 -0600 +++ /etc/init.d/checkfs 2002-10-18 16:28:59.000000000 -0600 @@ -32,13 +32,13 @@ if [ -x /sbin/raidstart -a -f /etc/raidtab -a -f /proc/mdstat ] then ebegin "Starting software RAID" - ACTIVE_RAID="`grep -E "md[0-9]+[[:space:]]?: active raid" /proc/mdstat | awk -F ':' '{print $1}'`" - if [ ! -z "${ACTIVE_RAID}" ] + ACTIVE_RAID="`grep -E "md[0-9]+[[:space:]]?: active raid" /proc/mdstat | awk -F 'md|:' '{print $2}'`" + if [ -n "${ACTIVE_RAID}" ] then - for x in $(grep -E "raiddev /dev/md[0-9]+" /etc/raidtab | \ - awk '{print $2}' | grep -v "`echo ${ACTIVE_RAID} | sed s'/[[:space:]]//g'`") + for x in $(grep -E "^[[:space:]]*raiddev /dev/md/?[0-9]+" /etc/raidtab | \ + awk '{print $2}' | grep -v -E "#|/dev/md/?(`echo ${ACTIVE_RAID} | sed s'/[[:space:]]/|/g'`)") do - /sbin/raidstart /dev/${x} + /sbin/raidstart ${x} done else /sbin/raidstart --all --- halt.sh 2002-10-13 13:20:23.000000000 -0600 +++ /etc/init.d/halt.sh 2002-10-18 16:33:00.000000000 -0600 @@ -88,10 +88,15 @@ if [ -x /sbin/raidstop -a -f /etc/raidtab -a -f /proc/mdstat ] then ebegin "Stopping software RAID" - for x in $(grep -E "md[0-9]+[[:space:]]?: active raid" /proc/mdstat | awk -F ':' '{print $1}') - do - raidstop /dev/${x} >/dev/null - done + ACTIVE_RAID="`grep -E "md[0-9]+[[:space:]]?: active raid" /proc/mdstat | awk -F 'md|:' '{print $2}'`" + if [ -n "${ACTIVE_RAID}" ] + then + for x in $(grep -E "^[[:space:]]*raiddev /dev/md/?[0-9]+" /etc/raidtab | \ + awk '{print $2}' | grep -E "/dev/md/?(`echo ${ACTIVE_RAID} | sed s'/[[:space:]]/|/g'`)") + do + raidstop ${x} >/dev/null + done + fi eend $? "Failed to stop software RAID" fi
Created attachment 4809 [details, diff] halt.sh patch
Created attachment 4810 [details, diff] checkfs patch
i run a kernel w/out devfs and my md devices exist as /dev/md0 ...
I am starting to opt for *NOT* having raid stuff in there. It is driving me mad, and as I do not use the damn thing, too many headache :/
would a separate script make your life easier ?
Dunno. I can think that it will cause problems, as the stop stuff for raid should be done at the very end ? So if not in halt.sh .... Can we just get the thing fixed, tested, and THEN ill commit ?
And, can anybody comment on this patch ?
The code for starting RAID devices has been totally changed in baselayout-1.8.6.2. This bug is no longer relavant but I have filed bug 15282 that addresses new problems.