Subject: parity check with root on raid
To: None <netbsd-help@netbsd.org>
From: Jukka Salmi <j+nbsd@2005.salmi.ch>
List: netbsd-help
Date: 04/21/2005 09:37:45
--EeQfGwPcQSOJBaQU
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi,

on a current i386 system I have almost all filesystems (incl. /) on a
RAIDframe (level 1). The RAID set is automatically configured.

I don't understand why the rc.d raidframeparity check is done so late:

$ rcorder -s nostart /usr/src/etc/rc.d/* | tail 
/usr/src/etc/rc.d/smmsp
/usr/src/etc/rc.d/raidframeparity
/usr/src/etc/rc.d/poffd
/usr/src/etc/rc.d/ndbootd
/usr/src/etc/rc.d/moused
/usr/src/etc/rc.d/mixerctl
/usr/src/etc/rc.d/inetd
/usr/src/etc/rc.d/identd
/usr/src/etc/rc.d/cron
/usr/src/etc/rc.d/Makefile

Shouldn't parity be checked (and possibly be rewritten) before filesystems
are checked and mounted?

I applied the attached patch which fixes what I think is wrong. It results
in raidframeparity executed earlier:

$ rcorder -s nostart /etc/rc.d/* | head                                        
/etc/rc.d/raidframeparity
/etc/rc.d/wdogctl
/etc/rc.d/raidframe
/etc/rc.d/cgd
/etc/rc.d/ccd
/etc/rc.d/swap1
/etc/rc.d/fixsb
/etc/rc.d/fsck
/etc/rc.d/root
/etc/rc.d/mountcritlocal

and in waiting for 'raidctl -P' to complete before continuting startup.

Any comments are welcome.


TIA, Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~

--EeQfGwPcQSOJBaQU
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="raidframeparity.diff"

--- /usr/src/etc/rc.d/raidframeparity	2004-10-12 09:04:01.000000000 +0200
+++ /etc/rc.d/raidframeparity	2004-11-23 02:45:42.000000000 +0100
@@ -3,7 +3,7 @@
 # $NetBSD: raidframeparity,v 1.3 2004/10/11 15:00:51 christos Exp $
 #
 
-# REQUIRE: quota
+# BEFORE:  disks
 
 $_rc_subr_loaded . /etc/rc.subr
 
@@ -15,15 +15,15 @@
 {
 	# Initiate parity/mirror reconstruction as needed, in the background.
 	#
-	(
+#	(	not running in background because our root is on RAIDframe
 		for dev in $(sysctl -n hw.disknames); do
 			case $dev in
 			raid[0-9]*)
-				raidctl -P $dev
+				raidctl -v -P $dev
 				;;
 			esac
 		done
-	) &
+#	) &
 }
 
 load_rc_config $name

--EeQfGwPcQSOJBaQU--