Subject: Re: Bootable root on raidframe
To: None <port-i386@netbsd.org>
From: Brian A. Seklecki <lavalamp@spiritual-machines.org>
List: port-i386
Date: 08/05/2003 08:34:50
This is a MIME-formatted message.  If you see this text it means that your
E-mail software does not support MIME-formatted messages.

--=_precursor-11926-1060086869-0001-2
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 7bit

On Mon, 2003-08-04 at 14:13, Martti Kuparinen wrote:
> Hello list,
> 
> I'm going to build a new home server with RAID-1 for everything (root,
> /home and swap). I've read raidctl(8) and David's howto at
> 
> http://mail-index.netbsd.org/port-i386/2002/07/17/0006.html
> 
> but one thing is a little bit unclear to me.

I drafted this really bad document on the topic some time ago (attached)
for "The NetBSD Guide" but I've since lost the hardware tools and time I
need to finish it.

Someday...someday...

I was hoping to finish it off someday when sparc/sparc64 bootblocks
could read FS_RAID, so it could be platform independant.

My procedure also involved using a stock install on mirror0 to setup
mirror1, then mirror1 back to mirror0.

Hopefully a more install-media based approach is available.

Re-write time.

-lava

--=_precursor-11926-1060086869-0001-2
Content-Type: text/html; name="raid_l1_root_draft1.html"; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename=raid_l1_root_draft1.html

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">=0D
<html>=0D
<head>=0D
  <title></title>=0D
                                              =20=0D
  <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf-8">=0D
</head>=0D
<body>=0D
<div align=3D"center">=0D
<h1> NetBSD/i386 RAID Level 1 Root File System</h1>=0D
</div>=0D
Brian A. Seklecki &lt;<a href=3D"lavalamp@spiritual-machines.org">lavalamp@=
spiritual-machines.org</a>&gt;<br>=0D
 Oct 19 2002<br>=0D
DRAFT DRAFT DRAFT DRAFT DRAFT<br>=0D
<br>=0D
Todo's:=0D
<ul>=0D
  <li>Drop into CVS<br>=0D
  </li>=0D
  <li>Fix everything (explain steps better)</li>=0D
  <li>Make platform independant (this should work on at least sparc/sparc64=
)</li>=0D
  <li>Grammar and spelling are deplorable</li>=0D
  <li>Convert to docbook for Federico Lupi</li>=0D
  <li>send-pr(8) for netbsd.org/doku</li>=0D
  <li>some cheap graphics would be nice to help explain</li>=0D
</ul>=0D
<h3><b>Foreword</b></h3>=0D
This document will cover the procedure for establishing a NetBSD installati=
on=0D
with a RAID level 1 root file system (/) mirror. The process is tricky and=0D
does require a solid understanding of NetBSD administrative procedures. Bec=
ause=0D
the process is complicated by a number of steps that must occur in a specif=
ic=0D
order, I have written this document in a manor that it can be used as a qui=
ck=0D
reference and as a tutorial. I have denoted steps that are optional for tho=
se=0D
of you who are looking for a such a reference, but have included many notes=0D
and 'gotchas' for others to help understand and illustrate the process.<br>=0D
<br>=0D
NetBSD uses the <a href=3D"http://www.pdl.cmu.edu/RAIDframe/">CMU RAIDFrame=
</a>=0D
as it's RAID subsystem. The work was done in the mid-90's and has been in-k=
ernel=0D
for quite some time. Because we are dealing with software RAID as opposed=0D
to hardware  RAID, system administrators should give a great deal of consid=
eration=0D
to it's  use before using it in 'Mission Critical' applications. For such=0D
projects, you  might consider the use of many of the hardware RAID devices=0D
<a href=3D"http://www.netbsd.org/Hardware/">supported by NetBSD</a>.  It is=0D
truly at your discretion what type of RAID you use, but I recommend you=20=0D
consider factors such as: manageability, support, etc.<br>=0D
<br>=0D
You should be familiar with RAID terminology and applications before readin=
g=0D
this  document. A plethora of information is available on the web. You shou=
ld=0D
be at  least familiar with the different levels of RAID (Adaptec provides=0D
an <a=0D
 href=3D"http://www.adaptec.com/worldwide/product/markeditorial.html?sess=
=3Dno&amp;prodkey=3Dquick_explanation_of_raid">excellent=0D
reference</a>). Whole books alone have been written on RAID theory. In the=0D
examples  below, we will be illustrating RAID level 1, aka, 'mirroring'.=0D
RAID1 provides  mirroring only. Performance impacts are negligible.<br>=0D
<br>=0D
<h3><b>Getting Help</b></h3>=0D
I'm a bit of a slacker when it comes to e-mail. I tend to get selective abo=
ut=0D
exactly I respond to. Moreover, I did my two tours as tech support and I=0D
do not  wish to revisit! If you have problems, your best bet are NetBSD mai=
ling=0D
lists,  and their respective archives. The archives contain a wealth of uno=
rganized=0D
information.  If you can't find a definitive answer to your problem there,=0D
I recommend you post  to netbsd-help@netbsd.org or netbsd-users@netbsd.org=0D
or port-i386@. I am however happy entertain any  and all suggestions you=0D
have about this document! (i.e., if you make one, I will  most likely use=0D
it)<br>=0D
<br>=0D
<b>NOTE:</b> The examples in this document use NetBSD 1.6 (kernel from the=0D
-r<i><b>netbsd-1-6-RELEASE</b></i> tag). Please take that into account as=0D
dated documentation can be very misleading.<br>=0D
<br>=0D
Because RAID level 1 provides only redundancy and no performance impacts,=0D
it's most practical  application is as use in critical file systems (such=0D
as <b>/usr/local,</b><b>/var</b>, etc.  but most importantly, <b>/</b>, or=0D
'root'). For other file systems, such as /home or  /var/mail, other RAID=0D
levels of RAID should be considered. If we were simply creating a generic=0D
 RAID level 1 volume for a file system, we could follow the cookie-cutter=0D
examples from the man page, but  because the root volume must be bootable,=0D
certain special steps must be taken. =20=0D
<h3>Pseudo Process Outline:</h3>=0D
<b>Note: </b>'disk0' and 'disk1' are relative to your setup. In our example=
,=0D
'disk0' will refer to <b>/dev/sd0</b> and 'disk1' to <b>/dev/sd1</b><br>=0D
<br>=0D
<ul>=0D
  <li>Install a stock NetBSD onto disk0</li>=0D
  <li>Use install on disk0 to establish RAID root on disk1</li>=0D
  <li>Mirror disk1 back to disk0</li>=0D
  <li>Test test test!</li>=0D
