NetBSD Problem Report #35075

From jdwhite@menelos.com  Sat Nov 18 19:51:38 2006
Return-Path: <jdwhite@menelos.com>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 0BCD563BAFE
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 18 Nov 2006 19:51:38 +0000 (UTC)
Message-Id: <E1GlWDw-0006DU-Lm@mail.menelos.com>
Date: Sat, 18 Nov 2006 13:51:36 -0600
From: jdwhite@menelos.com
Reply-To: jdwhite@menelos.com
To: gnats-bugs@NetBSD.org
Subject: Not unconfiguring CCDs at shutdown can keep raid parity dirty.
X-Send-Pr-Version: 3.95

>Number:         35075
>Category:       misc
>Synopsis:       Not unconfiguring CCDs at shutdown can keep raid parity dirty.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Nov 18 19:55:01 +0000 2006
>Originator:     Jason White
>Release:        NetBSD 3.0
>Organization:
Jason White <jdwhite@menelos.com>       Jabber: jdwhite(jabber.org)
http://jdwhite.menelos.com/                     jason.d.white(gmail.com)
PGP KeyID: 0x5290E477
>Environment:


System: NetBSD bender.menelos.com 3.0 NetBSD 3.0 (BENDER) #0: Thu Feb 2 17:13:01 CST 2006 jdwhite@smeghead:/usr/obj/i386/BENDER i386
Architecture: i386
Machine: i386
>Description:
CCD devices are created automatically at boot if /etc/ccd.conf exists as per 
/etc/defaults/rc.conf.  If a CCD component device resides on a raidframed 
device and is not manually unconfigured prior to shutdown, the raid parity 
status will always be dirty after the system boots.
>How-To-Repeat:
Configure a CCD with a component device that resides on a raidset with clean 
parity.  Leave it configured and reboot.  Parity is now dirty.
>Fix:
Alter /etc/rc.d/ccd to unconfigure CCD devices at shutdown.  Since the system 
default is to automatically configure CCDs at startup, should they not be 
automatically unconfigured at shutdown?  The following patch from 3.1 does 
this, resulting in clean raid parity across reboots.

--- ccd.old     2006-11-18 13:16:03.000000000 -0600
+++ ccd 2006-11-18 13:17:36.000000000 -0600
@@ -4,13 +4,14 @@
 #

 # PROVIDE: disks
+# KEYWORD: shutdown

 $_rc_subr_loaded . /etc/rc.subr

 name="ccd"
 rcvar=$name
 start_cmd="ccd_start"
-stop_cmd=":"
+stop_cmd="ccd_stop"

 ccd_start()
 {
@@ -20,5 +21,13 @@
        fi
 }

+ccd_stop()
+{
+       if [ -f /etc/ccd.conf ]; then
+               echo "Unconfiguring CCD devices."
+               ccdconfig -U
+       fi
+}
+
 load_rc_config $name
 run_rc_command "$1"

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.