From owner-freebsd-current@FreeBSD.ORG  Mon Jun 14 05:46:23 2004
Return-Path: <owner-freebsd-current@FreeBSD.ORG>
Delivered-To: freebsd-current@freebsd.org
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 8DA7716A4CE
	for <freebsd-current@freebsd.org>;
	Mon, 14 Jun 2004 05:46:23 +0000 (GMT)
Received: from carver.gumbysoft.com (carver.gumbysoft.com [66.220.23.50])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 4259F43D54
	for <freebsd-current@freebsd.org>;
	Mon, 14 Jun 2004 05:46:23 +0000 (GMT)
	(envelope-from dwhite@gumbysoft.com)
Received: by carver.gumbysoft.com (Postfix, from userid 1000)
	id BEC9F72DF4; Sun, 13 Jun 2004 22:46:22 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
	by carver.gumbysoft.com (Postfix) with ESMTP
	id B950772DF2; Sun, 13 Jun 2004 22:46:22 -0700 (PDT)
Date: Sun, 13 Jun 2004 22:46:22 -0700 (PDT)
From: Doug White <dwhite@gumbysoft.com>
To: Paul Mather <paul@gromit.dlib.vt.edu>
In-Reply-To: <1087173751.697.70.camel@zappa.Chelsea-Ct.Org>
Message-ID: <20040613223840.L84464@carver.gumbysoft.com>
References: <1087173751.697.70.camel@zappa.Chelsea-Ct.Org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
cc: freebsd-current@freebsd.org
Subject: Re: ATA RAID rebuild not rebuilding
X-BeenThere: freebsd-current@freebsd.org
X-Mailman-Version: 2.1.1
Precedence: list
List-Id: Discussions about the use of FreeBSD-current
	<freebsd-current.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-current>,
	<mailto:freebsd-current-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-current>
List-Post: <mailto:freebsd-current@freebsd.org>
List-Help: <mailto:freebsd-current-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-current>,
	<mailto:freebsd-current-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 14 Jun 2004 05:46:23 -0000

On Sun, 13 Jun 2004, Paul Mather wrote:

> I have a recent 5.2-CURRENT system (last built 9th June, 2004) on which
> I thought I'd try a RAID 1 mirror using ATA RAID on the built-in Intel
> '82371AB/EB/MB PIIX4/4E/4M IDE Controller.'

Note there is no hardware RAID support in this controller, so if the wrong
disk fails you may not be able to boot. Its just a generic chipset IDE
controller.

> In summary, I can build and use an ar0 mirror, but whenever I try to
> simulate a failure and reconstruction (via atacontrol detach followed by
> an atacontrol attach, as described in section 12.4.3 of the FreeBSD
> Handbook) the subsequent "atacontrol rebuild ar0" does nothing (it
> returns to the prompt immediately) and the ar0 array is still flagged as
> DEGRADED (and the detached/attached drive as DOWN).  It appears
> impossible to revive the array.

It should crank up a rebuild thread that will start reconstructing the
failed drive in the background. You can see its status with 'ps ax'.  Its
been a while since I've done this and I've only done it with Promise
controllers, which do support RAID features on boot. I think you may have
to add the broken disk back as a spare (using 'atacontrol addspare') then
initiate the rebuild.

> Also, what is the canonical way to construct an array on a built-in
> controller?  I have two identical ATA drives: ad1 on ATA channel 0, and
> ad2 on ATA channel 1.  Assuming these are both unpartitioned/empty, do I
> first have to fdisk the individual drives or is it enough to "atacontrol
> create RAID1 ad1 ad2" and then "fdisk -BI ar0" and bsdlabel ar0s1?

You need to create the RAID container first, so atacontrol, then partition
the newly minted ar0.

> Where is the ATA RAID metadata stored?  How is consistency maintained?
> Is there some way of forcing a reconstruction onto a particular drive?

The metadata is stored on the disks themselves.

> In a verbose boot, the array configuration is output.  For some reason,
> it is flagged as PROMISE.  Shouldn't this be FREEBSD?  Might that be
> confusing the rebuild process, or is rebuilding done identically both on
> FreeBSD ATA RAID and Promise ATA RAID controllers?

FreeBSD the Promise metadata format in the absence of anything telling it
otherwise.  It just happens that you don't have a Promise controller that
can understand the metadata. :)

Incidentally, don't create stripes (RAID0) using this config and expect to
boot off of them, 'cause you won't be able to. You need hardware support
to do that.

-- 
Doug White                    |  FreeBSD: The Power to Serve
dwhite@gumbysoft.com          |  www.FreeBSD.org