</ul>=0D
<br>=0D
<b>NOTE:</b> This example uses an Adaptec SCSI controller with a BIOS. If=0D
you use something else, it must also have a BIOS. I have not tried this wit=
h=0D
IDE as outlined by the next note.<br>=0D
<br>=0D
<b>NOTE: </b>This scenario relies on a feature in the Adaptec BIOS configur=
ation=0D
menu; the ability to define the SCSI boot device ID. Changing this value=0D
from  the default, 0, is a dirty trick Adaptec implements. It's dirty becau=
se=0D
it would  lead you to believe, based on debugging output of the device prob=
e=0D
at initialization  time, that it is overriding and reordering the SCSI IDs=0D
of the boot device you  specify with the device at ID0. This however is not=0D
the case. What it's really  doing is changing the order in which the BIOS=0D
sees<br>=0D
bootable devices. The only code that is affected by this change is the i386=0D
boot  blocks which address drives presented by the BIOS as 'hd0', 'hd1',=0D
etc. When the  NetBSD kernel actually loads, the devices on the bus are pro=
bed=0D
unaffected by  the change. I will explain in more detail later, but you sho=
uld=0D
be aware of this.  Because most IDE controllers lack this functionality it=0D
would be very difficult  their practice use but I imagine these steps could=0D
apply to an IDE system. When  instructed to change the SCSI boot ID below,=0D
simply recable/rejumper your IDE  devices. <br>=0D
<br>=0D
<b>NOTICE: </b>Using RAID level 1 does provide redundancy, however, it is=0D
NOT a replacement for reliable backups. Consider it more a 'buffer' than=0D
anything. In this example, there are still many single points of failure=0D
(both drives are on a single controller, what happens if the control fails?=
).<br>=0D
<h3>Goal Overview: </h3>=0D
To provide redundancy on an i386 system, an administrator should be able=0D
to encounter  a disk failure of either disk in the root file system RAID=0D
and be able to: 1)  Continue normal systems operation without rebooting usi=
ng=0D
the sole remaining disk  component until a maintenance window can be schedu=
led=0D
2) In the event of a system  crash and an unusable system boot disk (SCSI=0D
ID 0 by default) be able to boot  from either disk in the RAID set by simpl=
y=0D
changing the address of the SCSI boot  device in the BIOS.  The latter is=0D
a more likely scenario because failing SCSI disks like to cause SCSI bus=0D
resets which will render a system unuseable.<br>=0D
<br>=0D
<b>THEREFORE: </b>At any time, the SCSI BIOS must be able to read:<br>=0D
*) i386 bootblocks from a drive ...<br>=0D
*) ... which can then boot a kernel from either drive.<br>=0D
<br>=0D
<u><b>Example Scenario Hardware:</b></u><br>=0D
<ul>=0D
  <li>1 Relatively new i386 machine with an up to date BIOS (translation=0D
problems)</li>=0D
  <li>1 Adaptec 2940UA narrow (50 pin) SCSI controller</li>=0D
  <li>2 Identical SCSI disks at SCSI ID 0 and ID 1 </li>=0D
</ul>=0D
<b>NOTE:</b> RAIDFrame requires that all components of a raidset be of an=0D
<i><u><b>identical</b></u></i>  geometry. It's a a good idea to use two SCS=
I=0D
disks of the same model AND revision. <br>=0D
<br>=0D
<b>NOTE:</b> Disk geometry could be mitigated by the 'grown' defects list=0D
on the  drive. Check your drives. Drives with grown defects should never=0D
be used, as this  is an indication that the drive is failing. <br>=0D
<br>=0D
<b>NOTE:</b> All example shell commands in this document are in bourne shel=
l=0D
style. Adjustment will need to be made to commands if you are using csh sty=
le=0D
shells. <br>=0D
<br>=0D
<b>NOTE:</b> Some commands produce great amounts of output to stdout or std=
err.=0D
Additionally some critical debugging information is sent to <i><b>/dev/cons=
ole</b></i>=0D
by the kernel. You will want to have at least two terminals open on the hos=
t=0D
at all times. See the <a=0D
 href=3D"http://www.netbsd.org/Documentation/wscons/">wscons FAQ</a>.<br>=0D
<br>=0D
<h3>Procedure Steps</h3>=0D
<ul>=0D
  <li>Establish your Physical Hardware Configuration</li>=0D
  <li>Install Stock NetBSD onto disk0 of your system</li>=0D
  <li>Prepare a Custom Kernel with RAIDFrame Support</li>=0D
  <li>Prepare disk1 for use in RAID</li>=0D
  <li>Disklabel disk1 for use in RAID</li>=0D
  <li>Setup RAIDFrame Configuration file for RAID 1</li>=0D
  <li>Initialize RAID with disk1 component only</li>=0D
  <li>Create a file system and mount the new RAID </li>=0D
  <li>Replicate generic install on disk0 onto newly created RAID</li>=0D
  <li>Configure replicated system configuration (/etc) independent of disk0=
</li>=0D
  <li>Make disk1 bootable with RAID Autoconfigure</li>=0D
  <li>Backup and remove your RAID1 configuration</li>=0D
  <li>Reboot and test bootblocks and RAID on disk1</li>=0D
  <li>Disklabel disk0 with an identical disklabel from disk1</li>=0D
  <li>Add disk0 as a component spare to the RAID</li>=0D
  <li>Synchronize drives (disk1 -&gt; disk0)</li>=0D
  <li>Make disk0 bootable</li>=0D
  <li>Reboot and test disk0 bootblocks as well as RAID parity</li>=0D
  <li>Backup disklabels and MBRs</li>=0D
  <li>TEST: Reboot to test failing disk1 (disable drive)</li>=0D
  <li>TEST: Reboot to test failing disk0 (disable drive)</li>=0D
  <li>TEST: Warm-fail disk0. Recover using disk1</li>=0D
  <li>TEST: Warm-fail disk1. Recover using disk0</li>=0D
  <li>TEST: Hot-fail disk0. Recover using disk1</li>=0D
  <li>TEST: Hot-fail disk1. Recover using disk0  </li>=0D
</ul>=0D
<hr width=3D"100%" size=3D"2">=0D
<h3>Establish Physical Hardware Configuration</h3>=0D
In this example, both disks are connected via 50 pin cables. Forced perfect=0D
('active') termination is used for good measure. Your configuration may var=
y.=0D
In advanced high end RAID configurations, it is often recommended that RAID=
1=0D
mirrors exist on different channels of a SCSI control or even on two differ=
ent=0D
controllers.<br>=0D
<br>=0D
<table cellpadding=3D"1" cellspacing=3D"1" border=3D"1" bgcolor=3D"#000000"=
>=0D
  <tbody>=0D
    <tr>=0D
      <td valign=3D"top">                                                 =20=0D
                                                                       =20=0D
                                                                        =20=0D
               <b><font color=3D"#33cc00"><tt>sd0 at scsibus0 target0 lun 0=
:=0D
&lt;SEAGATE, ST32430N SUN2.1G, 0444&gt; SCSI2 0/direct fixed<br>=0D
sd0: 2049 MB, 3992 cyl, 9 head, 116 sec, 512 bytes/sect x4197405 sectors<br=
>=0D
sd0: sync (100.0ns offset 15), 8-bit (10.000MB/s)transfers, tagged queueing=
<br>=0D
sd1: at scsibus0 target 1 lun 0: &lt;SEAGATE, ST32430N SUN2.1G, 0444&gt; SC=
SI2=0D
0/direct fixed<br>=0D
sd1: 2049 MB, 3992 cyl, 9 head, 116 sec, 512 bytes/sect x 4197405 sectors<b=
r>=0D
sd1: sync (100.0ns offset 15), 8-bit (10.000MB/s) transfers, tagged queuein=
g</tt></font></b>=0D
      </td>=0D
    </tr>=0D
                                                                       =20=0D
                                            =20=0D
  </tbody>=0D
</table>=0D
<h3>Install Stock NetBSD System</h3>=0D
Perform a very minimal ('stock') installation on your disk0. Install all th=
e=0D
sets but do not bother customizing anything as it will be overwritten very=0D
soon.<br>=0D
<br>=0D
<ul>=0D
  <li><a=0D
 href=3D"ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-1.6/i386/INSTALL.html">NetB=
SD/i386=0D
Install Directions</a></li>=0D
  <li><a=0D
 href=3D"http://www.mclink.it/personal/MG2508/nbsdeng/chap-inst.html">NetBS=
D=0D
Guide: Installing</a></li>=0D
</ul>=0D
<h3>Prepare a custom kernel with RAIDFrame support</h3>=0D
You will need to build a custom kernel once the system is installed.  The=0D
kernel must contain static SCSI ID to <b>/dev</b> entry mappings to ensure=0D
consistency in the event of a device failure after reboot.  Follow the <a=0D
 href=3D"http://www.netbsd.org/Documentation/kernel/#how_to_build_a_kernel"=
>kernel=0D
compiling process</a> and build and install the new kernel. The entries you=0D
will need to add are:<br>=0D
<br>=0D
<table cellpadding=3D"1" cellspacing=3D"1" border=3D"1">=0D
  <tbody>=0D
    <tr>=0D
      <td valign=3D"top" bgcolor=3D"#ffffcc">                              =
 =20=0D
 <b><tt>sd0     at scsibus0 target 0 lun ?     <br>=0D
# SCSI disk drives<br>=0D
sd1     at scsibus0 target 1 lun ?     <br>=0D
# SCSI disk drives<br>=0D
sd2     at scsibus0 target 2 lun ?     <br>=0D
# SCSI disk drives<br>=0D
sd3     at scsibus0 target 3 lun ?     <br>=0D
# SCSI disk drives<br>=0D
sd4     at scsibus0 target 4 lun ?     <br>=0D
# SCSI disk drives<br>=0D
sd5     at scsibus0 target 5 lun ?     <br>=0D
# SCSI disk drives<br>=0D
sd6     at scsibus0 target 6 lun ?     <br>=0D
# SCSI disk drives </tt></b>        </td>=0D
    </tr>=0D
                                                                        =20=0D
                                         =20=0D
  </tbody>=0D
</table>=0D
<h3>Prepare disk1 for use in RAID</h3>=0D
 Once you have a stock install of NetBSD on disk0, you are ready to begin.=0D
Disk1 will be visible and unused by the system. The first step should be to=0D
blow away any disklabel and MBR that may already be on disk1 from previous=0D
use. The easiest way to do that is to 'zero' them out with <a=0D
 href=3D"http://netbsd.gw.com/cgi-bin/man-cgi?dd++NetBSD-current">dd(8)</a>=
:<br>=0D
<br>=0D
<blockquote><tt><b># dd if=3D/dev/zero of=3D/dev/sd1d bs=3D8k count=3D1</b>=
</tt></blockquote>=0D
<table cellpadding=3D"1" cellspacing=3D"1" border=3D"1">=0D
  <tbody>=0D
    <tr>=0D
      <td valign=3D"top" bgcolor=3D"#000000"><b><tt><font color=3D"#33cc00"=
> 1+0=0D
records in<br>=0D
1+0 records out<br>=0D
8192 bytes transferred in 0.003 secs (2730666 bytes/sec)</font></tt></b><tt=
><font=0D
 color=3D"#33cc00"><br>=0D
  </font></tt></td>=0D
    </tr>=0D
                                                                        =20=0D
                                         =20=0D
  </tbody>=0D
</table>=0D
<br>=0D
Once that is complete, you should verify that they are both gone:<br>=0D
<br>=0D
<blockquote><b><tt>    # disklabel -r sd1d</tt></b><br>=0D
  </blockquote>=0D
<table cellpadding=3D"1" cellspacing=3D"1" border=3D"1">=0D
  <tbody>=0D
    <tr>=0D
      <td valign=3D"top" bgcolor=3D"#000000">          <font color=3D"#33cc=
00"><tt><b>sd1:=0D
no disk label<br>=0D
disklabel: no disklabel</b></tt></font>ll      </td>=0D
    </tr>=0D
                                                                        =20=0D
                                         =20=0D
  </tbody>=0D
</table>=0D
<blockquote><b><tt>    # fdisk sd1</tt></b><br>=0D
</blockquote>=0D
<table cellpadding=3D"1" cellspacing=3D"1" border=3D"1">=0D
  <tbody>=0D
    <tr>=0D
      <td valign=3D"top" bgcolor=3D"#000000">          <tt><b><font=0D
 color=3D"#33cc00">Disk: /dev/rsd1d</font></b><br>=0D
      <b><font color=3D"#33cc00">NetBSD disklabel disk geometry:</font></b>=
<br>=0D
      <b><font color=3D"#33cc00">cylinders: 3992 heads: 9 sectors/track: 11=
6=0D
(1044 sectors/cylinder)</font></b><br>=0D
      <b><font color=3D"#33cc00">BIOS disk geometry:</font></b><br>=0D
      <b><font color=3D"#33cc00">cylinders: 1023 heads: 64 sectors/track: 3=
2=0D
(2048 sectors/cylinder)</font></b><br>=0D
      <b><font color=3D"#33cc00">Partition table:</font></b><br>=0D
      <b><font color=3D"#33cc00">0: &lt;UNUSED&gt;</font></b><br>=0D
      <b><font color=3D"#33cc00">1: &lt;UNUSED&gt;</font></b><br>=0D
      <b><font color=3D"#33cc00">2: &lt;UNUSED&gt;</font></b><br>=0D
      <b><font color=3D"#33cc00">3: &lt;UNUSED&gt;</font></b></tt><br>=0D
      </td>=0D
    </tr>=0D
                                                                        =20=0D
                                         =20=0D
  </tbody>=0D
</table>=0D
<h3>Disklabel disk1 for use in RAID</h3>=0D
You may now setup the disklabel on disk1. The <b>a:</b> slice MUST have an=0D
offset of at least one track. Use the <b>sectors/track</b> value below to=0D
determine this. This space is reserved for use by bootblocks.=0D
<blockquote><b><tt>    # disklabel -r -I -e sd1d</tt></b><br>=0D
  </blockquote>=0D
<table cellpadding=3D"1" cellspacing=3D"1" border=3D"1">=0D
  <tbody>=0D
    <tr>=0D
      <td valign=3D"top" bgcolor=3D"#ffffcc">        <tt><b>[..snip...]<br>=0D
bytes/sector: 512<br>=0D
sectors/track: 116     # Important value!<br>=0D
tracks/cylinder: 9<br>=0D
sectors/cylinder: 1044<br>=0D
cylinders: 3992<br>=0D
total sectors: 4197405<br>=0D
      [...snip...]<br>=0D
4 partitions:<br>=0D
#        size    offset     fstype  [fsize bsize cpg/sgs]<br>=0D
 a:   4197289     116       RAID                        0 0 # (Cyl.    0*-=0D
4020*)<br>=0D
 c:   4197289           116     unused      0     0         # (Cyl.    0*-=0D
4020*)<br>=0D
 d:   4197405               0 unused      0     0         # (Cyl.    0 -=0D
4020*)</b></tt><br>=0D
      </td>=0D
    </tr>=0D
                                                                        =20=0D
                                         =20=0D
  </tbody>=0D
</table>=0D
<br>=0D
<b>NOTE:</b> On i386, <b>c:</b> and <b>d:</b> slies are always reserved.=0D
The offset of <b>c:</b> should be the same as <b>a:</b> in this instance.<b=
r>=0D
<br>=0D
<b>NOTE: </b><a=0D
 href=3D"http://netbsd.gw.com/cgi-bin/man-cgi?disklabel++NetBSD-current">di=
sklabel(8)</a>=0D
will edit the disklabel using your <b>$EDITOR</b> variable. It defaults to=0D
<b>vi</b>.<br>=0D
<br>=0D
<b>NOTE:</b> In this example, we are using the entire disk for the root ('/=
')=0D
partition. This is a very unrealistic approach to a production server. A mo=
re=0D
realistic example would be to create multiple slices on the disk of type=0D
RAID for /, /usr, /var, swap and then establish RAID0-RAID3 to mirror them=0D
as well. However for simplicity in illustrating this proecss, we are creati=
ng=0D
a system with a single slice spanning the entire disk.=0D
<h3>Setup RAIDFRAME configuration file for RAID 0</h3>=0D
<blockquote><b><tt>    # vi /etc/raid0.conf</tt></b><br>=0D
</blockquote>=0D
<table cellpadding=3D"1" cellspacing=3D"1" border=3D"1" bgcolor=3D"#ffffcc"=
>=0D
  <tbody>=0D
    <tr>=0D
      <td valign=3D"top"><b><tt>START array<br>=0D
1 2 0<br>=0D
      <br>=0D
START disks<br>=0D
      </tt></b><b><tt>/dev/sd6a<br>=0D
/dev/sd1a<br>=0D
      <br>=0D
START layout<br>=0D
128 1 1 1 <br>=0D
      <br>=0D
START queue<br>=0D
fifo 100</tt></b></td>=0D
    </tr>=0D
                                                                        =20=0D
                                                   =20=0D
  </tbody>=0D
</table>=0D
<br>=0D
<br>=0D
See <a=0D
 href=3D"http://netbsd.gw.com/cgi-bin/man-cgi?raidctl++NetBSD-current">raid=
ctl(8)</a>=0D
for more details. The <b>array</b> and <b>layout</b> sections are static=0D
for a RAID level 1 as it can only contain  two disk per row/column. The <b>=
disks</b>=0D
section will contain one bogus disk in the initial  configuration (<b>sd6a<=
/b>=0D
here).  We are using a bogus disk as the first component to help us create=0D
the RAID metadata structure on on disk1; it will be corrected later. The=0D
default values for <b>queue</b> are used.<br>=0D
<br>=0D
<h3>Initialize RAID with disk1 component only</h3>=0D
The first time initialization of any RAID set requires the -C flag to force=
.=0D
 You can safely ignore any errors at this point.=0D
<blockquote><b><tt>    # raidctl -v -C /etc/raid0.conf raid0</tt></b><br>=0D
</blockquote>=0D
<table cellpadding=3D"1" cellspacing=3D"1" border=3D"1">=0D
  <tbody>=0D
    <tr>=0D
      <td valign=3D"top" bgcolor=3D"#000000"><tt><font color=3D"#33cc00"><b=
> =20=0D
RAIDFRAME: protectedSectors is 64<br>=0D
raidlookup on device: /dev/sd6a failed!<br>=0D
Hosed component: /dev/sd1a<br>=0D
Hosed component: /dev/sd6a<br>=0D
raid0: Component /dev/sd6a being configured at row: 0 col: 0<br>=0D
         Row: 0 Column: 0 Num Rows: 0 Num Columns: 0<br>=0D
         Version: 0 Serial Number: 0 Mod Counter: 0<br>=0D
         Clean: No Status: 0<br>=0D
      /dev/sd6a has a different modification count: 230 0<br>=0D
Number of rows do not match for: /dev/sd6a<br>=0D
Number of columns do not match for: /dev/sd6a<br>=0D
/dev/sd6a is not clean!<br>=0D
raid0: Component /dev/sd1a being configured at row: 0 col: 1<br>=0D
         Row: 0 Column: 0 Num Rows: 1 Num Columns: 2<br>=0D
         Version: 2 Serial Number: 1000 Mod Counter: 230<br>=0D
         Clean: Yes Status: 0<br>=0D
/dev/sd1a has a different serial number: 0 1000<br>=0D
Column out of alignment for: /dev/sd1a<br>=0D
raid0: There were fatal errors<br>=0D
raid0: Fatal errors being ignored.<br>=0D
RAIDFRAME: Configure (RAID Level 1): total number of sectors is 4197120 (20=
49=0D
MB)<br>=0D
RAIDFRAME(RAID Level 1): Using 6 floating recon bufs with no head sep limit=
</b><br>=0D
      </font></tt></td>=0D
    </tr>=0D
                                                                       =20=0D
                                  =20=0D
  </tbody>=0D
</table>=0D
<br>=0D
<br>=0D
A serial number must be assigned to the RAID set after first time initializ=
ation.=0D
This number is purely cosmetic and is at your discretion.  Afterwards perfo=
rm=0D
a first-time initalization of the RAID, safely ignoring the errors.=0D
<blockquote><b><tt>    # raidctl -v -I 1000 raid0</tt></b><br>=0D
  <b><tt>    # raidctl -v -i raid0</tt></b><br>=0D
</blockquote>=0D
<table cellpadding=3D"1" cellspacing=3D"1" border=3D"1">=0D
  <tbody>=0D
    <tr>=0D
      <td valign=3D"top" bgcolor=3D"#000000"><font color=3D"#33cc00"><b>Ini=
tiating=0D
re-write<br>=0D
raid0: Error re-writing parity!<br>=0D
      Parity Rewrite status:</b></font><br>=0D
      </td>=0D
    </tr>=0D
                                                                       =20=0D
                                  =20=0D
  </tbody>=0D
</table>=0D
<br>=0D
View the status of the RAID. Note that the bogus device from above is marke=
d=0D
failed  but our disk1 component, sd1a is failed. Also note that parity is=0D
marked dirty.  This is obvious because we haven't built it against another=0D
disk yet.=0D
<blockquote><tt><b>    # raidctl -v -s raid0<br>=0D
  </b></tt><br>=0D
</blockquote>=0D
<table cellpadding=3D"1" cellspacing=3D"1" border=3D"1">=0D
  <tbody>=0D
    <tr>=0D
      <td valign=3D"top" bgcolor=3D"#000000"><font color=3D"#33cc00"><b><tt=
>Components:<br>=0D
           /dev/sd6a: failed<br>=0D
           /dev/sd1a: optimal<br>=0D
No spares.<br>=0D
/dev/sd6a status is: failed.  Skipping label.<br>=0D
Component label for /dev/sd1a:<br>=0D
   Row: 0, Column: 1, Num Rows: 1, Num Columns: 2<br>=0D
   Version: 2, Serial Number: 2000, Mod Counter: 237<br>=0D
   Clean: No, Status: 0<br>=0D
   sectPerSU: 128, SUsPerPU: 1, SUsPerRU: 1<br>=0D
   Queue size: 100, blocksize: 512, numBlocks: 4197120<br>=0D
   RAID Level: 1<br>=0D
   Autoconfig: No<br>=0D
   Root partition: No<br>=0D
   Last configured as: raid0<br>=0D
Parity status: DIRTY<br>=0D
Reconstruction is 100% complete.<br>=0D
      Parity Rewrite is 100% complete.<br>=0D
Copyback is 100% complete.</tt></b></font><br>=0D
      </td>=0D
    </tr>=0D
                                                                       =20=0D
                                  =20=0D
  </tbody>=0D
</table>=0D
<br>=0D
<b>NOTE: </b>The command "<b>raidctl -v -s raid0</b>" is used quite frequen=
tly.=0D
You may wish to setup an alias in your environment:=0D
<blockquote><b><tt> # alias r0stat=3D"/sbin/raidctl -v -s raid0|more"</tt><=
br>=0D
  <tt> # alias r1stat=3D"/sbin/raidctl -v -s raid1|more"</tt></b><br>=0D
  </blockquote>=0D
<h3>Create a file system and mount the new RAID </h3>=0D
Like any physical disk, RAID meta disk volumes have disklabels.  You can=0D
now create your destination file system layout on the RAID.  Per our notes=0D
above, we're simply creating<br>=0D
<tt><br>=0D
</tt>=0D
<blockquote><tt><b>    # disklabel -r -I -e raid0d</b></tt><br>=0D
</blockquote>=0D
<br>=0D
<table cellpadding=3D"1" cellspacing=3D"1" border=3D"1">=0D
  <tbody>=0D
    <tr>=0D
           <td valign=3D"top" bgcolor=3D"#ffffcc"> <tt><b>[...snip...]<br>=0D
bytes/sector: 512<br>=0D
sectors/track: 128<br>=0D
tracks/cylinder: 8<br>=0D
sectors/cylinder: 1024<br>=0D
cylinders: 4098<br>=0D
total sectors: 4197120<br>=0D
      [...snip...]<br>=0D
4 partitions:<br>=0D
#        size    offset     fstype  [fsize bsize cpg/sgs]<br>=0D
 a:   4197120         0     4.2BSD   2048 16384   326    # (Cyl.    0 - 409=
8*)<br>=0D
 d:   4197120         0     unused         0       0                  # (Cy=
l.=0D
   0 - 4098*)</b></tt><br>=0D
      </td>=0D
    </tr>=0D
                                                                        =20=0D
                               =20=0D
  </tbody>=0D
</table>=0D
<br>=0D
<br>=0D
Create the 4.2BSD/FFS file system.<tt><br>=0D
</tt>=0D
<blockquote><tt><b>    # newfs /dev/rraid0a<br>=0D
  </b></tt><br>=0D
</blockquote>=0D
<table cellpadding=3D"1" cellspacing=3D"1" border=3D"1">=0D
  <tbody>=0D
    <tr>=0D
      <td valign=3D"top" bgcolor=3D"#000000"><font color=3D"#33cc00"><b><tt=
>  =20=0D
  2049.4MB in 13 cyl groups (326 c/g, 163.00MB/g, 19968 i/g)<br>=0D
super-block backups (for fsck -b #) at:<br>=0D
      32,  333984,  667936, 1001888, 1335840, 1669792, 2003744, 2337696,=0D
2670624, 3004576, 3338528, 3672480, 4006432,</tt></b></font><br>=0D
      </td>=0D
    </tr>=0D
                                                                       =20=0D
                                  =20=0D
  </tbody>=0D
</table>=0D
<tt><b><br>=0D
</b></tt>Mount the file system at a temporary location.<tt><b><br>=0D
</b></tt>=0D
<blockquote><tt><b>    # mount /dev/raid0a /mnt</b></tt><br>=0D
  <tt><b>    # df</b></tt><br>=0D
  </blockquote>=0D
<table cellpadding=3D"1" cellspacing=3D"1" border=3D"1">=0D
  <tbody>=0D
    <tr>=0D
      <td valign=3D"top" bgcolor=3D"#000000"><tt><font color=3D"#33cc00"><b=
>Filesystem=0D
1K-blocks     Used     Avail Capacity  Mounted on<br>=0D
/dev/sd0a   1985053   222158   1663642    11%    /<br>=0D
/dev/raid0a   2065678             2   1962392      0%    /mnt</b></font></t=
t></td>=0D
    </tr>=0D
                                                          =20=0D
  </tbody>=0D
</table>=0D
<br>=0D
<b>NOTE: </b>Depending on the size of your RAID, you'll probably want to=0D
read<a href=3D"http://netbsd.gw.com/cgi-bin/man-cgi?newfs++NetBSD-current">=
newfs(8)</a>=0D
and pass some flags to help optimize your file system.=0D
<h3>Replicate generic install from disk0 onto newly created RAID using pax<=
/h3>=0D
<blockquote><b><tt>    # cd /; pax -X -rw -pe / /mnt</tt></b><br>=0D
  <b><tt>    # df -m</tt></b><br>=0D
</blockquote>=0D
<table cellpadding=3D"1" cellspacing=3D"1" border=3D"1">=0D
  <tbody>=0D
    <tr>=0D
      <td valign=3D"top" bgcolor=3D"#000000"><b><font color=3D"#33cc00"><tt=
>Filesystem=0D
1M-blocks     Used     Avail Capacity  Mounted on<br>=0D
/dev/sd0a          1938      216      1624    11%    /<br>=0D
/dev/raid0a      2017      224      1691    11%    /mnt</tt></font></b></td=
>=0D
    </tr>=0D
                                                                        =20=0D
                                         =20=0D
  </tbody>=0D
</table>=0D
<h3>Configure replicated system configuration (/etc) independent of dis</h3=
>=0D
In rc.conf, you will want to set <b>no_swap=3DYES</b> as our example system=0D
will not have a swap partition and we do not want to have /etc/rc complaini=
ng.<br>=0D
<blockquote><b><tt># vi /mnt/etc/rc.conf</tt></b><br>=0D
</blockquote>=0D
<table cellpadding=3D"1" cellspacing=3D"1" border=3D"1">=0D
  <tbody>=0D
    <tr>=0D
      <td valign=3D"top" bgcolor=3D"#ffffcc"> <tt><b>rc_configured=3DYES<br=
>=0D
wscons=3DYES<br>=0D
no_swap=3DYES<br>=0D
sshd=3DYES<br>=0D
inetd=3DNO</b></tt><br>=0D
  </td>=0D
    </tr>=0D
                                                                       =20=0D
                             =20=0D
  </tbody>=0D
</table>=0D
<br>=0D
<br>=0D
In the fstab, you will need to adjust entries reflecting 'sd0' to their rai=
d0=0D
equivalent.<br>=0D
<blockquote><b><tt>    # vi /mnt/etc/fstab</tt></b><br>=0D
</blockquote>=0D
<table cellpadding=3D"1" cellspacing=3D"1" border=3D"1">=0D
  <tbody>=0D
    <tr>=0D
      <td valign=3D"top" bgcolor=3D"#ffffcc"> <tt><b>/dev/raid0a / ffs rw 1=
 1</b></tt><br>=0D
  </td>=0D
    </tr>=0D
                                                                       =20=0D
                             =20=0D
  </tbody>=0D
</table>=0D
<br>=0D
<h3>Make disk1 bootable with RAID component</h3>=0D
 In you need to install i386 BIOS boot blocks in the area of the disk of=0D
disk1  before the RAID partition begins.=0D
<blockquote><b><tt>    # /usr/mdec/installboot -v -b 16 /usr/mdec/biosboot.=
sym=0D
/dev/rsd1d</tt></b><br>=0D
</blockquote>=0D
<table cellpadding=3D"1" cellspacing=3D"1" border=3D"1">=0D
  <tbody>=0D
    <tr>=0D
      <td valign=3D"top" bgcolor=3D"#000000"><font color=3D"#33cc00"><b><tt=
>/usr/mdec/biosboot.sym:=0D
entry point 0x8063000<br>=0D
proto bootblock size 48128<br>=0D
room for 10 filesystem blocks at 0x580<br>=0D
/dev/rsd1d: block number 16, size 40448 table blocks: 10/10<br>=0D
/dev/rsd1d: block numbers: 16 24 32 40 48 56 64 72 80 88<br>=0D
BSD partition starts at sector 0</tt></b></font><br>=0D
      </td>=0D
    </tr>=0D
                                                                        =20=0D
                                         =20=0D
  </tbody>=0D
</table>=0D
<br>=0D
This will also setup the MBR on the disk.  Verify:=0D
<blockquote><b><tt>    # fdisk sd1</tt></b><br>=0D
</blockquote>=0D
<table cellpadding=3D"1" cellspacing=3D"1" border=3D"1">=0D
  <tbody>=0D
    <tr>=0D
      <td valign=3D"top" bgcolor=3D"#000000"><b><font color=3D"#33cc00"><tt=
>Disk:=0D
/dev/rsd1d<br>=0D
NetBSD disklabel disk geometry:<br>=0D
cylinders: 3992 heads: 9 sectors/track: 116 (1044 sectors/cylinder)<br>=0D
      <br>=0D
BIOS disk geometry:<br>=0D
cylinders: 1023 heads: 64 sectors/track: 32 (2048 sectors/cylinder)<br>=0D
      <br>=0D
Partition table:<br>=0D
0: &lt;UNUSED&gt;<br>=0D
1: &lt;UNUSED&gt;<br>=0D
2: &lt;UNUSED&gt;<br>=0D
3: sysid 169 (NetBSD)<br>=0D
    start 0, size 16 (0 MB), flag 0x80<br>=0D
        beg: cylinder    0, head   0, sector  1<br>=0D
        end: cylinder    0, head   0, sector 16</tt></font></b><br>=0D
      </td>=0D
    </tr>=0D
                                                                        =20=0D
                                         =20=0D
  </tbody>=0D
</table>=0D
<br>=0D
The <b>"-A"</b> flag to <a=0D
 href=3D"http://netbsd.gw.com/cgi-bin/man-cgi?raidctl++NetBSD-current">raid=
ctl(8)</a>=0D
will mark the components of a RAID set auto configurable by the kernel.=0D
<blockquote><b><tt>    # raidctl -v -A root raid0</tt></b><br>=0D
</blockquote>=0D
<table cellpadding=3D"1" cellspacing=3D"1" border=3D"1">=0D
  <tbody>=0D
    <tr>=0D
      <td valign=3D"top" bgcolor=3D"#000000"><tt><b><font color=3D"#33cc00"=
>New=0D
autoconfig value is: 1<br>=0D
New rootpartition value is: 1<br>=0D
raid0: Autoconfigure: Yes<br>=0D
raid0: Root: Yes<br>=0D
      </font><font color=3D"#33cc00">/netbsd: New rootpartition value is: 1=
</font></b></tt><br>=0D
      </td>=0D
    </tr>=0D
                                                                        =20=0D
                                         =20=0D
  </tbody>=0D
</table>=0D
<br>=0D
<h3>Backup and remove your RAID1 configuration</h3>=0D
It is important that you backup and remove the RAID configuration file from=0D
/etc. Keep the original configuration file around for reference later. Now=0D
that the RAID  set is marked autoconfigure, the kernel will handle the init=
alization=0D
process and you do not  want /etc/rc to also try to configure.=0D
<blockquote><tt><b>    # tar [etc.] /etc/raid0.conf</b></tt><br>=0D
  <tt><b>    # mv /etc/raid0.conf /root</b></tt></blockquote>=0D
<h3>Reboot and test RAID on disk1</h3>=0D
<blockquote><b><tt>    # shutdown -r NOW</tt></b><br>=0D
</blockquote>=0D
At this point enter your SCSI BIOS setup menu and adjust the boot ID to tha=
t=0D
of disk1 (normally ID 1).  Boot the system.  The SCSI controller should pro=
be=0D
disk1/ID1 before ID0.  The kernel will read RAID autoconfigure data from=0D
disk1.  <br>=0D
<br>=0D
<table cellpadding=3D"1" cellspacing=3D"1" border=3D"1">=0D
  <tbody>=0D
    <tr>=0D
           <td valign=3D"top" bgcolor=3D"#000000"><tt><font color=3D"#33cc0=
0"><b><i>[...snip...]</i><br>=0D
Kernelized RAIDframe activated<br>=0D
RAID autoconfigure<br>=0D
Configuring raid0:<br>=0D
RAIDFRAME: protectedSectors is 64<br>=0D
RAIDFRAME: Configure (RAID Level 1): total number of sectors is 4197120 (20=
49=0D
MB)<br>=0D
RAIDFRAME(RAID Level 1): Using 6 floating recon bufs with no head sep limit=
<br>=0D
boot device: raid0<br>=0D
root on raid0a dumps on raid0b<br>=0D
root file system type: ffs</b></font></tt><br>=0D
      <i><tt><font color=3D"#33cc00"><b>[...snip...]</b></font></tt></i><br=
>=0D
  </td>=0D
    </tr>=0D
                                                                       =20=0D
                   =20=0D
  </tbody>=0D
</table>=0D
<br>=0D
<br>=0D
<b>NOTE:</b> This step is necessary to verify that the boot blocks are work=
ing=0D
on the new drive and that they can read into the RAID partition meta data=0D
and  find a kernel.<br>=0D
<br>=0D
<b>NOTE:</b> Theoretically, could interrupt the boot block countdown at thi=
s=0D
point  and change the boot dev from "<b>hd0a:netbsd</b>" (which is disk1/SC=
SI=0D
ID 1) to  "<b>hd1a:netbsd</b>" (which is disk0/SCSI ID 0).  However, becaus=
e=0D
both disks  contain a relatively GENERIC kernel with RAID autoconfigure ena=
bled,=0D
they will  force <b>rootdev=3D/dev/raid0a</b>.  If you are truly curious, t=
ry=0D
booting  with the "<b>-a</b>" flag.<br>=0D
<h3>Disklabel disk0 with an identical disklabel from disk1 (destructive)</h=
3>=0D
<blockquote><tt><b>    # disklabel -r sd1d &gt; /var/tmp/sd1_label</b></tt>=
<br>=0D
  <tt><b>    # dd if=3D/dev/zero of=3D/dev/rsd0d Bs=3D8k count=3D1</b></tt>=
<br>=0D
  <b><tt>    # disklabel -I -r -i sd0d</tt></b><br>=0D
  </blockquote>=0D
<table cellpadding=3D"1" cellspacing=3D"1" border=3D"1">=0D
  <tbody>=0D
    <tr>=0D
      <td valign=3D"top" bgcolor=3D"#ffffcc"> <tt><b>partition&gt; W<br>=0D
Label disk [n]? y<br>=0D
Label written<br>=0D
partition&gt; Q</b></tt>  </td>=0D
    </tr>=0D
                                                                        =20=0D
                =20=0D
  </tbody>=0D
</table>=0D
<blockquote><b>    <tt># disklabel -R sd0d /var/tmp/sd1_label</tt></b><br>=0D
</blockquote>=0D
<h3>Add disk0 as a component spare to the RAID</h3>=0D
The <b>"-a"</b> flag permits you to add a spare to a RAID set. Now that sd0=0D
is ready, we can add the sd0a slice<br>=0D
<br>=0D
<blockquote><b><tt>    # raidctl -v -a /dev/sd0a raid0</tt></b><br>=0D
  <b><tt>    # raidctl -v -s raid0</tt></b><br>=0D
</blockquote>=0D
<br>=0D
<table cellpadding=3D"1" cellspacing=3D"1" border=3D"1">=0D
  <tbody>=0D
    <tr>=0D
      <td valign=3D"top" bgcolor=3D"#000000"><font color=3D"#33cc00"><tt><b=
>Components:<br>=0D
          component0: failed<br>=0D
           /dev/sd1a: optimal<br>=0D
Spares:<br>=0D
           /dev/sd0a: spare<br>=0D
component0 status is: failed.  Skipping label.<br>=0D
Component label for /dev/sd1a:<br>=0D
   Row: 0, Column: 1, Num Rows: 1, Num Columns: 2<br>=0D
   Version: 2, Serial Number: 2000, Mod Counter: 259<br>=0D
   Clean: No, Status: 0<br>=0D
   sectPerSU: 128, SUsPerPU: 1, SUsPerRU: 1<br>=0D
   Queue size: 100, blocksize: 512, numBlocks: 4197120<br>=0D
   RAID Level: 1<br>=0D
   Autoconfig: Yes<br>=0D
   Root partition: Yes<br>=0D
   Last configured as: raid0<br>=0D
/dev/sd0a status is: spare.  Skipping label.<br>=0D
Parity status: DIRTY<br>=0D
Reconstruction is 100% complete.<br>=0D
      Parity Rewrite is 100% complete.<br>=0D
Copyback is 100% complete.</b></tt></font><br>=0D
      </td>=0D
    </tr>=0D
                                                                        =20=0D
                                         =20=0D
  </tbody>=0D
</table>=0D
<br>=0D
<h3>Synchronize drives (disk1 -&gt; disk0)</h3>=0D
By failing pseudo component '<b>component0</b>', RAIDFrame will upgrade the=0D
spare you've added into use and begin rebuilding parity on it immediately;=0D
hence, duplicating the drive.=0D
<blockquote><b><tt>    # raidctl -v -F component0 raid0</tt></b><br>=0D
</blockquote>=0D
<table cellpadding=3D"1" cellspacing=3D"1" border=3D"1">=0D
  <tbody>=0D
    <tr>=0D
      <td valign=3D"top" bgcolor=3D"#000000"><b><tt><font color=3D"#33cc00"=
>raid0:=0D
Failing the disk: row: 0 col: 0<br>=0D
raid0: Failing disk r0 c0<br>=0D
Reconstruction status:<br>=0D
RECON: initiating reconstruction on row 0 col 0 -&gt; spare at row 0 col 2<=
br>=0D
Suspending: Waiting for Quiescence<br>=0D
Quiescence reached..</font></tt></b></td>=0D
    </tr>=0D
                                                                        =20=0D
                                         =20=0D
  </tbody>=0D
</table>=0D
<br>=0D
You can see the progress of the rebuild on another terminal (perhaps, from=0D
the kitchen or family room) using the "<b>-S</b>" and <b>"-s"</b> flags.=0D
<blockquote><tt><b>    # raidctl -v -s raid0</b></tt><br>=0D
</blockquote>=0D
<table cellpadding=3D"1" cellspacing=3D"1" border=3D"1">=0D
  <tbody>=0D
    <tr>=0D
      <td valign=3D"top" bgcolor=3D"#000000"><tt><font color=3D"#33cc00"><b=
> Components:<br>=0D
     /dev/sd0a: reconstructing                 /dev/sd1a: optimal  </b></fo=
nt></tt></td>=0D
    </tr>=0D
                                                                        =20=0D
                =20=0D
  </tbody>=0D
</table>=0D
<blockquote><b><tt>    # raidctl -v -S raid0</tt></b><br>=0D
</blockquote>=0D
=20=0D
<table cellpadding=3D"1" cellspacing=3D"1" border=3D"1">=0D
  <tbody>=0D
    <tr>=0D
      <td valign=3D"top" bgcolor=3D"#000000"><b><font color=3D"#33cc00">Rec=
onstruction=0D
is 35% complete.<br>=0D
      Parity Rewrite is 100% complete.<br>=0D
Copyback is 100% complete.<br>=0D
Reconstruction status:<br>=0D
      </font></b><tt><b><font color=3D"#33cc00">35% |**************       =20=0D
              | ETA:    05:03 \</font></b></tt></td>=0D
    </tr>=0D
                                                                        =20=0D
                                         =20=0D
  </tbody>=0D
</table>=0D
<br>=0D
The RAID set should now have clean parity=0D
<blockquote><tt><b>    # raidctl -v -s raid0</b></tt><br>=0D
</blockquote>=0D
<table cellpadding=3D"1" cellspacing=3D"1" border=3D"1">=0D
  <tbody>=0D
    <tr>=0D
      <td valign=3D"top" bgcolor=3D"#000000"><b><tt><font color=3D"#33cc00"=
>Components:<br>=0D
          component0: spared<br>=0D
           /dev/sd1a: optimal<br>=0D
Spares:<br>=0D
           /dev/sd0a: used_spare<br>=0D
component0 status is: spared.  Skipping label.<br>=0D
Component label for /dev/sd1a:<br>=0D
   Row: 0, Column: 1, Num Rows: 1, Num Columns: 2<br>=0D
   Version: 2, Serial Number: 2000, Mod Counter: 260<br>=0D
   Clean: No, Status: 0<br>=0D
   sectPerSU: 128, SUsPerPU: 1, SUsPerRU: 1<br>=0D
   Queue size: 100, blocksize: 512, numBlocks: 4197120<br>=0D
   RAID Level: 1<br>=0D
   Autoconfig: Yes<br>=0D
   Root partition: Yes<br>=0D
   Last configured as: raid0<br>=0D
Component label for /dev/sd0a:<br>=0D
   Row: 0, Column: 0, Num Rows: 1, Num Columns: 2<br>=0D
   Version: 2, Serial Number: 2000, Mod Counter: 260<br>=0D
   Clean: No, Status: 0<br>=0D
   sectPerSU: 128, SUsPerPU: 1, SUsPerRU: 1<br>=0D
   Queue size: 100, blocksize: 512, numBlocks: 4197120<br>=0D
   RAID Level: 1<br>=0D
   Autoconfig: Yes<br>=0D
   Root partition: Yes<br>=0D
   Last configured as: raid0<br>=0D
Parity status: clean<br>=0D
Reconstruction is 100% complete.<br>=0D
      Parity Rewrite is 100% complete.<br>=0D
Copyback is 100% complete.</font></tt></b><br>=0D
      </td>=0D
    </tr>=0D
                                                                       =20=0D
                             =20=0D
  </tbody>=0D
</table>=0D
<br>=0D
<h3>Make disk0 bootable</h3>=0D
<blockquote><b><tt>    # /usr/mdec/installboot -v -b 16 /usr/mdec/biosboot.=
sym=0D
/dev/rsd0d</tt></b><br>=0D
</blockquote>=0D
<b><tt><br>=0D
</tt></b>=0D
<table cellpadding=3D"1" cellspacing=3D"1" border=3D"1">=0D
  <tbody>=0D
    <tr>=0D
      <td valign=3D"top" bgcolor=3D"#000000">          <b><font=0D
 color=3D"#33cc00"><tt>/usr/mdec/biosboot.sym: entry point 0x8063000<br>=0D
proto bootblock size 48128<br>=0D
room for 10 filesystem blocks at 0x580<br>=0D
/dev/rsd0d: block number 16, size 40448 table blocks: 10/10<br>=0D
/dev/rsd0d: block numbers: 16 24 32 40 48 56 64 72 80 88<br>=0D
BSD partition starts at sector 0</tt></font></b><tt><font=0D
 color=3D"#33cc00"><br>=0D
      </font></tt></td>=0D
    </tr>=0D
                                                                        =20=0D
                                         =20=0D
  </tbody>=0D
</table>=0D
<h3>Reboot to test disk0 component and boot blocks </h3>=0D
<tt>Reset your SCSI boot ID back to 0 after reboot.  When the boot block=0D
prompt appears, press <b>control+c</b> to escape out of the sequence:</tt>=0D
<blockquote><tt><b>    # shutdown -r NOW</b></tt><br>=0D
</blockquote>=0D
<table cellpadding=3D"1" cellspacing=3D"1" border=3D"1">=0D
  <tbody>=0D
    <tr>=0D
      <td valign=3D"top" bgcolor=3D"#000000"><b><font color=3D"#33cc00"><tt=
>&gt;&gt;=0D
NetBSD/i386 BIOS Boot, Revision 2.12<br>=0D
&gt;&gt; (autobuild@tgm.daemon.org, Sun Sep  8 19:22:29 UTC 2002)<br>=0D
&gt;&gt; Memory: 638/129984 k<br>=0D
Press return to boot now, any other key for boot menu<br>=0D
booting hd0a:netbsd - starting in 0<br>=0D
      <font color=3D"#33cc00">type "?" or "help" for help.<br>=0D
      </font></tt></font><tt><font color=3D"#33cc00">&gt; dev hd0a:<br>=0D
&gt; ls /<br>=0D
      [Snip]<br>=0D
3: boot (REG)<br>=0D
4: netbsd (REG)<br>=0D
      [Snip] <br>=0D
&gt; dev hd1a:<br>=0D
      &gt; Ls /<br>=0D
      </font><font color=3D"#33cc00">[Snip]<br>=0D
3: boot (REG)<br>=0D
4: netbsd (REG</font><font color=3D"#33cc00">)</font></tt></b><br>=0D
      <b><font color=3D"#33cc00"><tt>&gt; boot hd0a:netbsd</tt></font></b><=
br>=0D
      <b><font color=3D"#33cc00"><tt>booting hd0a:netbsd<br>=0D
5451936+112040+341476 [304304+255616]=3D0x62b920<br>=0D
[ using 560372 bytes of netbsd ELF symbol table ]</tt></font></b></td>=0D
    </tr>=0D
                                                                       =20=0D
                                       =20=0D
  </tbody>=0D
</table>=0D
<blockquote><tt><b><br>=0D
  </b></tt></blockquote>=0D
Verify that <b>/dev/sd0a</b> has now replaced <b>component0</b> and that=0D
the status of parity is clean.<br>=0D
=0D
=0D
<blockquote><tt><b># df</b></tt><br></blockquote>=0D
=0D
=0D
<table cellpadding=3D"1" cellspacing=3D"1" border=3D"1">=0D
  <tbody>=0D
      <tr>=0D
            <td valign=3D"top" bgcolor=3D"#000000"><tt><b><font color=3D"#3=
3cc00">=0D
=0D
Filesystem  512-blocks     Used     Avail Capacity  Mounted on<br>=0D
/dev/raid0a    &nbsp;  4131356   465156   3459632    11%    /<br>=0D
=0D
</font></b></tt><tt><font color=3D"#33cc00"><b> <br>=0D
  </b></font></tt></td>=0D
      </tr>=0D
=0D
=0D
        </tbody>=0D
	</table>=0D
=0D
=0D
=0D
<blockquote><tt><b># raidctl -v -s raid0</b></tt><br>=0D
</blockquote>=0D
<table cellpadding=3D"1" cellspacing=3D"1" border=3D"1">=0D
  <tbody>=0D
    <tr>=0D
      <td valign=3D"top" bgcolor=3D"#000000"><tt><b><font color=3D"#33cc00"=
>Components:<br>=0D
           /dev/sd0a: optimal<br>=0D
           /dev/sd1a: optimal<br>=0D
No spares.<br>=0D
Component label for /dev/sd0a:<br>=0D
   Row: 0, Column: 0, Num Rows: 1, Num Columns: 2<br>=0D
   Version: 2, Serial Number: 2000, Mod Counter: 291<br>=0D
   Clean: No, Status: 0<br>=0D
   sectPerSU: 128, SUsPerPU: 1, SUsPerRU: 1<br>=0D
   Queue size: 100, blocksize: 512, numBlocks: 4197120<br>=0D
   RAID Level: 1<br>=0D
   Autoconfig: Yes<br>=0D
   Root partition: Yes<br>=0D
   Last configured as: raid0<br>=0D
Component label for /dev/sd1a:<br>=0D
   Row: 0, Column: 1, Num Rows: 1, Num Columns: 2<br>=0D
   Version: 2, Serial Number: 2000, Mod Counter: 291<br>=0D
   Clean: No, Status: 0<br>=0D
   sectPerSU: 128, SUsPerPU: 1, SUsPerRU: 1<br>=0D
   Queue size: 100, blocksize: 512, numBlocks: 4197120<br>=0D
   RAID Level: 1<br>=0D
   Autoconfig: Yes<br>=0D
   Root partition: Yes<br>=0D
   Last configured as: raid0<br>=0D
Parity status: clean<br>=0D
Reconstruction is 100% complete.<br>=0D
      Parity Rewrite is 100% complete.<br>=0D
Copyback is 100% complete.</font></b></tt><tt><font color=3D"#33cc00"><b> <=
br>=0D
  </b></font></tt></td>=0D
    </tr>=0D
                                                                       =20=0D
              =20=0D
  </tbody>=0D
</table>=0D
<h3>Backup disklabels and MBRs</h3>=0D
<blockquote><b><tt>    # umask 077</tt></b><br>=0D
  <b><tt>    # disklabel -r sd0 &gt; /tmp/sd0_disklabel</tt></b><br>=0D
  <b><tt>    # disklabel -r sd1 &gt; /tmp/sd1_disklabel</tt></b><br>=0D
  <b><tt>    # fdisk sd0 &gt; /tmp/sd0_MBR</tt></b><br>=0D
  <b><tt>    # fdisk sd1 &gt; /tmp/sd1_MBR</tt></b><br>=0D
  <b><tt>    # tar [etc.] /tmp/sd*</tt></b></blockquote>=0D
<h3>TEST: Reboot to test failing disk1 (disable drive)</h3>=0D
     Ideas?=0D
<h3>TEST: Reboot to test failing disk0 (disable drive)</h3>=0D
     Ideas?=0D
<h3>TEST: Warm-fail disk0. Recover using disk1</h3>=0D
<blockquote><b><tt>    # raidctl -v -f /dev/sd0a raid0</tt></b><br>=0D
  <b><tt>    # raidctl -vs raid0</tt></b><br>=0D
  <b><tt>    # raidctl -R /dev/sd0a raid0</tt></b><br>=0D
  <b><tt>    # raidctl Vs raid0</tt></b><br>=0D
  <b><tt>    # raidctl Vs raid0</tt></b><br>=0D
  <b><tt>    # disk sd0</tt></b><br>=0D
  <b><tt>    # disklabel -r sd0</tt></b></blockquote>=0D
<h3>TEST: Warm-fail disk1. Recover using disk0</h3>=0D
<blockquote><b><font color=3D"#000000"><tt>    # raidctl -v -f /dev/sd1a ra=
id0</tt></font></b><br>=0D
  <b><font color=3D"#000000"><tt>    # raidctl Vs raid0</tt></font></b><br>=0D
  <b><font color=3D"#000000"><tt>    # raidctl -R /dev/sd1a raid0</tt></fon=
t></b><br>=0D
  <b><font color=3D"#000000"><tt>    # raidctl Vs raid0</tt></font></b><br>=0D
  <b><font color=3D"#000000"><tt>    # raidctl Vs raid0</tt></font></b><br>=0D
  <b><font color=3D"#000000"><tt>    # fdisk sd1</tt></font></b><br>=0D
  <b><font color=3D"#000000"><tt>    # disklabel -r sd1</tt></font></b></bl=
ockquote>=0D
<h3>TEST: Hot-fail disk0. Recover using disk1</h3>=0D
Ideas on a hot-fail test?=0D
<h3>TEST: Hot-fail disk1. Recover using disk0</h3>=0D
Ideas on a hot-fail test?<br>=0D
<br>=0D
<h3>Follow Up</h3>=0D
<ul>=0D
  <li>    Mention boot diskette with <b>biosboot_com0.sym</b></li>=0D
</ul>=0D
<br>=0D
<br>=0D
<br>=0D
</body>=0D
</html>=0D

--=_precursor-11926-1060086869-0001-2--