implement 32-bit compat support for raidframe.
convert several raidframe ioctls to be bitsize idempotent so that
they work the same in 32 and 64 bit worlds, allowing netbsd32 to
configure and query raid properly. remove useless 'row' in a few
places. add COMPAT_80 and put the old ioctls there.
raidframeio.h:
RAIDFRAME_TEST_ACC
- remove, unused
RAIDFRAME_GET_COMPONENT_LABEL
- convert to label not pointer to label
RAIDFRAME_CHECK_RECON_STATUS_EXT
RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT
RAIDFRAME_CHECK_COPYBACK_STATUS_EXT
- convert to progress info not pointer to info
RAIDFRAME_GET_INFO
- version entirely.
raidframevar.h:
- rf_recon_req{} has row, flags and raidPtr removed (they're
not a useful part of this interface.)
- RF_Config_s{} and RF_DeviceConfig_s{} have numRow/rows removed.
- RF_RaidDisk_s{} is re-ordered slightly to fix alignment
padding - the actual data was already OK.
- InstallSpareTable() loses row argument
rf_compat32.c has code for RF_Config_s{} in 32 bit mode, used
by RAIDFRAME_CONFIGURE and RAIDFRAME_GET_INFO32.
rf_compat80.c has code for rf_recon_req{}, RF_RaidDisk_s{} and
RF_DeviceConfig_s{} to handle RAIDFRAME_FAIL_DISK,
RAIDFRAME_GET_COMPONENT_LABEL, RAIDFRAME_CHECK_RECON_STATUS_EXT,
RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT,
RAIDFRAME_CHECK_COPYBACK_STATUS_EXT, RAIDFRAME_GET_INFO.
move several of the per-ioctl code blocks into separate functions.
add rf_recon_req_internal{} to replace old usage of global
rf_recon_req{} that had unused void * in the structure, ruining
it's 32/64 bit ABI.
add missing case for RAIDFRAME_GET_INFO50.
adjust raid tests to use the new .conf format, and add a case to
test the old method as well.
raidctl:
deal with lack of 'row' members in a couple of places.
fail request no longer takes row.
handle "START array" sections with just "numCol numSpare", ie
no "numRow" specified. for now, generate old-style configuration
but update raidctl.8 to specify the new style (keeping reference
to the old style.)
note that: RF_ComponentLabel_s::{row,num_rows} and
RF_SingleComponent_s::row are obsolete but not removed yet.
2018-01-18 03:32:48 +03:00
|
|
|
.\" $NetBSD: raidctl.8,v 1.74 2018/01/18 00:32:49 mrg Exp $
|
1998-11-13 16:16:46 +03:00
|
|
|
.\"
|
2002-10-01 18:20:26 +04:00
|
|
|
.\" Copyright (c) 1998, 2002 The NetBSD Foundation, Inc.
|
1998-11-13 16:16:46 +03:00
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" This code is derived from software contributed to The NetBSD Foundation
|
|
|
|
.\" by Greg Oster
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
|
|
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
|
|
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
.\" POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 1995 Carnegie-Mellon University.
|
|
|
|
.\" All rights reserved.
|
2001-11-16 13:25:42 +03:00
|
|
|
.\"
|
1998-11-13 16:16:46 +03:00
|
|
|
.\" Author: Mark Holland
|
2001-11-16 13:25:42 +03:00
|
|
|
.\"
|
1998-11-13 16:16:46 +03:00
|
|
|
.\" Permission to use, copy, modify and distribute this software and
|
|
|
|
.\" its documentation is hereby granted, provided that both the copyright
|
|
|
|
.\" notice and this permission notice appear in all copies of the
|
|
|
|
.\" software, derivative works or modified versions, and any portions
|
|
|
|
.\" thereof, and that both notices appear in supporting documentation.
|
2001-11-16 13:25:42 +03:00
|
|
|
.\"
|
1998-11-13 16:16:46 +03:00
|
|
|
.\" CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
|
|
|
|
.\" CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
|
|
|
|
.\" FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
|
2001-11-16 13:25:42 +03:00
|
|
|
.\"
|
1998-11-13 16:16:46 +03:00
|
|
|
.\" Carnegie Mellon requests users of this software to return to
|
2001-11-16 13:25:42 +03:00
|
|
|
.\"
|
1998-11-13 16:16:46 +03:00
|
|
|
.\" Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
|
|
|
|
.\" School of Computer Science
|
|
|
|
.\" Carnegie Mellon University
|
|
|
|
.\" Pittsburgh PA 15213-3890
|
2001-11-16 13:25:42 +03:00
|
|
|
.\"
|
1998-11-13 16:16:46 +03:00
|
|
|
.\" any improvements or extensions that they make and grant Carnegie the
|
|
|
|
.\" rights to redistribute these changes.
|
2001-11-16 13:25:42 +03:00
|
|
|
.\"
|
2016-01-06 20:41:36 +03:00
|
|
|
.Dd January 6, 2016
|
1998-11-13 16:16:46 +03:00
|
|
|
.Dt RAIDCTL 8
|
2001-06-05 15:22:41 +04:00
|
|
|
.Os
|
1998-11-13 16:16:46 +03:00
|
|
|
.Sh NAME
|
|
|
|
.Nm raidctl
|
|
|
|
.Nd configuration utility for the RAIDframe disk driver
|
|
|
|
.Sh SYNOPSIS
|
2003-02-25 13:34:36 +03:00
|
|
|
.Nm
|
2001-11-16 13:25:42 +03:00
|
|
|
.Op Fl v
|
2014-04-03 22:54:10 +04:00
|
|
|
.Fl A Op yes | no | forceroot | softroot
|
2000-02-25 02:52:46 +03:00
|
|
|
.Ar dev
|
2003-02-25 13:34:36 +03:00
|
|
|
.Nm
|
2001-11-16 13:25:42 +03:00
|
|
|
.Op Fl v
|
2016-01-07 01:57:44 +03:00
|
|
|
.Fl a Ar component Ar dev
|
2003-02-25 13:34:36 +03:00
|
|
|
.Nm
|
2001-11-16 13:25:42 +03:00
|
|
|
.Op Fl v
|
2016-01-07 01:57:44 +03:00
|
|
|
.Fl B Ar dev
|
2003-02-25 13:34:36 +03:00
|
|
|
.Nm
|
2001-11-16 13:25:42 +03:00
|
|
|
.Op Fl v
|
1999-03-02 06:13:59 +03:00
|
|
|
.Fl C Ar config_file Ar dev
|
2003-02-25 13:34:36 +03:00
|
|
|
.Nm
|
2001-11-16 13:25:42 +03:00
|
|
|
.Op Fl v
|
2016-01-07 01:57:44 +03:00
|
|
|
.Fl c Ar config_file Ar dev
|
2003-02-25 13:34:36 +03:00
|
|
|
.Nm
|
2001-11-16 13:25:42 +03:00
|
|
|
.Op Fl v
|
1998-11-13 16:16:46 +03:00
|
|
|
.Fl F Ar component Ar dev
|
2003-02-25 13:34:36 +03:00
|
|
|
.Nm
|
2001-11-16 13:25:42 +03:00
|
|
|
.Op Fl v
|
2016-01-07 01:57:44 +03:00
|
|
|
.Fl f Ar component Ar dev
|
2003-02-25 13:34:36 +03:00
|
|
|
.Nm
|
2001-11-16 13:25:42 +03:00
|
|
|
.Op Fl v
|
|
|
|
.Fl G Ar dev
|
2003-02-25 13:34:36 +03:00
|
|
|
.Nm
|
2001-11-16 13:25:42 +03:00
|
|
|
.Op Fl v
|
2016-01-07 01:57:44 +03:00
|
|
|
.Fl g Ar component Ar dev
|
2003-02-25 13:34:36 +03:00
|
|
|
.Nm
|
2001-11-16 13:25:42 +03:00
|
|
|
.Op Fl v
|
1999-03-02 06:13:59 +03:00
|
|
|
.Fl I Ar serial_number Ar dev
|
2003-02-25 13:34:36 +03:00
|
|
|
.Nm
|
2001-11-16 13:25:42 +03:00
|
|
|
.Op Fl v
|
2016-01-07 01:57:44 +03:00
|
|
|
.Fl i Ar dev
|
2009-11-17 21:54:26 +03:00
|
|
|
.Nm
|
|
|
|
.Op Fl v
|
|
|
|
.Fl M
|
|
|
|
.Oo yes | no | set
|
|
|
|
.Ar params
|
|
|
|
.Oc
|
|
|
|
.Ar dev
|
|
|
|
.Nm
|
|
|
|
.Op Fl v
|
2016-01-07 01:57:44 +03:00
|
|
|
.Fl m Ar dev
|
2003-02-25 13:34:36 +03:00
|
|
|
.Nm
|
2001-11-16 13:25:42 +03:00
|
|
|
.Op Fl v
|
1999-08-10 22:21:39 +04:00
|
|
|
.Fl P Ar dev
|
2003-02-25 13:34:36 +03:00
|
|
|
.Nm
|
2001-11-16 13:25:42 +03:00
|
|
|
.Op Fl v
|
2016-01-07 01:57:44 +03:00
|
|
|
.Fl p Ar dev
|
2003-02-25 13:34:36 +03:00
|
|
|
.Nm
|
2001-11-16 13:25:42 +03:00
|
|
|
.Op Fl v
|
1999-03-02 06:13:59 +03:00
|
|
|
.Fl R Ar component Ar dev
|
2003-02-25 13:34:36 +03:00
|
|
|
.Nm
|
2001-11-16 13:25:42 +03:00
|
|
|
.Op Fl v
|
2016-01-07 01:57:44 +03:00
|
|
|
.Fl r Ar component Ar dev
|
2003-02-25 13:34:36 +03:00
|
|
|
.Nm
|
2001-11-16 13:25:42 +03:00
|
|
|
.Op Fl v
|
1999-03-02 06:13:59 +03:00
|
|
|
.Fl S Ar dev
|
2003-02-25 13:34:36 +03:00
|
|
|
.Nm
|
2001-11-16 13:25:42 +03:00
|
|
|
.Op Fl v
|
2016-01-07 01:57:44 +03:00
|
|
|
.Fl s Ar dev
|
2016-01-06 20:41:36 +03:00
|
|
|
.Nm
|
|
|
|
.Op Fl v
|
|
|
|
.Fl U Ar unit Ar dev
|
2016-01-07 01:57:44 +03:00
|
|
|
.Nm
|
|
|
|
.Op Fl v
|
|
|
|
.Fl u Ar dev
|
1998-11-13 16:16:46 +03:00
|
|
|
.Sh DESCRIPTION
|
2002-10-01 18:20:26 +04:00
|
|
|
.Nm
|
1998-11-13 16:16:46 +03:00
|
|
|
is the user-land control program for
|
1999-03-06 14:51:48 +03:00
|
|
|
.Xr raid 4 ,
|
2001-11-16 13:25:42 +03:00
|
|
|
the RAIDframe disk device.
|
2002-10-01 18:20:26 +04:00
|
|
|
.Nm
|
1998-11-13 16:16:46 +03:00
|
|
|
is primarily used to dynamically configure and unconfigure RAIDframe disk
|
2002-10-01 17:40:23 +04:00
|
|
|
devices.
|
|
|
|
For more information about the RAIDframe disk device, see
|
1998-11-13 16:16:46 +03:00
|
|
|
.Xr raid 4 .
|
|
|
|
.Pp
|
|
|
|
This document assumes the reader has at least rudimentary knowledge of
|
|
|
|
RAID and RAID concepts.
|
|
|
|
.Pp
|
2001-11-16 13:25:42 +03:00
|
|
|
The command-line options for
|
1998-11-13 16:16:46 +03:00
|
|
|
.Nm
|
|
|
|
are as follows:
|
|
|
|
.Bl -tag -width indent
|
2000-02-25 02:52:46 +03:00
|
|
|
.It Fl A Ic yes Ar dev
|
2002-10-01 17:40:23 +04:00
|
|
|
Make the RAID set auto-configurable.
|
|
|
|
The RAID set will be automatically configured at boot
|
2000-02-25 02:52:46 +03:00
|
|
|
.Ar before
|
2002-10-01 17:40:23 +04:00
|
|
|
the root file system is mounted.
|
2002-10-01 18:20:26 +04:00
|
|
|
Note that all components of the set must be of type
|
|
|
|
.Dv RAID
|
|
|
|
in the disklabel.
|
2000-02-25 02:52:46 +03:00
|
|
|
.It Fl A Ic no Ar dev
|
|
|
|
Turn off auto-configuration for the RAID set.
|
2014-04-03 22:54:10 +04:00
|
|
|
.It Fl A Ic forceroot Ar dev
|
2000-02-25 02:52:46 +03:00
|
|
|
Make the RAID set auto-configurable, and also mark the set as being
|
2002-10-01 17:40:23 +04:00
|
|
|
eligible to be the root partition.
|
|
|
|
A RAID set configured this way will
|
2000-02-25 02:52:46 +03:00
|
|
|
.Ar override
|
2002-10-01 17:40:23 +04:00
|
|
|
the use of the boot disk as the root device.
|
2002-10-01 18:20:26 +04:00
|
|
|
All components of the set must be of type
|
|
|
|
.Dv RAID
|
|
|
|
in the disklabel.
|
2005-01-31 19:42:15 +03:00
|
|
|
Note that only certain architectures
|
2013-10-07 14:50:37 +04:00
|
|
|
.Pq currently alpha, amd64, i386, pmax, sandpoint, sparc, sparc64, and vax
|
2005-01-31 19:42:15 +03:00
|
|
|
support booting a kernel directly from a RAID set.
|
2015-06-30 20:18:13 +03:00
|
|
|
Please note that
|
|
|
|
.Ic forceroot
|
|
|
|
mode was referred to as
|
|
|
|
.Ic root
|
|
|
|
mode on earlier versions of
|
|
|
|
.Nx .
|
|
|
|
For compatibility reasons,
|
|
|
|
.Ic root
|
|
|
|
can be used as an alias for
|
2015-07-01 01:16:12 +03:00
|
|
|
.Ic forceroot .
|
2014-04-03 22:54:10 +04:00
|
|
|
.It Fl A Ic softroot Ar dev
|
|
|
|
Like
|
|
|
|
.Ic forceroot ,
|
|
|
|
but only change the root device if the boot device is part of the RAID set.
|
2016-01-07 01:57:44 +03:00
|
|
|
.It Fl a Ar component Ar dev
|
|
|
|
Add
|
|
|
|
.Ar component
|
|
|
|
as a hot spare for the device
|
|
|
|
.Ar dev .
|
|
|
|
Component labels (which identify the location of a given
|
|
|
|
component within a particular RAID set) are automatically added to the
|
|
|
|
hot spare after it has been used and are not required for
|
|
|
|
.Ar component
|
|
|
|
before it is used.
|
1999-03-02 06:13:59 +03:00
|
|
|
.It Fl B Ar dev
|
2001-11-16 13:25:42 +03:00
|
|
|
Initiate a copyback of reconstructed data from a spare disk to
|
2002-10-01 17:40:23 +04:00
|
|
|
its original disk.
|
|
|
|
This is performed after a component has failed,
|
1999-03-02 06:13:59 +03:00
|
|
|
and the failed drive has been reconstructed onto a spare drive.
|
2016-01-07 01:57:44 +03:00
|
|
|
.It Fl C Ar config_file Ar dev
|
|
|
|
As for
|
|
|
|
.Fl c ,
|
|
|
|
but forces the configuration to take place.
|
|
|
|
Fatal errors due to uninitialized components are ignored.
|
|
|
|
This is required the first time a RAID set is configured.
|
1998-11-13 16:16:46 +03:00
|
|
|
.It Fl c Ar config_file Ar dev
|
2001-11-16 13:25:42 +03:00
|
|
|
Configure the RAIDframe device
|
1998-11-13 16:16:46 +03:00
|
|
|
.Ar dev
|
|
|
|
according to the configuration given in
|
|
|
|
.Ar config_file .
|
2001-11-16 13:25:42 +03:00
|
|
|
A description of the contents of
|
1998-11-13 16:16:46 +03:00
|
|
|
.Ar config_file
|
|
|
|
is given later.
|
|
|
|
.It Fl F Ar component Ar dev
|
2001-11-16 13:25:42 +03:00
|
|
|
Fails the specified
|
1998-11-13 16:16:46 +03:00
|
|
|
.Ar component
|
|
|
|
of the device, and immediately begin a reconstruction of the failed
|
2002-10-01 17:40:23 +04:00
|
|
|
disk onto an available hot spare.
|
|
|
|
This is one of the mechanisms used to start
|
1998-11-13 16:16:46 +03:00
|
|
|
the reconstruction process if a component does have a hardware failure.
|
2016-01-07 01:57:44 +03:00
|
|
|
.It Fl f Ar component Ar dev
|
|
|
|
This marks the specified
|
|
|
|
.Ar component
|
|
|
|
as having failed, but does not initiate a reconstruction of that component.
|
2001-07-10 05:30:52 +04:00
|
|
|
.It Fl G Ar dev
|
|
|
|
Generate the configuration of the RAIDframe device in a format suitable for
|
2002-10-01 18:20:26 +04:00
|
|
|
use with the
|
2001-07-10 05:30:52 +04:00
|
|
|
.Fl c
|
|
|
|
or
|
2002-10-01 18:20:26 +04:00
|
|
|
.Fl C
|
|
|
|
options.
|
2016-01-07 01:57:44 +03:00
|
|
|
.It Fl g Ar component Ar dev
|
|
|
|
Get the component label for the specified component.
|
1999-03-02 06:13:59 +03:00
|
|
|
.It Fl I Ar serial_number Ar dev
|
2001-11-16 13:25:42 +03:00
|
|
|
Initialize the component labels on each component of the device.
|
|
|
|
.Ar serial_number
|
1999-03-02 06:13:59 +03:00
|
|
|
is used as one of the keys in determining whether a
|
2002-10-01 17:40:23 +04:00
|
|
|
particular set of components belong to the same RAID set.
|
|
|
|
While not strictly enforced, different serial numbers should be used for
|
|
|
|
different RAID sets.
|
|
|
|
This step
|
2002-10-01 18:20:26 +04:00
|
|
|
.Em MUST
|
2000-02-25 02:52:46 +03:00
|
|
|
be performed when a new RAID set is created.
|
2016-01-07 01:57:44 +03:00
|
|
|
.It Fl i Ar dev
|
|
|
|
Initialize the RAID device.
|
|
|
|
In particular, (re-)write the parity on the selected device.
|
|
|
|
This
|
|
|
|
.Em MUST
|
|
|
|
be done for
|
|
|
|
.Em all
|
|
|
|
RAID sets before the RAID device is labeled and before
|
|
|
|
file systems are created on the RAID device.
|
2009-11-17 21:54:26 +03:00
|
|
|
.It Fl M Ic yes Ar dev
|
|
|
|
.\"XXX should there be a section with more info on the parity map feature?
|
|
|
|
Enable the use of a parity map on the RAID set; this is the default,
|
|
|
|
and greatly reduces the time taken to check parity after unclean
|
|
|
|
shutdowns at the cost of some very slight overhead during normal
|
|
|
|
operation.
|
|
|
|
Changes to this setting will take effect the next time the set is
|
|
|
|
configured.
|
|
|
|
Note that RAID-0 sets, having no parity, will not use a parity map in
|
|
|
|
any case.
|
|
|
|
.It Fl M Ic no Ar dev
|
|
|
|
Disable the use of a parity map on the RAID set; doing this is not
|
|
|
|
recommended.
|
|
|
|
This will take effect the next time the set is configured.
|
|
|
|
.It Fl M Ic set Ar cooldown Ar tickms Ar regions Ar dev
|
|
|
|
Alter the parameters of the parity map; parameters to leave unchanged
|
|
|
|
can be given as 0, and trailing zeroes may be omitted.
|
|
|
|
.\"XXX should this explanation be deferred to another section as well?
|
2009-11-17 22:35:48 +03:00
|
|
|
The RAID set is divided into
|
2009-11-17 21:54:26 +03:00
|
|
|
.Ar regions
|
|
|
|
regions; each region is marked dirty for at most
|
|
|
|
.Ar cooldown
|
2009-11-17 22:35:48 +03:00
|
|
|
intervals of
|
2009-11-17 21:54:26 +03:00
|
|
|
.Ar tickms
|
|
|
|
milliseconds each after a write to it, and at least
|
|
|
|
.Ar cooldown
|
|
|
|
\- 1 such intervals.
|
|
|
|
Changes to
|
|
|
|
.Ar regions
|
|
|
|
take effect the next time is configured, while changes to the other
|
|
|
|
parameters are applied immediately.
|
|
|
|
The default parameters are expected to be reasonable for most workloads.
|
2016-01-07 01:57:44 +03:00
|
|
|
.It Fl m Ar dev
|
|
|
|
Display status information about the parity map on the RAID set, if any.
|
|
|
|
If used with
|
|
|
|
.Fl v
|
|
|
|
then the current contents of the parity map will be output (in
|
|
|
|
hexadecimal format) as well.
|
1999-08-10 22:21:39 +04:00
|
|
|
.It Fl P Ar dev
|
|
|
|
Check the status of the parity on the RAID set, and initialize
|
|
|
|
(re-write) the parity if the parity is not known to be up-to-date.
|
2000-02-26 01:24:46 +03:00
|
|
|
This is normally used after a system crash (and before a
|
|
|
|
.Xr fsck 8 )
|
|
|
|
to ensure the integrity of the parity.
|
2016-01-07 01:57:44 +03:00
|
|
|
.It Fl p Ar dev
|
|
|
|
Check the status of the parity on the RAID set.
|
|
|
|
Displays a status message,
|
|
|
|
and returns successfully if the parity is up-to-date.
|
1999-03-02 06:13:59 +03:00
|
|
|
.It Fl R Ar component Ar dev
|
2001-11-16 13:25:42 +03:00
|
|
|
Fails the specified
|
|
|
|
.Ar component ,
|
|
|
|
if necessary, and immediately begins a reconstruction back to
|
1999-03-02 06:13:59 +03:00
|
|
|
.Ar component .
|
2000-06-02 08:11:46 +04:00
|
|
|
This is useful for reconstructing back onto a component after
|
|
|
|
it has been replaced following a failure.
|
2016-01-07 01:57:44 +03:00
|
|
|
.It Fl r Ar component Ar dev
|
|
|
|
Remove the spare disk specified by
|
|
|
|
.Ar component
|
|
|
|
from the set of available spare components.
|
1999-03-02 06:13:59 +03:00
|
|
|
.It Fl S Ar dev
|
2000-02-26 01:24:46 +03:00
|
|
|
Check the status of parity re-writing, component reconstruction, and
|
2002-10-01 17:40:23 +04:00
|
|
|
component copyback.
|
|
|
|
The output indicates the amount of progress
|
2000-02-26 01:24:46 +03:00
|
|
|
achieved in each of these areas.
|
2016-01-07 01:57:44 +03:00
|
|
|
.It Fl s Ar dev
|
|
|
|
Display the status of the RAIDframe device for each of the components
|
|
|
|
and spares.
|
2016-01-06 20:41:36 +03:00
|
|
|
.It Fl U Ar unit Ar dev
|
|
|
|
Set the
|
|
|
|
.Dv last_unit
|
|
|
|
field in all the raid components, so that the next time the raid
|
|
|
|
will be autoconfigured it uses that
|
|
|
|
.Ar unit .
|
2016-01-07 01:57:44 +03:00
|
|
|
.It Fl u Ar dev
|
|
|
|
Unconfigure the RAIDframe device.
|
|
|
|
This does not remove any component labels or change any configuration
|
|
|
|
settings (e.g. auto-configuration settings) for the RAID set.
|
2001-11-16 13:25:42 +03:00
|
|
|
.It Fl v
|
2002-10-01 17:40:23 +04:00
|
|
|
Be more verbose.
|
|
|
|
For operations such as reconstructions, parity
|
2000-01-05 06:02:41 +03:00
|
|
|
re-writing, and copybacks, provide a progress indicator.
|
1998-11-13 16:16:46 +03:00
|
|
|
.El
|
|
|
|
.Pp
|
2001-11-16 13:25:42 +03:00
|
|
|
The device used by
|
1998-11-13 16:16:46 +03:00
|
|
|
.Nm
|
2001-11-16 13:25:42 +03:00
|
|
|
is specified by
|
|
|
|
.Ar dev .
|
1998-11-13 16:16:46 +03:00
|
|
|
.Ar dev
|
2002-10-01 18:20:26 +04:00
|
|
|
may be either the full name of the device, e.g.,
|
|
|
|
.Pa /dev/rraid0d ,
|
|
|
|
for the i386 architecture, or
|
|
|
|
.Pa /dev/rraid0c
|
|
|
|
for many others, or just simply
|
|
|
|
.Pa raid0
|
|
|
|
(for
|
|
|
|
.Pa /dev/rraid0[cd] ) .
|
2002-11-17 01:49:48 +03:00
|
|
|
It is recommended that the partitions used to represent the
|
|
|
|
RAID device are not used for file systems.
|
2001-07-10 05:30:52 +04:00
|
|
|
.Ss Configuration file
|
1998-11-13 16:16:46 +03:00
|
|
|
The format of the configuration file is complex, and
|
2002-10-01 17:40:23 +04:00
|
|
|
only an abbreviated treatment is given here.
|
|
|
|
In the configuration files, a
|
1998-11-13 16:16:46 +03:00
|
|
|
.Sq #
|
|
|
|
indicates the beginning of a comment.
|
|
|
|
.Pp
|
|
|
|
There are 4 required sections of a configuration file, and 2
|
2002-10-01 17:40:23 +04:00
|
|
|
optional sections.
|
|
|
|
Each section begins with a
|
2001-11-16 13:25:42 +03:00
|
|
|
.Sq START ,
|
2002-10-01 17:40:23 +04:00
|
|
|
followed by the section name,
|
|
|
|
and the configuration parameters associated with that section.
|
|
|
|
The first section is the
|
1998-11-13 16:16:46 +03:00
|
|
|
.Sq array
|
|
|
|
section, and it specifies
|
implement 32-bit compat support for raidframe.
convert several raidframe ioctls to be bitsize idempotent so that
they work the same in 32 and 64 bit worlds, allowing netbsd32 to
configure and query raid properly. remove useless 'row' in a few
places. add COMPAT_80 and put the old ioctls there.
raidframeio.h:
RAIDFRAME_TEST_ACC
- remove, unused
RAIDFRAME_GET_COMPONENT_LABEL
- convert to label not pointer to label
RAIDFRAME_CHECK_RECON_STATUS_EXT
RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT
RAIDFRAME_CHECK_COPYBACK_STATUS_EXT
- convert to progress info not pointer to info
RAIDFRAME_GET_INFO
- version entirely.
raidframevar.h:
- rf_recon_req{} has row, flags and raidPtr removed (they're
not a useful part of this interface.)
- RF_Config_s{} and RF_DeviceConfig_s{} have numRow/rows removed.
- RF_RaidDisk_s{} is re-ordered slightly to fix alignment
padding - the actual data was already OK.
- InstallSpareTable() loses row argument
rf_compat32.c has code for RF_Config_s{} in 32 bit mode, used
by RAIDFRAME_CONFIGURE and RAIDFRAME_GET_INFO32.
rf_compat80.c has code for rf_recon_req{}, RF_RaidDisk_s{} and
RF_DeviceConfig_s{} to handle RAIDFRAME_FAIL_DISK,
RAIDFRAME_GET_COMPONENT_LABEL, RAIDFRAME_CHECK_RECON_STATUS_EXT,
RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT,
RAIDFRAME_CHECK_COPYBACK_STATUS_EXT, RAIDFRAME_GET_INFO.
move several of the per-ioctl code blocks into separate functions.
add rf_recon_req_internal{} to replace old usage of global
rf_recon_req{} that had unused void * in the structure, ruining
it's 32/64 bit ABI.
add missing case for RAIDFRAME_GET_INFO50.
adjust raid tests to use the new .conf format, and add a case to
test the old method as well.
raidctl:
deal with lack of 'row' members in a couple of places.
fail request no longer takes row.
handle "START array" sections with just "numCol numSpare", ie
no "numRow" specified. for now, generate old-style configuration
but update raidctl.8 to specify the new style (keeping reference
to the old style.)
note that: RF_ComponentLabel_s::{row,num_rows} and
RF_SingleComponent_s::row are obsolete but not removed yet.
2018-01-18 03:32:48 +03:00
|
|
|
the number of columns, and spare disks in the RAID set.
|
2002-10-01 17:40:23 +04:00
|
|
|
For example:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
1998-11-13 16:16:46 +03:00
|
|
|
START array
|
implement 32-bit compat support for raidframe.
convert several raidframe ioctls to be bitsize idempotent so that
they work the same in 32 and 64 bit worlds, allowing netbsd32 to
configure and query raid properly. remove useless 'row' in a few
places. add COMPAT_80 and put the old ioctls there.
raidframeio.h:
RAIDFRAME_TEST_ACC
- remove, unused
RAIDFRAME_GET_COMPONENT_LABEL
- convert to label not pointer to label
RAIDFRAME_CHECK_RECON_STATUS_EXT
RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT
RAIDFRAME_CHECK_COPYBACK_STATUS_EXT
- convert to progress info not pointer to info
RAIDFRAME_GET_INFO
- version entirely.
raidframevar.h:
- rf_recon_req{} has row, flags and raidPtr removed (they're
not a useful part of this interface.)
- RF_Config_s{} and RF_DeviceConfig_s{} have numRow/rows removed.
- RF_RaidDisk_s{} is re-ordered slightly to fix alignment
padding - the actual data was already OK.
- InstallSpareTable() loses row argument
rf_compat32.c has code for RF_Config_s{} in 32 bit mode, used
by RAIDFRAME_CONFIGURE and RAIDFRAME_GET_INFO32.
rf_compat80.c has code for rf_recon_req{}, RF_RaidDisk_s{} and
RF_DeviceConfig_s{} to handle RAIDFRAME_FAIL_DISK,
RAIDFRAME_GET_COMPONENT_LABEL, RAIDFRAME_CHECK_RECON_STATUS_EXT,
RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT,
RAIDFRAME_CHECK_COPYBACK_STATUS_EXT, RAIDFRAME_GET_INFO.
move several of the per-ioctl code blocks into separate functions.
add rf_recon_req_internal{} to replace old usage of global
rf_recon_req{} that had unused void * in the structure, ruining
it's 32/64 bit ABI.
add missing case for RAIDFRAME_GET_INFO50.
adjust raid tests to use the new .conf format, and add a case to
test the old method as well.
raidctl:
deal with lack of 'row' members in a couple of places.
fail request no longer takes row.
handle "START array" sections with just "numCol numSpare", ie
no "numRow" specified. for now, generate old-style configuration
but update raidctl.8 to specify the new style (keeping reference
to the old style.)
note that: RF_ComponentLabel_s::{row,num_rows} and
RF_SingleComponent_s::row are obsolete but not removed yet.
2018-01-18 03:32:48 +03:00
|
|
|
3 0
|
1998-11-13 16:16:46 +03:00
|
|
|
.Ed
|
|
|
|
.Pp
|
implement 32-bit compat support for raidframe.
convert several raidframe ioctls to be bitsize idempotent so that
they work the same in 32 and 64 bit worlds, allowing netbsd32 to
configure and query raid properly. remove useless 'row' in a few
places. add COMPAT_80 and put the old ioctls there.
raidframeio.h:
RAIDFRAME_TEST_ACC
- remove, unused
RAIDFRAME_GET_COMPONENT_LABEL
- convert to label not pointer to label
RAIDFRAME_CHECK_RECON_STATUS_EXT
RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT
RAIDFRAME_CHECK_COPYBACK_STATUS_EXT
- convert to progress info not pointer to info
RAIDFRAME_GET_INFO
- version entirely.
raidframevar.h:
- rf_recon_req{} has row, flags and raidPtr removed (they're
not a useful part of this interface.)
- RF_Config_s{} and RF_DeviceConfig_s{} have numRow/rows removed.
- RF_RaidDisk_s{} is re-ordered slightly to fix alignment
padding - the actual data was already OK.
- InstallSpareTable() loses row argument
rf_compat32.c has code for RF_Config_s{} in 32 bit mode, used
by RAIDFRAME_CONFIGURE and RAIDFRAME_GET_INFO32.
rf_compat80.c has code for rf_recon_req{}, RF_RaidDisk_s{} and
RF_DeviceConfig_s{} to handle RAIDFRAME_FAIL_DISK,
RAIDFRAME_GET_COMPONENT_LABEL, RAIDFRAME_CHECK_RECON_STATUS_EXT,
RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT,
RAIDFRAME_CHECK_COPYBACK_STATUS_EXT, RAIDFRAME_GET_INFO.
move several of the per-ioctl code blocks into separate functions.
add rf_recon_req_internal{} to replace old usage of global
rf_recon_req{} that had unused void * in the structure, ruining
it's 32/64 bit ABI.
add missing case for RAIDFRAME_GET_INFO50.
adjust raid tests to use the new .conf format, and add a case to
test the old method as well.
raidctl:
deal with lack of 'row' members in a couple of places.
fail request no longer takes row.
handle "START array" sections with just "numCol numSpare", ie
no "numRow" specified. for now, generate old-style configuration
but update raidctl.8 to specify the new style (keeping reference
to the old style.)
note that: RF_ComponentLabel_s::{row,num_rows} and
RF_SingleComponent_s::row are obsolete but not removed yet.
2018-01-18 03:32:48 +03:00
|
|
|
indicates an array with 3 columns, and 0 spare disks.
|
|
|
|
Old configurations specified a 3rd value in front of the
|
|
|
|
number of columns and spare disks.
|
|
|
|
This old value, if provided, must be specified as 1:
|
|
|
|
.Bd -literal -offset indent
|
|
|
|
START array
|
|
|
|
1 3 0
|
|
|
|
.Ed
|
1998-11-13 16:16:46 +03:00
|
|
|
.Pp
|
2001-11-16 13:25:42 +03:00
|
|
|
The second section, the
|
1998-11-13 16:16:46 +03:00
|
|
|
.Sq disks
|
2002-10-01 17:40:23 +04:00
|
|
|
section, specifies the actual components of the device.
|
|
|
|
For example:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
1998-11-13 16:16:46 +03:00
|
|
|
START disks
|
|
|
|
/dev/sd0e
|
|
|
|
/dev/sd1e
|
|
|
|
/dev/sd2e
|
|
|
|
.Ed
|
|
|
|
.Pp
|
2002-10-01 17:40:23 +04:00
|
|
|
specifies the three component disks to be used in the RAID device.
|
2017-11-20 21:37:56 +03:00
|
|
|
Disk wedges may also be specified with the NAME=<wedge name> syntax.
|
2002-10-01 17:40:23 +04:00
|
|
|
If any of the specified drives cannot be found when the RAID device is
|
2001-11-16 13:25:42 +03:00
|
|
|
configured, then they will be marked as
|
|
|
|
.Sq failed ,
|
2002-10-01 17:40:23 +04:00
|
|
|
and the system will operate in degraded mode.
|
|
|
|
Note that it is
|
2002-10-01 18:20:26 +04:00
|
|
|
.Em imperative
|
1998-11-13 16:16:46 +03:00
|
|
|
that the order of the components in the configuration file does not
|
2002-10-01 17:40:23 +04:00
|
|
|
change between configurations of a RAID device.
|
|
|
|
Changing the order of the components will result in data loss
|
|
|
|
if the set is configured with the
|
2000-02-26 01:24:46 +03:00
|
|
|
.Fl C
|
2002-10-01 17:40:23 +04:00
|
|
|
option.
|
|
|
|
In normal circumstances, the RAID set will not configure if only
|
2000-02-26 01:24:46 +03:00
|
|
|
.Fl c
|
2001-11-16 13:25:42 +03:00
|
|
|
is specified, and the components are out-of-order.
|
1998-11-13 16:16:46 +03:00
|
|
|
.Pp
|
2001-11-16 13:25:42 +03:00
|
|
|
The next section, which is the
|
1998-11-13 16:16:46 +03:00
|
|
|
.Sq spare
|
2002-10-01 17:40:23 +04:00
|
|
|
section, is optional, and, if present, specifies the devices to be used as
|
1998-11-13 16:16:46 +03:00
|
|
|
.Sq hot spares
|
2002-10-01 17:40:23 +04:00
|
|
|
\(em devices which are on-line,
|
|
|
|
but are not actively used by the RAID driver unless
|
|
|
|
one of the main components fail.
|
|
|
|
A simple
|
1998-11-13 16:16:46 +03:00
|
|
|
.Sq spare
|
|
|
|
section might be:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
2001-11-16 13:25:42 +03:00
|
|
|
START spare
|
1998-11-13 16:16:46 +03:00
|
|
|
/dev/sd3e
|
|
|
|
.Ed
|
|
|
|
.Pp
|
2002-10-01 17:40:23 +04:00
|
|
|
for a configuration with a single spare component.
|
|
|
|
If no spare drives are to be used in the configuration, then the
|
1998-11-13 16:16:46 +03:00
|
|
|
.Sq spare
|
2000-02-26 01:24:46 +03:00
|
|
|
section may be omitted.
|
1998-11-13 16:16:46 +03:00
|
|
|
.Pp
|
2001-11-16 13:25:42 +03:00
|
|
|
The next section is the
|
1998-11-13 16:16:46 +03:00
|
|
|
.Sq layout
|
2002-10-01 17:40:23 +04:00
|
|
|
section.
|
|
|
|
This section describes the general layout parameters for the RAID device,
|
|
|
|
and provides such information as
|
|
|
|
sectors per stripe unit,
|
|
|
|
stripe units per parity unit,
|
|
|
|
stripe units per reconstruction unit,
|
|
|
|
and the parity configuration to use.
|
|
|
|
This section might look like:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
1998-11-13 16:16:46 +03:00
|
|
|
START layout
|
|
|
|
# sectPerSU SUsPerParityUnit SUsPerReconUnit RAID_level
|
|
|
|
32 1 1 5
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
The sectors per stripe unit specifies, in blocks, the interleave
|
2002-10-01 18:20:26 +04:00
|
|
|
factor; i.e., the number of contiguous sectors to be written to each
|
2002-10-01 17:40:23 +04:00
|
|
|
component for a single stripe.
|
|
|
|
Appropriate selection of this value (32 in this example)
|
|
|
|
is the subject of much research in RAID architectures.
|
|
|
|
The stripe units per parity unit and
|
1998-11-13 16:16:46 +03:00
|
|
|
stripe units per reconstruction unit are normally each set to 1.
|
|
|
|
While certain values above 1 are permitted, a discussion of valid
|
|
|
|
values and the consequences of using anything other than 1 are outside
|
2002-10-01 17:40:23 +04:00
|
|
|
the scope of this document.
|
|
|
|
The last value in this section (5 in this example)
|
|
|
|
indicates the parity configuration desired.
|
|
|
|
Valid entries include:
|
1998-11-13 16:16:46 +03:00
|
|
|
.Bl -tag -width inde
|
2001-11-16 13:25:42 +03:00
|
|
|
.It 0
|
2002-10-01 17:40:23 +04:00
|
|
|
RAID level 0.
|
|
|
|
No parity, only simple striping.
|
1998-11-13 16:16:46 +03:00
|
|
|
.It 1
|
2002-10-01 17:40:23 +04:00
|
|
|
RAID level 1.
|
|
|
|
Mirroring.
|
|
|
|
The parity is the mirror.
|
1998-11-13 16:16:46 +03:00
|
|
|
.It 4
|
2002-10-01 17:40:23 +04:00
|
|
|
RAID level 4.
|
2002-10-01 18:20:26 +04:00
|
|
|
Striping across components, with parity stored on the last component.
|
1998-11-13 16:16:46 +03:00
|
|
|
.It 5
|
2002-10-01 17:40:23 +04:00
|
|
|
RAID level 5.
|
2002-10-01 18:20:26 +04:00
|
|
|
Striping across components, parity distributed across all components.
|
1998-11-13 16:16:46 +03:00
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
There are other valid entries here, including those for Even-Odd
|
2001-11-16 13:25:42 +03:00
|
|
|
parity, RAID level 5 with rotated sparing, Chained declustering,
|
1998-11-13 16:16:46 +03:00
|
|
|
and Interleaved declustering, but as of this writing the code for
|
2001-11-16 13:25:42 +03:00
|
|
|
those parity operations has not been tested with
|
1998-11-13 16:16:46 +03:00
|
|
|
.Nx .
|
|
|
|
.Pp
|
2001-11-16 13:25:42 +03:00
|
|
|
The next required section is the
|
1998-11-13 16:16:46 +03:00
|
|
|
.Sq queue
|
2002-10-01 17:40:23 +04:00
|
|
|
section.
|
|
|
|
This is most often specified as:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
1998-11-13 16:16:46 +03:00
|
|
|
START queue
|
2000-02-26 01:24:46 +03:00
|
|
|
fifo 100
|
1998-11-13 16:16:46 +03:00
|
|
|
.Ed
|
|
|
|
.Pp
|
2000-02-26 01:38:51 +03:00
|
|
|
where the queuing method is specified as fifo (first-in, first-out),
|
2001-11-16 13:25:42 +03:00
|
|
|
and the size of the per-component queue is limited to 100 requests.
|
1998-11-13 16:16:46 +03:00
|
|
|
Other queuing methods may also be specified, but a discussion of them
|
|
|
|
is beyond the scope of this document.
|
|
|
|
.Pp
|
2001-11-16 13:25:42 +03:00
|
|
|
The final section, the
|
1999-02-18 10:54:33 +03:00
|
|
|
.Sq debug
|
2002-10-01 17:40:23 +04:00
|
|
|
section, is optional.
|
|
|
|
For more details on this the reader is referred to
|
|
|
|
the RAIDframe documentation discussed in the
|
1998-11-13 16:16:46 +03:00
|
|
|
.Sx HISTORY
|
|
|
|
section.
|
2001-11-16 14:06:46 +03:00
|
|
|
.Pp
|
1998-11-13 16:16:46 +03:00
|
|
|
See
|
|
|
|
.Sx EXAMPLES
|
|
|
|
for a more complete configuration file example.
|
2001-11-16 14:06:46 +03:00
|
|
|
.Sh FILES
|
|
|
|
.Bl -tag -width /dev/XXrXraidX -compact
|
|
|
|
.It Pa /dev/{,r}raid*
|
|
|
|
.Cm raid
|
|
|
|
device special files.
|
|
|
|
.El
|
1998-11-13 16:16:46 +03:00
|
|
|
.Sh EXAMPLES
|
2000-02-26 01:24:46 +03:00
|
|
|
It is highly recommended that before using the RAID driver for real
|
2001-07-10 05:30:52 +04:00
|
|
|
file systems that the system administrator(s) become quite familiar
|
2000-02-26 01:24:46 +03:00
|
|
|
with the use of
|
2003-02-25 13:34:36 +03:00
|
|
|
.Nm ,
|
2002-10-01 18:20:26 +04:00
|
|
|
and that they understand how the component reconstruction process works.
|
2002-10-01 17:40:23 +04:00
|
|
|
The examples in this section will focus on configuring a
|
2000-02-26 01:24:46 +03:00
|
|
|
number of different RAID sets of varying degrees of redundancy.
|
2001-11-16 13:25:42 +03:00
|
|
|
By working through these examples, administrators should be able to
|
2000-02-26 01:24:46 +03:00
|
|
|
develop a good feel for how to configure a RAID set, and how to
|
|
|
|
initiate reconstruction of failed components.
|
|
|
|
.Pp
|
|
|
|
In the following examples
|
|
|
|
.Sq raid0
|
2002-10-01 17:40:23 +04:00
|
|
|
will be used to denote the RAID device.
|
|
|
|
Depending on the architecture,
|
2002-10-01 18:20:26 +04:00
|
|
|
.Pa /dev/rraid0c
|
2001-11-16 13:25:42 +03:00
|
|
|
or
|
2002-10-01 18:20:26 +04:00
|
|
|
.Pa /dev/rraid0d
|
2000-02-26 01:24:46 +03:00
|
|
|
may be used in place of
|
2002-10-01 18:20:26 +04:00
|
|
|
.Pa raid0 .
|
2000-08-10 19:14:14 +04:00
|
|
|
.Ss Initialization and Configuration
|
2000-02-26 01:24:46 +03:00
|
|
|
The initial step in configuring a RAID set is to identify the components
|
2002-10-01 17:40:23 +04:00
|
|
|
that will be used in the RAID set.
|
|
|
|
All components should be the same size.
|
|
|
|
Each component should have a disklabel type of
|
2000-02-26 01:24:46 +03:00
|
|
|
.Dv FS_RAID ,
|
2002-10-01 18:20:26 +04:00
|
|
|
and a typical disklabel entry for a RAID component might look like:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
2000-02-25 02:52:46 +03:00
|
|
|
f: 1800000 200495 RAID # (Cyl. 405*- 4041*)
|
|
|
|
.Ed
|
1998-11-13 16:16:46 +03:00
|
|
|
.Pp
|
2000-02-26 01:24:46 +03:00
|
|
|
While
|
2001-11-16 13:25:42 +03:00
|
|
|
.Dv FS_BSDFFS
|
2000-02-26 01:24:46 +03:00
|
|
|
will also work as the component type, the type
|
2001-11-16 13:25:42 +03:00
|
|
|
.Dv FS_RAID
|
2000-02-26 01:24:46 +03:00
|
|
|
is preferred for RAIDframe use, as it is required for features such as
|
2002-10-01 17:40:23 +04:00
|
|
|
auto-configuration.
|
|
|
|
As part of the initial configuration of each RAID set,
|
|
|
|
each component will be given a
|
2000-02-26 01:24:46 +03:00
|
|
|
.Sq component label .
|
|
|
|
A
|
|
|
|
.Sq component label
|
|
|
|
contains important information about the component, including a
|
implement 32-bit compat support for raidframe.
convert several raidframe ioctls to be bitsize idempotent so that
they work the same in 32 and 64 bit worlds, allowing netbsd32 to
configure and query raid properly. remove useless 'row' in a few
places. add COMPAT_80 and put the old ioctls there.
raidframeio.h:
RAIDFRAME_TEST_ACC
- remove, unused
RAIDFRAME_GET_COMPONENT_LABEL
- convert to label not pointer to label
RAIDFRAME_CHECK_RECON_STATUS_EXT
RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT
RAIDFRAME_CHECK_COPYBACK_STATUS_EXT
- convert to progress info not pointer to info
RAIDFRAME_GET_INFO
- version entirely.
raidframevar.h:
- rf_recon_req{} has row, flags and raidPtr removed (they're
not a useful part of this interface.)
- RF_Config_s{} and RF_DeviceConfig_s{} have numRow/rows removed.
- RF_RaidDisk_s{} is re-ordered slightly to fix alignment
padding - the actual data was already OK.
- InstallSpareTable() loses row argument
rf_compat32.c has code for RF_Config_s{} in 32 bit mode, used
by RAIDFRAME_CONFIGURE and RAIDFRAME_GET_INFO32.
rf_compat80.c has code for rf_recon_req{}, RF_RaidDisk_s{} and
RF_DeviceConfig_s{} to handle RAIDFRAME_FAIL_DISK,
RAIDFRAME_GET_COMPONENT_LABEL, RAIDFRAME_CHECK_RECON_STATUS_EXT,
RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT,
RAIDFRAME_CHECK_COPYBACK_STATUS_EXT, RAIDFRAME_GET_INFO.
move several of the per-ioctl code blocks into separate functions.
add rf_recon_req_internal{} to replace old usage of global
rf_recon_req{} that had unused void * in the structure, ruining
it's 32/64 bit ABI.
add missing case for RAIDFRAME_GET_INFO50.
adjust raid tests to use the new .conf format, and add a case to
test the old method as well.
raidctl:
deal with lack of 'row' members in a couple of places.
fail request no longer takes row.
handle "START array" sections with just "numCol numSpare", ie
no "numRow" specified. for now, generate old-style configuration
but update raidctl.8 to specify the new style (keeping reference
to the old style.)
note that: RF_ComponentLabel_s::{row,num_rows} and
RF_SingleComponent_s::row are obsolete but not removed yet.
2018-01-18 03:32:48 +03:00
|
|
|
user-specified serial number, the column of that component in
|
2002-10-01 18:20:26 +04:00
|
|
|
the RAID set, the redundancy level of the RAID set, a
|
|
|
|
.Sq modification counter ,
|
|
|
|
and whether the parity information (if any) on that
|
2002-10-01 17:40:23 +04:00
|
|
|
component is known to be correct.
|
|
|
|
Component labels are an integral part of the RAID set,
|
|
|
|
since they are used to ensure that components
|
2000-02-26 01:24:46 +03:00
|
|
|
are configured in the correct order, and used to keep track of other
|
2002-10-01 17:40:23 +04:00
|
|
|
vital information about the RAID set.
|
|
|
|
Component labels are also required for the auto-detection
|
|
|
|
and auto-configuration of RAID sets at boot time.
|
|
|
|
For a component label to be considered valid, that
|
2000-02-26 01:24:46 +03:00
|
|
|
particular component label must be in agreement with the other
|
2002-10-01 17:40:23 +04:00
|
|
|
component labels in the set.
|
|
|
|
For example, the serial number,
|
2001-11-16 13:25:42 +03:00
|
|
|
.Sq modification counter ,
|
implement 32-bit compat support for raidframe.
convert several raidframe ioctls to be bitsize idempotent so that
they work the same in 32 and 64 bit worlds, allowing netbsd32 to
configure and query raid properly. remove useless 'row' in a few
places. add COMPAT_80 and put the old ioctls there.
raidframeio.h:
RAIDFRAME_TEST_ACC
- remove, unused
RAIDFRAME_GET_COMPONENT_LABEL
- convert to label not pointer to label
RAIDFRAME_CHECK_RECON_STATUS_EXT
RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT
RAIDFRAME_CHECK_COPYBACK_STATUS_EXT
- convert to progress info not pointer to info
RAIDFRAME_GET_INFO
- version entirely.
raidframevar.h:
- rf_recon_req{} has row, flags and raidPtr removed (they're
not a useful part of this interface.)
- RF_Config_s{} and RF_DeviceConfig_s{} have numRow/rows removed.
- RF_RaidDisk_s{} is re-ordered slightly to fix alignment
padding - the actual data was already OK.
- InstallSpareTable() loses row argument
rf_compat32.c has code for RF_Config_s{} in 32 bit mode, used
by RAIDFRAME_CONFIGURE and RAIDFRAME_GET_INFO32.
rf_compat80.c has code for rf_recon_req{}, RF_RaidDisk_s{} and
RF_DeviceConfig_s{} to handle RAIDFRAME_FAIL_DISK,
RAIDFRAME_GET_COMPONENT_LABEL, RAIDFRAME_CHECK_RECON_STATUS_EXT,
RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT,
RAIDFRAME_CHECK_COPYBACK_STATUS_EXT, RAIDFRAME_GET_INFO.
move several of the per-ioctl code blocks into separate functions.
add rf_recon_req_internal{} to replace old usage of global
rf_recon_req{} that had unused void * in the structure, ruining
it's 32/64 bit ABI.
add missing case for RAIDFRAME_GET_INFO50.
adjust raid tests to use the new .conf format, and add a case to
test the old method as well.
raidctl:
deal with lack of 'row' members in a couple of places.
fail request no longer takes row.
handle "START array" sections with just "numCol numSpare", ie
no "numRow" specified. for now, generate old-style configuration
but update raidctl.8 to specify the new style (keeping reference
to the old style.)
note that: RF_ComponentLabel_s::{row,num_rows} and
RF_SingleComponent_s::row are obsolete but not removed yet.
2018-01-18 03:32:48 +03:00
|
|
|
and number of columns must all be in agreement.
|
2002-10-01 17:40:23 +04:00
|
|
|
If any of these are different, then the component is
|
|
|
|
not considered to be part of the set.
|
|
|
|
See
|
2000-02-26 01:24:46 +03:00
|
|
|
.Xr raid 4
|
|
|
|
for more information about component labels.
|
|
|
|
.Pp
|
|
|
|
Once the components have been identified, and the disks have
|
2001-11-16 13:25:42 +03:00
|
|
|
appropriate labels,
|
2002-10-01 18:20:26 +04:00
|
|
|
.Nm
|
2000-02-26 01:24:46 +03:00
|
|
|
is then used to configure the
|
2001-11-16 13:25:42 +03:00
|
|
|
.Xr raid 4
|
2002-10-01 17:40:23 +04:00
|
|
|
device.
|
2002-10-01 18:20:26 +04:00
|
|
|
To configure the device, a configuration file which looks something like:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
1998-11-13 16:16:46 +03:00
|
|
|
START array
|
implement 32-bit compat support for raidframe.
convert several raidframe ioctls to be bitsize idempotent so that
they work the same in 32 and 64 bit worlds, allowing netbsd32 to
configure and query raid properly. remove useless 'row' in a few
places. add COMPAT_80 and put the old ioctls there.
raidframeio.h:
RAIDFRAME_TEST_ACC
- remove, unused
RAIDFRAME_GET_COMPONENT_LABEL
- convert to label not pointer to label
RAIDFRAME_CHECK_RECON_STATUS_EXT
RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT
RAIDFRAME_CHECK_COPYBACK_STATUS_EXT
- convert to progress info not pointer to info
RAIDFRAME_GET_INFO
- version entirely.
raidframevar.h:
- rf_recon_req{} has row, flags and raidPtr removed (they're
not a useful part of this interface.)
- RF_Config_s{} and RF_DeviceConfig_s{} have numRow/rows removed.
- RF_RaidDisk_s{} is re-ordered slightly to fix alignment
padding - the actual data was already OK.
- InstallSpareTable() loses row argument
rf_compat32.c has code for RF_Config_s{} in 32 bit mode, used
by RAIDFRAME_CONFIGURE and RAIDFRAME_GET_INFO32.
rf_compat80.c has code for rf_recon_req{}, RF_RaidDisk_s{} and
RF_DeviceConfig_s{} to handle RAIDFRAME_FAIL_DISK,
RAIDFRAME_GET_COMPONENT_LABEL, RAIDFRAME_CHECK_RECON_STATUS_EXT,
RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT,
RAIDFRAME_CHECK_COPYBACK_STATUS_EXT, RAIDFRAME_GET_INFO.
move several of the per-ioctl code blocks into separate functions.
add rf_recon_req_internal{} to replace old usage of global
rf_recon_req{} that had unused void * in the structure, ruining
it's 32/64 bit ABI.
add missing case for RAIDFRAME_GET_INFO50.
adjust raid tests to use the new .conf format, and add a case to
test the old method as well.
raidctl:
deal with lack of 'row' members in a couple of places.
fail request no longer takes row.
handle "START array" sections with just "numCol numSpare", ie
no "numRow" specified. for now, generate old-style configuration
but update raidctl.8 to specify the new style (keeping reference
to the old style.)
note that: RF_ComponentLabel_s::{row,num_rows} and
RF_SingleComponent_s::row are obsolete but not removed yet.
2018-01-18 03:32:48 +03:00
|
|
|
# numCol numSpare
|
|
|
|
3 1
|
1998-11-13 16:16:46 +03:00
|
|
|
|
|
|
|
START disks
|
|
|
|
/dev/sd1e
|
|
|
|
/dev/sd2e
|
|
|
|
/dev/sd3e
|
|
|
|
|
|
|
|
START spare
|
|
|
|
/dev/sd4e
|
|
|
|
|
|
|
|
START layout
|
|
|
|
# sectPerSU SUsPerParityUnit SUsPerReconUnit RAID_level_5
|
|
|
|
32 1 1 5
|
|
|
|
|
|
|
|
START queue
|
|
|
|
fifo 100
|
|
|
|
.Ed
|
|
|
|
.Pp
|
2002-10-01 17:40:23 +04:00
|
|
|
is created in a file.
|
|
|
|
The above configuration file specifies a RAID 5
|
2002-10-01 18:20:26 +04:00
|
|
|
set consisting of the components
|
|
|
|
.Pa /dev/sd1e ,
|
|
|
|
.Pa /dev/sd2e ,
|
|
|
|
and
|
|
|
|
.Pa /dev/sd3e ,
|
|
|
|
with
|
|
|
|
.Pa /dev/sd4e
|
|
|
|
available as a
|
1998-11-13 16:16:46 +03:00
|
|
|
.Sq hot spare
|
2002-10-01 17:40:23 +04:00
|
|
|
in case one of the three main drives should fail.
|
|
|
|
A RAID 0 set would be specified in a similar way:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
2000-02-26 07:02:03 +03:00
|
|
|
START array
|
implement 32-bit compat support for raidframe.
convert several raidframe ioctls to be bitsize idempotent so that
they work the same in 32 and 64 bit worlds, allowing netbsd32 to
configure and query raid properly. remove useless 'row' in a few
places. add COMPAT_80 and put the old ioctls there.
raidframeio.h:
RAIDFRAME_TEST_ACC
- remove, unused
RAIDFRAME_GET_COMPONENT_LABEL
- convert to label not pointer to label
RAIDFRAME_CHECK_RECON_STATUS_EXT
RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT
RAIDFRAME_CHECK_COPYBACK_STATUS_EXT
- convert to progress info not pointer to info
RAIDFRAME_GET_INFO
- version entirely.
raidframevar.h:
- rf_recon_req{} has row, flags and raidPtr removed (they're
not a useful part of this interface.)
- RF_Config_s{} and RF_DeviceConfig_s{} have numRow/rows removed.
- RF_RaidDisk_s{} is re-ordered slightly to fix alignment
padding - the actual data was already OK.
- InstallSpareTable() loses row argument
rf_compat32.c has code for RF_Config_s{} in 32 bit mode, used
by RAIDFRAME_CONFIGURE and RAIDFRAME_GET_INFO32.
rf_compat80.c has code for rf_recon_req{}, RF_RaidDisk_s{} and
RF_DeviceConfig_s{} to handle RAIDFRAME_FAIL_DISK,
RAIDFRAME_GET_COMPONENT_LABEL, RAIDFRAME_CHECK_RECON_STATUS_EXT,
RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT,
RAIDFRAME_CHECK_COPYBACK_STATUS_EXT, RAIDFRAME_GET_INFO.
move several of the per-ioctl code blocks into separate functions.
add rf_recon_req_internal{} to replace old usage of global
rf_recon_req{} that had unused void * in the structure, ruining
it's 32/64 bit ABI.
add missing case for RAIDFRAME_GET_INFO50.
adjust raid tests to use the new .conf format, and add a case to
test the old method as well.
raidctl:
deal with lack of 'row' members in a couple of places.
fail request no longer takes row.
handle "START array" sections with just "numCol numSpare", ie
no "numRow" specified. for now, generate old-style configuration
but update raidctl.8 to specify the new style (keeping reference
to the old style.)
note that: RF_ComponentLabel_s::{row,num_rows} and
RF_SingleComponent_s::row are obsolete but not removed yet.
2018-01-18 03:32:48 +03:00
|
|
|
# numCol numSpare
|
|
|
|
4 0
|
2000-02-26 07:02:03 +03:00
|
|
|
|
|
|
|
START disks
|
|
|
|
/dev/sd10e
|
|
|
|
/dev/sd11e
|
|
|
|
/dev/sd12e
|
|
|
|
/dev/sd13e
|
|
|
|
|
|
|
|
START layout
|
|
|
|
# sectPerSU SUsPerParityUnit SUsPerReconUnit RAID_level_0
|
|
|
|
64 1 1 0
|
|
|
|
|
|
|
|
START queue
|
|
|
|
fifo 100
|
|
|
|
.Ed
|
|
|
|
.Pp
|
2002-10-01 18:20:26 +04:00
|
|
|
In this case, devices
|
|
|
|
.Pa /dev/sd10e ,
|
|
|
|
.Pa /dev/sd11e ,
|
|
|
|
.Pa /dev/sd12e ,
|
|
|
|
and
|
|
|
|
.Pa /dev/sd13e
|
2002-10-01 17:40:23 +04:00
|
|
|
are the components that make up this RAID set.
|
|
|
|
Note that there are no hot spares for a RAID 0 set,
|
|
|
|
since there is no way to recover data if any of the components fail.
|
2000-02-26 07:02:03 +03:00
|
|
|
.Pp
|
|
|
|
For a RAID 1 (mirror) set, the following configuration might be used:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
2000-02-26 07:02:03 +03:00
|
|
|
START array
|
implement 32-bit compat support for raidframe.
convert several raidframe ioctls to be bitsize idempotent so that
they work the same in 32 and 64 bit worlds, allowing netbsd32 to
configure and query raid properly. remove useless 'row' in a few
places. add COMPAT_80 and put the old ioctls there.
raidframeio.h:
RAIDFRAME_TEST_ACC
- remove, unused
RAIDFRAME_GET_COMPONENT_LABEL
- convert to label not pointer to label
RAIDFRAME_CHECK_RECON_STATUS_EXT
RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT
RAIDFRAME_CHECK_COPYBACK_STATUS_EXT
- convert to progress info not pointer to info
RAIDFRAME_GET_INFO
- version entirely.
raidframevar.h:
- rf_recon_req{} has row, flags and raidPtr removed (they're
not a useful part of this interface.)
- RF_Config_s{} and RF_DeviceConfig_s{} have numRow/rows removed.
- RF_RaidDisk_s{} is re-ordered slightly to fix alignment
padding - the actual data was already OK.
- InstallSpareTable() loses row argument
rf_compat32.c has code for RF_Config_s{} in 32 bit mode, used
by RAIDFRAME_CONFIGURE and RAIDFRAME_GET_INFO32.
rf_compat80.c has code for rf_recon_req{}, RF_RaidDisk_s{} and
RF_DeviceConfig_s{} to handle RAIDFRAME_FAIL_DISK,
RAIDFRAME_GET_COMPONENT_LABEL, RAIDFRAME_CHECK_RECON_STATUS_EXT,
RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT,
RAIDFRAME_CHECK_COPYBACK_STATUS_EXT, RAIDFRAME_GET_INFO.
move several of the per-ioctl code blocks into separate functions.
add rf_recon_req_internal{} to replace old usage of global
rf_recon_req{} that had unused void * in the structure, ruining
it's 32/64 bit ABI.
add missing case for RAIDFRAME_GET_INFO50.
adjust raid tests to use the new .conf format, and add a case to
test the old method as well.
raidctl:
deal with lack of 'row' members in a couple of places.
fail request no longer takes row.
handle "START array" sections with just "numCol numSpare", ie
no "numRow" specified. for now, generate old-style configuration
but update raidctl.8 to specify the new style (keeping reference
to the old style.)
note that: RF_ComponentLabel_s::{row,num_rows} and
RF_SingleComponent_s::row are obsolete but not removed yet.
2018-01-18 03:32:48 +03:00
|
|
|
# numCol numSpare
|
|
|
|
2 0
|
2000-02-26 07:02:03 +03:00
|
|
|
|
|
|
|
START disks
|
|
|
|
/dev/sd20e
|
|
|
|
/dev/sd21e
|
|
|
|
|
|
|
|
START layout
|
|
|
|
# sectPerSU SUsPerParityUnit SUsPerReconUnit RAID_level_1
|
|
|
|
128 1 1 1
|
|
|
|
|
|
|
|
START queue
|
|
|
|
fifo 100
|
|
|
|
.Ed
|
|
|
|
.Pp
|
2002-10-01 18:20:26 +04:00
|
|
|
In this case,
|
|
|
|
.Pa /dev/sd20e
|
|
|
|
and
|
|
|
|
.Pa /dev/sd21e
|
|
|
|
are the two components of the mirror set.
|
2002-10-01 17:40:23 +04:00
|
|
|
While no hot spares have been specified in this
|
2000-02-26 07:02:03 +03:00
|
|
|
configuration, they easily could be, just as they were specified in
|
2002-10-01 17:40:23 +04:00
|
|
|
the RAID 5 case above.
|
2002-10-01 18:20:26 +04:00
|
|
|
Note as well that RAID 1 sets are currently limited to only 2 components.
|
2002-10-01 17:40:23 +04:00
|
|
|
At present, n-way mirroring is not possible.
|
2000-02-26 07:02:03 +03:00
|
|
|
.Pp
|
2001-11-16 13:25:42 +03:00
|
|
|
The first time a RAID set is configured, the
|
1999-03-02 06:13:59 +03:00
|
|
|
.Fl C
|
2000-02-26 01:24:46 +03:00
|
|
|
option must be used:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
2000-02-26 01:24:46 +03:00
|
|
|
raidctl -C raid0.conf raid0
|
1999-03-02 06:13:59 +03:00
|
|
|
.Ed
|
|
|
|
.Pp
|
2001-11-16 13:25:42 +03:00
|
|
|
where
|
2002-10-01 18:20:26 +04:00
|
|
|
.Pa raid0.conf
|
2002-10-01 17:40:23 +04:00
|
|
|
is the name of the RAID configuration file.
|
|
|
|
The
|
1999-03-02 06:13:59 +03:00
|
|
|
.Fl C
|
|
|
|
forces the configuration to succeed, even if any of the component
|
2002-10-01 17:40:23 +04:00
|
|
|
labels are incorrect.
|
|
|
|
The
|
2000-02-26 07:02:03 +03:00
|
|
|
.Fl C
|
|
|
|
option should not be used lightly in
|
1999-03-02 06:13:59 +03:00
|
|
|
situations other than initial configurations, as if
|
|
|
|
the system is refusing to configure a RAID set, there is probably a
|
2002-10-01 17:40:23 +04:00
|
|
|
very good reason for it.
|
|
|
|
After the initial configuration is done (and
|
2001-11-16 13:25:42 +03:00
|
|
|
appropriate component labels are added with the
|
2000-02-26 07:02:03 +03:00
|
|
|
.Fl I
|
2000-02-26 01:24:46 +03:00
|
|
|
option) then raid0 can be configured normally with:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
2000-02-26 01:24:46 +03:00
|
|
|
raidctl -c raid0.conf raid0
|
|
|
|
.Ed
|
1999-03-02 06:13:59 +03:00
|
|
|
.Pp
|
2001-11-16 13:25:42 +03:00
|
|
|
When the RAID set is configured for the first time, it is
|
1999-03-02 06:13:59 +03:00
|
|
|
necessary to initialize the component labels, and to initialize the
|
2002-10-01 17:40:23 +04:00
|
|
|
parity on the RAID set.
|
|
|
|
Initializing the component labels is done with:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
1999-03-02 06:13:59 +03:00
|
|
|
raidctl -I 112341 raid0
|
|
|
|
.Ed
|
|
|
|
.Pp
|
2001-11-16 13:25:42 +03:00
|
|
|
where
|
1999-03-02 06:13:59 +03:00
|
|
|
.Sq 112341
|
2002-10-01 17:40:23 +04:00
|
|
|
is a user-specified serial number for the RAID set.
|
|
|
|
This initialization step is
|
2002-10-01 18:20:26 +04:00
|
|
|
.Em required
|
2002-10-01 17:40:23 +04:00
|
|
|
for all RAID sets.
|
|
|
|
As well, using different serial numbers between RAID sets is
|
2002-10-01 18:20:26 +04:00
|
|
|
.Em strongly encouraged ,
|
2000-02-26 07:02:03 +03:00
|
|
|
as using the same serial number for all RAID sets will only serve to
|
|
|
|
decrease the usefulness of the component label checking.
|
1999-03-02 06:13:59 +03:00
|
|
|
.Pp
|
2000-10-27 06:40:37 +04:00
|
|
|
Initializing the RAID set is done via the
|
|
|
|
.Fl i
|
2002-10-01 17:40:23 +04:00
|
|
|
option.
|
|
|
|
This initialization
|
2002-10-01 18:20:26 +04:00
|
|
|
.Em MUST
|
2001-11-16 13:25:42 +03:00
|
|
|
be done for
|
2002-10-01 18:20:26 +04:00
|
|
|
.Em all
|
2000-02-26 07:02:03 +03:00
|
|
|
RAID sets, since among other things it verifies that the parity (if
|
2002-10-01 17:40:23 +04:00
|
|
|
any) on the RAID set is correct.
|
|
|
|
Since this initialization may be quite time-consuming, the
|
2000-02-26 07:02:03 +03:00
|
|
|
.Fl v
|
2000-02-26 01:38:51 +03:00
|
|
|
option may be also used in conjunction with
|
2000-10-27 06:40:37 +04:00
|
|
|
.Fl i :
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
2000-10-27 06:40:37 +04:00
|
|
|
raidctl -iv raid0
|
|
|
|
.Ed
|
|
|
|
.Pp
|
2000-02-26 01:24:46 +03:00
|
|
|
This will give more verbose output on the
|
|
|
|
status of the initialization:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
2000-02-26 01:24:46 +03:00
|
|
|
Initiating re-write of parity
|
|
|
|
Parity Re-write status:
|
|
|
|
10% |**** | ETA: 06:03 /
|
|
|
|
.Ed
|
|
|
|
.Pp
|
2001-11-16 13:25:42 +03:00
|
|
|
The output provides a
|
2000-02-26 01:24:46 +03:00
|
|
|
.Sq Percent Complete
|
|
|
|
in both a numeric and graphical format, as well as an estimated time
|
|
|
|
to completion of the operation.
|
|
|
|
.Pp
|
|
|
|
Since it is the parity that provides the
|
2000-07-05 06:42:39 +04:00
|
|
|
.Sq redundancy
|
2002-10-01 18:20:26 +04:00
|
|
|
part of RAID, it is critical that the parity is correct as much as possible.
|
2002-10-01 17:40:23 +04:00
|
|
|
If the parity is not correct, then there is no
|
2000-02-25 02:52:46 +03:00
|
|
|
guarantee that data will not be lost if a component fails.
|
|
|
|
.Pp
|
2002-10-01 18:20:26 +04:00
|
|
|
Once the parity is known to be correct, it is then safe to perform
|
1999-03-06 14:57:20 +03:00
|
|
|
.Xr disklabel 8 ,
|
|
|
|
.Xr newfs 8 ,
|
1999-03-02 06:13:59 +03:00
|
|
|
or
|
|
|
|
.Xr fsck 8
|
2001-07-10 05:30:52 +04:00
|
|
|
on the device or its file systems, and then to mount the file systems
|
1999-03-02 06:13:59 +03:00
|
|
|
for use.
|
|
|
|
.Pp
|
2002-10-01 18:20:26 +04:00
|
|
|
Under certain circumstances (e.g., the additional component has not
|
2000-10-27 06:40:37 +04:00
|
|
|
arrived, or data is being migrated off of a disk destined to become a
|
2002-07-11 19:06:04 +04:00
|
|
|
component) it may be desirable to configure a RAID 1 set with only
|
2002-10-01 17:40:23 +04:00
|
|
|
a single component.
|
2004-05-24 04:08:04 +04:00
|
|
|
This can be achieved by using the word
|
|
|
|
.Dq absent
|
|
|
|
to indicate that a particular component is not present.
|
2002-10-01 17:40:23 +04:00
|
|
|
In the following:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
2000-10-27 06:40:37 +04:00
|
|
|
START array
|
implement 32-bit compat support for raidframe.
convert several raidframe ioctls to be bitsize idempotent so that
they work the same in 32 and 64 bit worlds, allowing netbsd32 to
configure and query raid properly. remove useless 'row' in a few
places. add COMPAT_80 and put the old ioctls there.
raidframeio.h:
RAIDFRAME_TEST_ACC
- remove, unused
RAIDFRAME_GET_COMPONENT_LABEL
- convert to label not pointer to label
RAIDFRAME_CHECK_RECON_STATUS_EXT
RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT
RAIDFRAME_CHECK_COPYBACK_STATUS_EXT
- convert to progress info not pointer to info
RAIDFRAME_GET_INFO
- version entirely.
raidframevar.h:
- rf_recon_req{} has row, flags and raidPtr removed (they're
not a useful part of this interface.)
- RF_Config_s{} and RF_DeviceConfig_s{} have numRow/rows removed.
- RF_RaidDisk_s{} is re-ordered slightly to fix alignment
padding - the actual data was already OK.
- InstallSpareTable() loses row argument
rf_compat32.c has code for RF_Config_s{} in 32 bit mode, used
by RAIDFRAME_CONFIGURE and RAIDFRAME_GET_INFO32.
rf_compat80.c has code for rf_recon_req{}, RF_RaidDisk_s{} and
RF_DeviceConfig_s{} to handle RAIDFRAME_FAIL_DISK,
RAIDFRAME_GET_COMPONENT_LABEL, RAIDFRAME_CHECK_RECON_STATUS_EXT,
RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT,
RAIDFRAME_CHECK_COPYBACK_STATUS_EXT, RAIDFRAME_GET_INFO.
move several of the per-ioctl code blocks into separate functions.
add rf_recon_req_internal{} to replace old usage of global
rf_recon_req{} that had unused void * in the structure, ruining
it's 32/64 bit ABI.
add missing case for RAIDFRAME_GET_INFO50.
adjust raid tests to use the new .conf format, and add a case to
test the old method as well.
raidctl:
deal with lack of 'row' members in a couple of places.
fail request no longer takes row.
handle "START array" sections with just "numCol numSpare", ie
no "numRow" specified. for now, generate old-style configuration
but update raidctl.8 to specify the new style (keeping reference
to the old style.)
note that: RF_ComponentLabel_s::{row,num_rows} and
RF_SingleComponent_s::row are obsolete but not removed yet.
2018-01-18 03:32:48 +03:00
|
|
|
# numCol numSpare
|
|
|
|
2 0
|
2000-10-27 06:40:37 +04:00
|
|
|
|
|
|
|
START disks
|
2004-05-23 00:58:04 +04:00
|
|
|
absent
|
2000-10-27 06:40:37 +04:00
|
|
|
/dev/sd0e
|
|
|
|
|
|
|
|
START layout
|
|
|
|
# sectPerSU SUsPerParityUnit SUsPerReconUnit RAID_level_1
|
|
|
|
128 1 1 1
|
|
|
|
|
|
|
|
START queue
|
|
|
|
fifo 100
|
|
|
|
.Ed
|
|
|
|
.Pp
|
2002-10-01 18:20:26 +04:00
|
|
|
.Pa /dev/sd0e
|
|
|
|
is the real component, and will be the second disk of a RAID 1 set.
|
2004-05-23 00:58:04 +04:00
|
|
|
The first component is simply marked as being absent.
|
2001-11-16 13:25:42 +03:00
|
|
|
Configuration (using
|
2000-10-27 06:40:37 +04:00
|
|
|
.Fl C
|
2001-11-16 13:25:42 +03:00
|
|
|
and
|
2000-10-27 06:40:37 +04:00
|
|
|
.Fl I Ar 12345
|
|
|
|
as above) proceeds normally, but initialization of the RAID set will
|
2002-10-01 17:40:23 +04:00
|
|
|
have to wait until all physical components are present.
|
|
|
|
After configuration, this set can be used normally, but will be operating
|
|
|
|
in degraded mode.
|
|
|
|
Once a second physical component is obtained, it can be hot-added,
|
|
|
|
the existing data mirrored, and normal operation resumed.
|
2007-08-06 23:44:16 +04:00
|
|
|
.Pp
|
|
|
|
The size of the resulting RAID set will depend on the number of data
|
|
|
|
components in the set.
|
2008-08-29 01:24:30 +04:00
|
|
|
Space is automatically reserved for the component labels, and
|
2007-08-06 23:44:16 +04:00
|
|
|
the actual amount of space used
|
|
|
|
for data on a component will be rounded down to the largest possible
|
|
|
|
multiple of the sectors per stripe unit (sectPerSU) value.
|
|
|
|
Thus, the amount of space provided by the RAID set will be less
|
|
|
|
than the sum of the size of the components.
|
2000-08-10 19:14:14 +04:00
|
|
|
.Ss Maintenance of the RAID set
|
1999-08-10 22:21:39 +04:00
|
|
|
After the parity has been initialized for the first time, the command:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
1999-08-10 22:21:39 +04:00
|
|
|
raidctl -p raid0
|
|
|
|
.Ed
|
|
|
|
.Pp
|
2002-10-01 17:40:23 +04:00
|
|
|
can be used to check the current status of the parity.
|
|
|
|
To check the parity and rebuild it necessary (for example,
|
|
|
|
after an unclean shutdown) the command:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
1999-08-10 22:21:39 +04:00
|
|
|
raidctl -P raid0
|
|
|
|
.Ed
|
|
|
|
.Pp
|
2002-10-01 17:40:23 +04:00
|
|
|
is used.
|
|
|
|
Note that re-writing the parity can be done while
|
2002-10-01 18:20:26 +04:00
|
|
|
other operations on the RAID set are taking place (e.g., while doing a
|
1999-08-10 22:21:39 +04:00
|
|
|
.Xr fsck 8
|
2002-10-01 17:40:23 +04:00
|
|
|
on a file system on the RAID set).
|
2002-10-01 18:20:26 +04:00
|
|
|
However: for maximum effectiveness of the RAID set, the parity should be
|
|
|
|
known to be correct before any data on the set is modified.
|
1999-08-10 22:21:39 +04:00
|
|
|
.Pp
|
1999-03-02 06:13:59 +03:00
|
|
|
To see how the RAID set is doing, the following command can be used to
|
|
|
|
show the RAID set's status:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
1998-11-13 16:16:46 +03:00
|
|
|
raidctl -s raid0
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
The output will look something like:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
1998-11-13 16:16:46 +03:00
|
|
|
Components:
|
|
|
|
/dev/sd1e: optimal
|
|
|
|
/dev/sd2e: optimal
|
|
|
|
/dev/sd3e: optimal
|
|
|
|
Spares:
|
1999-03-02 06:13:59 +03:00
|
|
|
/dev/sd4e: spare
|
2000-02-26 01:24:46 +03:00
|
|
|
Component label for /dev/sd1e:
|
|
|
|
Row: 0 Column: 0 Num Rows: 1 Num Columns: 3
|
|
|
|
Version: 2 Serial Number: 13432 Mod Counter: 65
|
|
|
|
Clean: No Status: 0
|
|
|
|
sectPerSU: 32 SUsPerPU: 1 SUsPerRU: 1
|
|
|
|
RAID Level: 5 blocksize: 512 numBlocks: 1799936
|
|
|
|
Autoconfig: No
|
|
|
|
Last configured as: raid0
|
|
|
|
Component label for /dev/sd2e:
|
|
|
|
Row: 0 Column: 1 Num Rows: 1 Num Columns: 3
|
|
|
|
Version: 2 Serial Number: 13432 Mod Counter: 65
|
|
|
|
Clean: No Status: 0
|
|
|
|
sectPerSU: 32 SUsPerPU: 1 SUsPerRU: 1
|
|
|
|
RAID Level: 5 blocksize: 512 numBlocks: 1799936
|
|
|
|
Autoconfig: No
|
|
|
|
Last configured as: raid0
|
|
|
|
Component label for /dev/sd3e:
|
|
|
|
Row: 0 Column: 2 Num Rows: 1 Num Columns: 3
|
|
|
|
Version: 2 Serial Number: 13432 Mod Counter: 65
|
|
|
|
Clean: No Status: 0
|
|
|
|
sectPerSU: 32 SUsPerPU: 1 SUsPerRU: 1
|
|
|
|
RAID Level: 5 blocksize: 512 numBlocks: 1799936
|
|
|
|
Autoconfig: No
|
|
|
|
Last configured as: raid0
|
|
|
|
Parity status: clean
|
|
|
|
Reconstruction is 100% complete.
|
|
|
|
Parity Re-write is 100% complete.
|
|
|
|
Copyback is 100% complete.
|
1998-11-13 16:16:46 +03:00
|
|
|
.Ed
|
|
|
|
.Pp
|
2002-10-01 17:40:23 +04:00
|
|
|
This indicates that all is well with the RAID set.
|
|
|
|
Of importance here are the component lines which read
|
2000-02-26 01:24:46 +03:00
|
|
|
.Sq optimal ,
|
2001-11-16 13:25:42 +03:00
|
|
|
and the
|
2000-02-26 01:24:46 +03:00
|
|
|
.Sq Parity status
|
2005-02-28 23:37:14 +03:00
|
|
|
line.
|
|
|
|
.Sq Parity status: clean
|
|
|
|
indicates that the parity is up-to-date for this RAID set,
|
|
|
|
whether or not the RAID set is in redundant or degraded mode.
|
|
|
|
.Sq Parity status: DIRTY
|
|
|
|
indicates that it is not known if the parity information is
|
|
|
|
consistent with the data, and that the parity information needs
|
|
|
|
to be checked.
|
2002-10-01 17:40:23 +04:00
|
|
|
Note that if there are file systems open on the RAID set,
|
|
|
|
the individual components will not be
|
2000-02-26 01:24:46 +03:00
|
|
|
.Sq clean
|
|
|
|
but the set as a whole can still be clean.
|
1999-03-02 06:13:59 +03:00
|
|
|
.Pp
|
2002-10-01 18:20:26 +04:00
|
|
|
To check the component label of
|
|
|
|
.Pa /dev/sd1e ,
|
|
|
|
the following is used:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
1999-03-02 06:13:59 +03:00
|
|
|
raidctl -g /dev/sd1e raid0
|
1998-11-13 16:16:46 +03:00
|
|
|
.Ed
|
|
|
|
.Pp
|
1999-03-02 06:13:59 +03:00
|
|
|
The output of this command will look something like:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
2000-02-26 01:24:46 +03:00
|
|
|
Component label for /dev/sd1e:
|
|
|
|
Row: 0 Column: 0 Num Rows: 1 Num Columns: 3
|
|
|
|
Version: 2 Serial Number: 13432 Mod Counter: 65
|
|
|
|
Clean: No Status: 0
|
|
|
|
sectPerSU: 32 SUsPerPU: 1 SUsPerRU: 1
|
|
|
|
RAID Level: 5 blocksize: 512 numBlocks: 1799936
|
|
|
|
Autoconfig: No
|
|
|
|
Last configured as: raid0
|
1999-03-02 06:13:59 +03:00
|
|
|
.Ed
|
2000-08-10 19:14:14 +04:00
|
|
|
.Ss Dealing with Component Failures
|
1998-11-13 16:16:46 +03:00
|
|
|
If for some reason
|
|
|
|
(perhaps to test reconstruction) it is necessary to pretend a drive
|
|
|
|
has failed, the following will perform that function:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
1998-11-13 16:16:46 +03:00
|
|
|
raidctl -f /dev/sd2e raid0
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
The system will then be performing all operations in degraded mode,
|
1999-11-20 01:48:01 +03:00
|
|
|
where missing data is re-computed from existing data and the parity.
|
2000-02-26 01:24:46 +03:00
|
|
|
In this case, obtaining the status of raid0 will return (in part):
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
1998-11-13 16:16:46 +03:00
|
|
|
Components:
|
|
|
|
/dev/sd1e: optimal
|
|
|
|
/dev/sd2e: failed
|
|
|
|
/dev/sd3e: optimal
|
|
|
|
Spares:
|
1999-03-02 06:13:59 +03:00
|
|
|
/dev/sd4e: spare
|
1998-11-13 16:16:46 +03:00
|
|
|
.Ed
|
|
|
|
.Pp
|
2001-11-16 13:25:42 +03:00
|
|
|
Note that with the use of
|
1998-11-13 16:16:46 +03:00
|
|
|
.Fl f
|
2002-10-01 17:40:23 +04:00
|
|
|
a reconstruction has not been started.
|
|
|
|
To both fail the disk and start a reconstruction, the
|
1998-11-13 16:16:46 +03:00
|
|
|
.Fl F
|
1999-03-02 06:13:59 +03:00
|
|
|
option must be used:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
1999-03-02 06:13:59 +03:00
|
|
|
raidctl -F /dev/sd2e raid0
|
|
|
|
.Ed
|
|
|
|
.Pp
|
2001-11-16 13:25:42 +03:00
|
|
|
The
|
1998-11-13 16:16:46 +03:00
|
|
|
.Fl f
|
|
|
|
option may be used first, and then the
|
|
|
|
.Fl F
|
2001-11-16 13:25:42 +03:00
|
|
|
option used later, on the same disk, if desired.
|
1998-11-13 16:16:46 +03:00
|
|
|
Immediately after the reconstruction is started, the status will report:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
1998-11-13 16:16:46 +03:00
|
|
|
Components:
|
|
|
|
/dev/sd1e: optimal
|
|
|
|
/dev/sd2e: reconstructing
|
|
|
|
/dev/sd3e: optimal
|
|
|
|
Spares:
|
1999-03-02 06:13:59 +03:00
|
|
|
/dev/sd4e: used_spare
|
2000-02-26 01:24:46 +03:00
|
|
|
[...]
|
|
|
|
Parity status: clean
|
|
|
|
Reconstruction is 10% complete.
|
|
|
|
Parity Re-write is 100% complete.
|
|
|
|
Copyback is 100% complete.
|
1998-11-13 16:16:46 +03:00
|
|
|
.Ed
|
|
|
|
.Pp
|
2002-10-01 17:40:23 +04:00
|
|
|
This indicates that a reconstruction is in progress.
|
|
|
|
To find out how the reconstruction is progressing the
|
1999-03-02 06:13:59 +03:00
|
|
|
.Fl S
|
2002-10-01 17:40:23 +04:00
|
|
|
option may be used.
|
|
|
|
This will indicate the progress in terms of the
|
|
|
|
percentage of the reconstruction that is completed.
|
|
|
|
When the reconstruction is finished the
|
1998-11-13 16:16:46 +03:00
|
|
|
.Fl s
|
|
|
|
option will show:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
1998-11-13 16:16:46 +03:00
|
|
|
Components:
|
|
|
|
/dev/sd1e: optimal
|
|
|
|
/dev/sd2e: spared
|
|
|
|
/dev/sd3e: optimal
|
|
|
|
Spares:
|
1999-03-02 06:13:59 +03:00
|
|
|
/dev/sd4e: used_spare
|
2000-02-26 01:24:46 +03:00
|
|
|
[...]
|
|
|
|
Parity status: clean
|
|
|
|
Reconstruction is 100% complete.
|
|
|
|
Parity Re-write is 100% complete.
|
|
|
|
Copyback is 100% complete.
|
1998-11-13 16:16:46 +03:00
|
|
|
.Ed
|
|
|
|
.Pp
|
2002-10-01 17:40:23 +04:00
|
|
|
At this point there are at least two options.
|
2002-10-01 18:20:26 +04:00
|
|
|
First, if
|
|
|
|
.Pa /dev/sd2e
|
|
|
|
is known to be good (i.e., the failure was either caused by
|
1998-11-13 16:16:46 +03:00
|
|
|
.Fl f
|
2001-11-16 13:25:42 +03:00
|
|
|
or
|
1998-11-13 16:16:46 +03:00
|
|
|
.Fl F ,
|
2001-11-16 13:25:42 +03:00
|
|
|
or the failed disk was replaced), then a copyback of the data can
|
|
|
|
be initiated with the
|
1999-03-02 06:13:59 +03:00
|
|
|
.Fl B
|
2002-10-01 17:40:23 +04:00
|
|
|
option.
|
|
|
|
In this example, this would copy the entire contents of
|
2002-10-01 18:20:26 +04:00
|
|
|
.Pa /dev/sd4e
|
|
|
|
to
|
|
|
|
.Pa /dev/sd2e .
|
2002-10-01 17:40:23 +04:00
|
|
|
Once the copyback procedure is complete, the
|
2000-02-26 01:24:46 +03:00
|
|
|
status of the device would be (in part):
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
1998-11-13 16:16:46 +03:00
|
|
|
Components:
|
|
|
|
/dev/sd1e: optimal
|
|
|
|
/dev/sd2e: optimal
|
|
|
|
/dev/sd3e: optimal
|
|
|
|
Spares:
|
1999-03-02 06:13:59 +03:00
|
|
|
/dev/sd4e: spare
|
1998-11-13 16:16:46 +03:00
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
and the system is back to normal operation.
|
|
|
|
.Pp
|
2002-10-01 18:20:26 +04:00
|
|
|
The second option after the reconstruction is to simply use
|
|
|
|
.Pa /dev/sd4e
|
|
|
|
in place of
|
|
|
|
.Pa /dev/sd2e
|
|
|
|
in the configuration file.
|
2002-10-01 17:40:23 +04:00
|
|
|
For example, the configuration file (in part) might now look like:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
1998-11-13 16:16:46 +03:00
|
|
|
START array
|
implement 32-bit compat support for raidframe.
convert several raidframe ioctls to be bitsize idempotent so that
they work the same in 32 and 64 bit worlds, allowing netbsd32 to
configure and query raid properly. remove useless 'row' in a few
places. add COMPAT_80 and put the old ioctls there.
raidframeio.h:
RAIDFRAME_TEST_ACC
- remove, unused
RAIDFRAME_GET_COMPONENT_LABEL
- convert to label not pointer to label
RAIDFRAME_CHECK_RECON_STATUS_EXT
RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT
RAIDFRAME_CHECK_COPYBACK_STATUS_EXT
- convert to progress info not pointer to info
RAIDFRAME_GET_INFO
- version entirely.
raidframevar.h:
- rf_recon_req{} has row, flags and raidPtr removed (they're
not a useful part of this interface.)
- RF_Config_s{} and RF_DeviceConfig_s{} have numRow/rows removed.
- RF_RaidDisk_s{} is re-ordered slightly to fix alignment
padding - the actual data was already OK.
- InstallSpareTable() loses row argument
rf_compat32.c has code for RF_Config_s{} in 32 bit mode, used
by RAIDFRAME_CONFIGURE and RAIDFRAME_GET_INFO32.
rf_compat80.c has code for rf_recon_req{}, RF_RaidDisk_s{} and
RF_DeviceConfig_s{} to handle RAIDFRAME_FAIL_DISK,
RAIDFRAME_GET_COMPONENT_LABEL, RAIDFRAME_CHECK_RECON_STATUS_EXT,
RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT,
RAIDFRAME_CHECK_COPYBACK_STATUS_EXT, RAIDFRAME_GET_INFO.
move several of the per-ioctl code blocks into separate functions.
add rf_recon_req_internal{} to replace old usage of global
rf_recon_req{} that had unused void * in the structure, ruining
it's 32/64 bit ABI.
add missing case for RAIDFRAME_GET_INFO50.
adjust raid tests to use the new .conf format, and add a case to
test the old method as well.
raidctl:
deal with lack of 'row' members in a couple of places.
fail request no longer takes row.
handle "START array" sections with just "numCol numSpare", ie
no "numRow" specified. for now, generate old-style configuration
but update raidctl.8 to specify the new style (keeping reference
to the old style.)
note that: RF_ComponentLabel_s::{row,num_rows} and
RF_SingleComponent_s::row are obsolete but not removed yet.
2018-01-18 03:32:48 +03:00
|
|
|
3 0
|
1998-11-13 16:16:46 +03:00
|
|
|
|
2010-01-27 11:56:08 +03:00
|
|
|
START disks
|
1998-11-13 16:16:46 +03:00
|
|
|
/dev/sd1e
|
|
|
|
/dev/sd4e
|
|
|
|
/dev/sd3e
|
|
|
|
.Ed
|
|
|
|
.Pp
|
2002-10-01 18:20:26 +04:00
|
|
|
This can be done as
|
|
|
|
.Pa /dev/sd4e
|
|
|
|
is completely interchangeable with
|
|
|
|
.Pa /dev/sd2e
|
|
|
|
at this point.
|
2002-10-01 17:40:23 +04:00
|
|
|
Note that extreme care must be taken when
|
|
|
|
changing the order of the drives in a configuration.
|
|
|
|
This is one of the few instances where the devices and/or
|
|
|
|
their orderings can be changed without loss of data!
|
|
|
|
In general, the ordering of components in a configuration file should
|
2002-10-01 18:20:26 +04:00
|
|
|
.Em never
|
1998-11-13 16:16:46 +03:00
|
|
|
be changed.
|
1999-03-02 06:13:59 +03:00
|
|
|
.Pp
|
|
|
|
If a component fails and there are no hot spares
|
2000-02-26 01:24:46 +03:00
|
|
|
available on-line, the status of the RAID set might (in part) look like:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
1999-03-02 06:13:59 +03:00
|
|
|
Components:
|
|
|
|
/dev/sd1e: optimal
|
|
|
|
/dev/sd2e: failed
|
|
|
|
/dev/sd3e: optimal
|
|
|
|
No spares.
|
|
|
|
.Ed
|
|
|
|
.Pp
|
2002-10-01 17:40:23 +04:00
|
|
|
In this case there are a number of options.
|
|
|
|
The first option is to add a hot spare using:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
1999-03-02 06:13:59 +03:00
|
|
|
raidctl -a /dev/sd4e raid0
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
After the hot add, the status would then be:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
1999-03-02 06:13:59 +03:00
|
|
|
Components:
|
|
|
|
/dev/sd1e: optimal
|
|
|
|
/dev/sd2e: failed
|
|
|
|
/dev/sd3e: optimal
|
|
|
|
Spares:
|
|
|
|
/dev/sd4e: spare
|
|
|
|
.Ed
|
|
|
|
.Pp
|
2001-11-16 13:25:42 +03:00
|
|
|
Reconstruction could then take place using
|
1999-03-02 06:13:59 +03:00
|
|
|
.Fl F
|
|
|
|
as describe above.
|
|
|
|
.Pp
|
2002-10-01 18:20:26 +04:00
|
|
|
A second option is to rebuild directly onto
|
|
|
|
.Pa /dev/sd2e .
|
|
|
|
Once the disk containing
|
|
|
|
.Pa /dev/sd2e
|
|
|
|
has been replaced, one can simply use:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
1999-03-02 06:13:59 +03:00
|
|
|
raidctl -R /dev/sd2e raid0
|
|
|
|
.Ed
|
|
|
|
.Pp
|
2002-10-01 18:20:26 +04:00
|
|
|
to rebuild the
|
|
|
|
.Pa /dev/sd2e
|
|
|
|
component.
|
2002-10-01 17:40:23 +04:00
|
|
|
As the rebuilding is in progress, the status will be:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
1999-03-02 06:13:59 +03:00
|
|
|
Components:
|
|
|
|
/dev/sd1e: optimal
|
|
|
|
/dev/sd2e: reconstructing
|
|
|
|
/dev/sd3e: optimal
|
|
|
|
No spares.
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
and when completed, will be:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
1999-03-02 06:13:59 +03:00
|
|
|
Components:
|
|
|
|
/dev/sd1e: optimal
|
|
|
|
/dev/sd2e: optimal
|
|
|
|
/dev/sd3e: optimal
|
|
|
|
No spares.
|
|
|
|
.Ed
|
|
|
|
.Pp
|
2000-10-27 06:40:37 +04:00
|
|
|
In circumstances where a particular component is completely
|
|
|
|
unavailable after a reboot, a special component name will be used to
|
2002-10-01 17:40:23 +04:00
|
|
|
indicate the missing component.
|
|
|
|
For example:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
2000-10-27 06:40:37 +04:00
|
|
|
Components:
|
|
|
|
/dev/sd2e: optimal
|
|
|
|
component1: failed
|
|
|
|
No spares.
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
indicates that the second component of this RAID set was not detected
|
2002-10-01 17:40:23 +04:00
|
|
|
at all by the auto-configuration code.
|
|
|
|
The name
|
2000-10-27 06:40:37 +04:00
|
|
|
.Sq component1
|
2002-10-01 17:40:23 +04:00
|
|
|
can be used anywhere a normal component name would be used.
|
|
|
|
For example, to add a hot spare to the above set, and rebuild to that hot
|
2000-10-27 06:40:37 +04:00
|
|
|
spare, the following could be done:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
2000-10-27 06:40:37 +04:00
|
|
|
raidctl -a /dev/sd3e raid0
|
|
|
|
raidctl -F component1 raid0
|
|
|
|
.Ed
|
|
|
|
.Pp
|
2001-11-16 13:25:42 +03:00
|
|
|
at which point the data missing from
|
|
|
|
.Sq component1
|
2002-10-01 18:20:26 +04:00
|
|
|
would be reconstructed onto
|
|
|
|
.Pa /dev/sd3e .
|
2002-01-20 05:30:11 +03:00
|
|
|
.Pp
|
|
|
|
When more than one component is marked as
|
|
|
|
.Sq failed
|
2002-10-01 18:20:26 +04:00
|
|
|
due to a non-component hardware failure (e.g., loss of power to two
|
2002-01-20 05:30:11 +03:00
|
|
|
components, adapter problems, termination problems, or cabling issues) it
|
2002-10-01 17:40:23 +04:00
|
|
|
is quite possible to recover the data on the RAID set.
|
|
|
|
The first thing to be aware of is that the first disk to fail will
|
|
|
|
almost certainly be out-of-sync with the remainder of the array.
|
|
|
|
If any IO was performed between the time the first component is considered
|
2002-01-20 05:30:11 +03:00
|
|
|
.Sq failed
|
|
|
|
and when the second component is considered
|
|
|
|
.Sq failed ,
|
|
|
|
then the first component to fail will
|
2002-10-01 18:20:26 +04:00
|
|
|
.Em not
|
2002-10-01 17:40:23 +04:00
|
|
|
contain correct data, and should be ignored.
|
|
|
|
When the second component is marked as failed, however, the RAID device will
|
|
|
|
(currently) panic the system.
|
|
|
|
At this point the data on the RAID set
|
2002-01-20 05:30:11 +03:00
|
|
|
(not including the first failed component) is still self consistent,
|
|
|
|
and will be in no worse state of repair than had the power gone out in
|
2002-11-17 01:49:48 +03:00
|
|
|
the middle of a write to a file system on a non-RAID device.
|
2002-10-01 18:20:26 +04:00
|
|
|
The problem, however, is that the component labels may now have 3 different
|
|
|
|
.Sq modification counters
|
|
|
|
(one value on the first component that failed, one value on the second
|
|
|
|
component that failed, and a third value on the remaining components).
|
2002-10-01 17:40:23 +04:00
|
|
|
In such a situation, the RAID set will not autoconfigure,
|
|
|
|
and can only be forcibly re-configured
|
2002-01-21 14:40:20 +03:00
|
|
|
with the
|
2002-01-20 05:30:11 +03:00
|
|
|
.Fl C
|
2002-10-01 17:40:23 +04:00
|
|
|
option.
|
|
|
|
To recover the RAID set, one must first remedy whatever physical
|
|
|
|
problem caused the multiple-component failure.
|
|
|
|
After that is done, the RAID set can be restored by forcibly
|
|
|
|
configuring the raid set
|
2002-10-01 18:20:26 +04:00
|
|
|
.Em without
|
2002-10-01 17:40:23 +04:00
|
|
|
the component that failed first.
|
2002-10-01 18:20:26 +04:00
|
|
|
For example, if
|
|
|
|
.Pa /dev/sd1e
|
|
|
|
and
|
|
|
|
.Pa /dev/sd2e
|
|
|
|
fail (in that order) in a RAID set of the following configuration:
|
2002-01-20 05:30:11 +03:00
|
|
|
.Bd -literal -offset indent
|
|
|
|
START array
|
implement 32-bit compat support for raidframe.
convert several raidframe ioctls to be bitsize idempotent so that
they work the same in 32 and 64 bit worlds, allowing netbsd32 to
configure and query raid properly. remove useless 'row' in a few
places. add COMPAT_80 and put the old ioctls there.
raidframeio.h:
RAIDFRAME_TEST_ACC
- remove, unused
RAIDFRAME_GET_COMPONENT_LABEL
- convert to label not pointer to label
RAIDFRAME_CHECK_RECON_STATUS_EXT
RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT
RAIDFRAME_CHECK_COPYBACK_STATUS_EXT
- convert to progress info not pointer to info
RAIDFRAME_GET_INFO
- version entirely.
raidframevar.h:
- rf_recon_req{} has row, flags and raidPtr removed (they're
not a useful part of this interface.)
- RF_Config_s{} and RF_DeviceConfig_s{} have numRow/rows removed.
- RF_RaidDisk_s{} is re-ordered slightly to fix alignment
padding - the actual data was already OK.
- InstallSpareTable() loses row argument
rf_compat32.c has code for RF_Config_s{} in 32 bit mode, used
by RAIDFRAME_CONFIGURE and RAIDFRAME_GET_INFO32.
rf_compat80.c has code for rf_recon_req{}, RF_RaidDisk_s{} and
RF_DeviceConfig_s{} to handle RAIDFRAME_FAIL_DISK,
RAIDFRAME_GET_COMPONENT_LABEL, RAIDFRAME_CHECK_RECON_STATUS_EXT,
RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT,
RAIDFRAME_CHECK_COPYBACK_STATUS_EXT, RAIDFRAME_GET_INFO.
move several of the per-ioctl code blocks into separate functions.
add rf_recon_req_internal{} to replace old usage of global
rf_recon_req{} that had unused void * in the structure, ruining
it's 32/64 bit ABI.
add missing case for RAIDFRAME_GET_INFO50.
adjust raid tests to use the new .conf format, and add a case to
test the old method as well.
raidctl:
deal with lack of 'row' members in a couple of places.
fail request no longer takes row.
handle "START array" sections with just "numCol numSpare", ie
no "numRow" specified. for now, generate old-style configuration
but update raidctl.8 to specify the new style (keeping reference
to the old style.)
note that: RF_ComponentLabel_s::{row,num_rows} and
RF_SingleComponent_s::row are obsolete but not removed yet.
2018-01-18 03:32:48 +03:00
|
|
|
4 0
|
2002-01-20 05:30:11 +03:00
|
|
|
|
2010-01-27 11:56:08 +03:00
|
|
|
START disks
|
2002-01-20 05:30:11 +03:00
|
|
|
/dev/sd1e
|
|
|
|
/dev/sd2e
|
|
|
|
/dev/sd3e
|
|
|
|
/dev/sd4e
|
|
|
|
|
|
|
|
START layout
|
|
|
|
# sectPerSU SUsPerParityUnit SUsPerReconUnit RAID_level_5
|
|
|
|
64 1 1 5
|
|
|
|
|
|
|
|
START queue
|
|
|
|
fifo 100
|
|
|
|
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
then the following configuration (say "recover_raid0.conf")
|
|
|
|
.Bd -literal -offset indent
|
|
|
|
START array
|
implement 32-bit compat support for raidframe.
convert several raidframe ioctls to be bitsize idempotent so that
they work the same in 32 and 64 bit worlds, allowing netbsd32 to
configure and query raid properly. remove useless 'row' in a few
places. add COMPAT_80 and put the old ioctls there.
raidframeio.h:
RAIDFRAME_TEST_ACC
- remove, unused
RAIDFRAME_GET_COMPONENT_LABEL
- convert to label not pointer to label
RAIDFRAME_CHECK_RECON_STATUS_EXT
RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT
RAIDFRAME_CHECK_COPYBACK_STATUS_EXT
- convert to progress info not pointer to info
RAIDFRAME_GET_INFO
- version entirely.
raidframevar.h:
- rf_recon_req{} has row, flags and raidPtr removed (they're
not a useful part of this interface.)
- RF_Config_s{} and RF_DeviceConfig_s{} have numRow/rows removed.
- RF_RaidDisk_s{} is re-ordered slightly to fix alignment
padding - the actual data was already OK.
- InstallSpareTable() loses row argument
rf_compat32.c has code for RF_Config_s{} in 32 bit mode, used
by RAIDFRAME_CONFIGURE and RAIDFRAME_GET_INFO32.
rf_compat80.c has code for rf_recon_req{}, RF_RaidDisk_s{} and
RF_DeviceConfig_s{} to handle RAIDFRAME_FAIL_DISK,
RAIDFRAME_GET_COMPONENT_LABEL, RAIDFRAME_CHECK_RECON_STATUS_EXT,
RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT,
RAIDFRAME_CHECK_COPYBACK_STATUS_EXT, RAIDFRAME_GET_INFO.
move several of the per-ioctl code blocks into separate functions.
add rf_recon_req_internal{} to replace old usage of global
rf_recon_req{} that had unused void * in the structure, ruining
it's 32/64 bit ABI.
add missing case for RAIDFRAME_GET_INFO50.
adjust raid tests to use the new .conf format, and add a case to
test the old method as well.
raidctl:
deal with lack of 'row' members in a couple of places.
fail request no longer takes row.
handle "START array" sections with just "numCol numSpare", ie
no "numRow" specified. for now, generate old-style configuration
but update raidctl.8 to specify the new style (keeping reference
to the old style.)
note that: RF_ComponentLabel_s::{row,num_rows} and
RF_SingleComponent_s::row are obsolete but not removed yet.
2018-01-18 03:32:48 +03:00
|
|
|
4 0
|
2002-01-20 05:30:11 +03:00
|
|
|
|
2010-01-27 11:56:08 +03:00
|
|
|
START disks
|
2008-08-19 21:38:46 +04:00
|
|
|
absent
|
2002-01-20 05:30:11 +03:00
|
|
|
/dev/sd2e
|
|
|
|
/dev/sd3e
|
|
|
|
/dev/sd4e
|
|
|
|
|
|
|
|
START layout
|
|
|
|
# sectPerSU SUsPerParityUnit SUsPerReconUnit RAID_level_5
|
|
|
|
64 1 1 5
|
|
|
|
|
|
|
|
START queue
|
|
|
|
fifo 100
|
|
|
|
.Ed
|
|
|
|
.Pp
|
2008-08-19 21:38:46 +04:00
|
|
|
can be used with
|
2002-01-20 05:30:11 +03:00
|
|
|
.Bd -literal -offset indent
|
|
|
|
raidctl -C recover_raid0.conf raid0
|
|
|
|
.Ed
|
|
|
|
.Pp
|
2002-10-01 17:40:23 +04:00
|
|
|
to force the configuration of raid0.
|
|
|
|
A
|
2002-01-20 05:30:11 +03:00
|
|
|
.Bd -literal -offset indent
|
|
|
|
raidctl -I 12345 raid0
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
will be required in order to synchronize the component labels.
|
2002-11-17 01:49:48 +03:00
|
|
|
At this point the file systems on the RAID set can then be checked and
|
2002-10-01 17:40:23 +04:00
|
|
|
corrected.
|
|
|
|
To complete the re-construction of the RAID set,
|
2002-10-01 18:20:26 +04:00
|
|
|
.Pa /dev/sd1e
|
|
|
|
is simply hot-added back into the array, and reconstructed
|
2002-01-20 05:30:11 +03:00
|
|
|
as described earlier.
|
2000-08-10 19:14:14 +04:00
|
|
|
.Ss RAID on RAID
|
2002-10-01 18:20:26 +04:00
|
|
|
RAID sets can be layered to create more complex and much larger RAID sets.
|
|
|
|
A RAID 0 set, for example, could be constructed from four RAID 5 sets.
|
2002-10-01 17:40:23 +04:00
|
|
|
The following configuration file shows such a setup:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
2000-08-10 19:14:14 +04:00
|
|
|
START array
|
implement 32-bit compat support for raidframe.
convert several raidframe ioctls to be bitsize idempotent so that
they work the same in 32 and 64 bit worlds, allowing netbsd32 to
configure and query raid properly. remove useless 'row' in a few
places. add COMPAT_80 and put the old ioctls there.
raidframeio.h:
RAIDFRAME_TEST_ACC
- remove, unused
RAIDFRAME_GET_COMPONENT_LABEL
- convert to label not pointer to label
RAIDFRAME_CHECK_RECON_STATUS_EXT
RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT
RAIDFRAME_CHECK_COPYBACK_STATUS_EXT
- convert to progress info not pointer to info
RAIDFRAME_GET_INFO
- version entirely.
raidframevar.h:
- rf_recon_req{} has row, flags and raidPtr removed (they're
not a useful part of this interface.)
- RF_Config_s{} and RF_DeviceConfig_s{} have numRow/rows removed.
- RF_RaidDisk_s{} is re-ordered slightly to fix alignment
padding - the actual data was already OK.
- InstallSpareTable() loses row argument
rf_compat32.c has code for RF_Config_s{} in 32 bit mode, used
by RAIDFRAME_CONFIGURE and RAIDFRAME_GET_INFO32.
rf_compat80.c has code for rf_recon_req{}, RF_RaidDisk_s{} and
RF_DeviceConfig_s{} to handle RAIDFRAME_FAIL_DISK,
RAIDFRAME_GET_COMPONENT_LABEL, RAIDFRAME_CHECK_RECON_STATUS_EXT,
RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT,
RAIDFRAME_CHECK_COPYBACK_STATUS_EXT, RAIDFRAME_GET_INFO.
move several of the per-ioctl code blocks into separate functions.
add rf_recon_req_internal{} to replace old usage of global
rf_recon_req{} that had unused void * in the structure, ruining
it's 32/64 bit ABI.
add missing case for RAIDFRAME_GET_INFO50.
adjust raid tests to use the new .conf format, and add a case to
test the old method as well.
raidctl:
deal with lack of 'row' members in a couple of places.
fail request no longer takes row.
handle "START array" sections with just "numCol numSpare", ie
no "numRow" specified. for now, generate old-style configuration
but update raidctl.8 to specify the new style (keeping reference
to the old style.)
note that: RF_ComponentLabel_s::{row,num_rows} and
RF_SingleComponent_s::row are obsolete but not removed yet.
2018-01-18 03:32:48 +03:00
|
|
|
# numCol numSpare
|
|
|
|
4 0
|
2000-08-10 19:14:14 +04:00
|
|
|
|
|
|
|
START disks
|
|
|
|
/dev/raid1e
|
|
|
|
/dev/raid2e
|
|
|
|
/dev/raid3e
|
|
|
|
/dev/raid4e
|
|
|
|
|
|
|
|
START layout
|
|
|
|
# sectPerSU SUsPerParityUnit SUsPerReconUnit RAID_level_0
|
|
|
|
128 1 1 0
|
|
|
|
|
|
|
|
START queue
|
|
|
|
fifo 100
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
A similar configuration file might be used for a RAID 0 set
|
2002-10-01 17:40:23 +04:00
|
|
|
constructed from components on RAID 1 sets.
|
|
|
|
In such a configuration, the mirroring provides a high degree
|
|
|
|
of redundancy, while the striping provides additional speed benefits.
|
2000-08-10 19:14:14 +04:00
|
|
|
.Ss Auto-configuration and Root on RAID
|
2002-10-01 17:40:23 +04:00
|
|
|
RAID sets can also be auto-configured at boot.
|
|
|
|
To make a set auto-configurable,
|
|
|
|
simply prepare the RAID set as above, and then do a:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
2000-02-26 01:38:51 +03:00
|
|
|
raidctl -A yes raid0
|
|
|
|
.Ed
|
|
|
|
.Pp
|
2002-10-01 17:40:23 +04:00
|
|
|
to turn on auto-configuration for that set.
|
|
|
|
To turn off auto-configuration, use:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
2000-02-26 01:38:51 +03:00
|
|
|
raidctl -A no raid0
|
|
|
|
.Ed
|
|
|
|
.Pp
|
2000-08-10 19:14:14 +04:00
|
|
|
RAID sets which are auto-configurable will be configured before the
|
2002-10-01 17:40:23 +04:00
|
|
|
root file system is mounted.
|
|
|
|
These RAID sets are thus available for
|
|
|
|
use as a root file system, or for any other file system.
|
|
|
|
A primary advantage of using the auto-configuration is that RAID components
|
|
|
|
become more independent of the disks they reside on.
|
|
|
|
For example, SCSI ID's can change, but auto-configured sets will always be
|
2000-08-10 19:14:14 +04:00
|
|
|
configured correctly, even if the SCSI ID's of the component disks
|
|
|
|
have become scrambled.
|
|
|
|
.Pp
|
2001-07-10 05:30:52 +04:00
|
|
|
Having a system's root file system
|
|
|
|
.Pq Pa /
|
2002-10-01 18:20:26 +04:00
|
|
|
on a RAID set is also allowed, with the
|
2000-08-10 19:14:14 +04:00
|
|
|
.Sq a
|
2001-07-10 05:30:52 +04:00
|
|
|
partition of such a RAID set being used for
|
|
|
|
.Pa / .
|
|
|
|
To use raid0a as the root file system, simply use:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
2015-06-30 20:18:13 +03:00
|
|
|
raidctl -A forceroot raid0
|
2000-02-26 01:38:51 +03:00
|
|
|
.Ed
|
|
|
|
.Pp
|
2000-10-27 06:40:37 +04:00
|
|
|
To return raid0a to be just an auto-configuring set simply use the
|
|
|
|
.Fl A Ar yes
|
|
|
|
arguments.
|
|
|
|
.Pp
|
|
|
|
Note that kernels can only be directly read from RAID 1 components on
|
2005-01-31 19:42:15 +03:00
|
|
|
architectures that support that
|
2013-10-07 14:50:37 +04:00
|
|
|
.Pq currently alpha, i386, pmax, sandpoint, sparc, sparc64, and vax .
|
2002-10-01 17:40:23 +04:00
|
|
|
On those architectures, the
|
2000-10-27 06:40:37 +04:00
|
|
|
.Dv FS_RAID
|
2001-07-10 05:30:52 +04:00
|
|
|
file system is recognized by the bootblocks, and will properly load the
|
2002-10-01 17:40:23 +04:00
|
|
|
kernel directly from a RAID 1 component.
|
|
|
|
For other architectures, or to support the root file system
|
|
|
|
on other RAID sets, some other mechanism must be used to get a kernel booting.
|
2002-10-01 18:20:26 +04:00
|
|
|
For example, a small partition containing only the secondary boot-blocks
|
|
|
|
and an alternate kernel (or two) could be used.
|
2002-10-01 17:40:23 +04:00
|
|
|
Once a kernel is booting however, and an auto-configuring RAID set is
|
|
|
|
found that is eligible to be root, then that RAID set will be
|
|
|
|
auto-configured and used as the root device.
|
|
|
|
If two or more RAID sets claim to be root devices, then the
|
|
|
|
user will be prompted to select the root device.
|
|
|
|
At this time, RAID 0, 1, 4, and 5 sets are all supported as root devices.
|
2000-08-10 19:14:14 +04:00
|
|
|
.Pp
|
|
|
|
A typical RAID 1 setup with root on RAID might be as follows:
|
|
|
|
.Bl -enum
|
2001-11-16 13:25:42 +03:00
|
|
|
.It
|
2000-08-10 19:14:14 +04:00
|
|
|
wd0a - a small partition, which contains a complete, bootable, basic
|
2001-11-16 14:06:46 +03:00
|
|
|
.Nx
|
|
|
|
installation.
|
2000-08-10 19:14:14 +04:00
|
|
|
.It
|
2001-11-16 14:06:46 +03:00
|
|
|
wd1a - also contains a complete, bootable, basic
|
|
|
|
.Nx
|
|
|
|
installation.
|
2001-11-16 13:25:42 +03:00
|
|
|
.It
|
2001-07-10 05:30:52 +04:00
|
|
|
wd0e and wd1e - a RAID 1 set, raid0, used for the root file system.
|
2000-08-10 19:14:14 +04:00
|
|
|
.It
|
|
|
|
wd0f and wd1f - a RAID 1 set, raid1, which will be used only for
|
2001-11-16 13:25:42 +03:00
|
|
|
swap space.
|
2000-08-10 19:14:14 +04:00
|
|
|
.It
|
2001-07-10 05:30:52 +04:00
|
|
|
wd0g and wd1g - a RAID 1 set, raid2, used for
|
|
|
|
.Pa /usr ,
|
|
|
|
.Pa /home ,
|
|
|
|
or other data, if desired.
|
2001-11-16 13:25:42 +03:00
|
|
|
.It
|
2007-12-14 10:24:01 +03:00
|
|
|
wd0h and wd1h - a RAID 1 set, raid3, if desired.
|
2000-08-10 19:14:14 +04:00
|
|
|
.El
|
|
|
|
.Pp
|
2002-10-01 17:40:23 +04:00
|
|
|
RAID sets raid0, raid1, and raid2 are all marked as auto-configurable.
|
|
|
|
raid0 is marked as being a root file system.
|
2001-07-10 05:30:52 +04:00
|
|
|
When new kernels are installed, the kernel is not only copied to
|
2001-11-16 13:25:42 +03:00
|
|
|
.Pa / ,
|
2002-10-01 17:40:23 +04:00
|
|
|
but also to wd0a and wd1a.
|
|
|
|
The kernel on wd0a is required, since that
|
|
|
|
is the kernel the system boots from.
|
|
|
|
The kernel on wd1a is also
|
|
|
|
required, since that will be the kernel used should wd0 fail.
|
|
|
|
The important point here is to have redundant copies of the kernel
|
2000-08-10 19:14:14 +04:00
|
|
|
available, in the event that one of the drives fail.
|
|
|
|
.Pp
|
2001-07-10 05:30:52 +04:00
|
|
|
There is no requirement that the root file system be on the same disk
|
2002-10-01 17:40:23 +04:00
|
|
|
as the kernel.
|
|
|
|
For example, obtaining the kernel from wd0a, and using
|
|
|
|
sd0e and sd1e for raid0, and the root file system, is fine.
|
|
|
|
It
|
2002-10-01 18:20:26 +04:00
|
|
|
.Em is
|
2000-08-10 19:14:14 +04:00
|
|
|
critical, however, that there be multiple kernels available, in the
|
|
|
|
event of media failure.
|
|
|
|
.Pp
|
|
|
|
Multi-layered RAID devices (such as a RAID 0 set made
|
2000-02-26 01:38:51 +03:00
|
|
|
up of RAID 1 sets) are
|
2002-10-01 18:20:26 +04:00
|
|
|
.Em not
|
2000-02-26 01:38:51 +03:00
|
|
|
supported as root devices or auto-configurable devices at this point.
|
2001-11-16 13:25:42 +03:00
|
|
|
(Multi-layered RAID devices
|
2002-10-01 18:20:26 +04:00
|
|
|
.Em are
|
2002-10-01 17:40:23 +04:00
|
|
|
supported in general, however, as mentioned earlier.)
|
2002-10-01 18:20:26 +04:00
|
|
|
Note that in order to enable component auto-detection and
|
|
|
|
auto-configuration of RAID devices, the line:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
2000-02-26 22:43:07 +03:00
|
|
|
options RAID_AUTOCONFIG
|
|
|
|
.Ed
|
|
|
|
.Pp
|
2002-10-01 17:40:23 +04:00
|
|
|
must be in the kernel configuration file.
|
|
|
|
See
|
2000-02-26 22:43:07 +03:00
|
|
|
.Xr raid 4
|
|
|
|
for more details.
|
2002-11-17 01:49:48 +03:00
|
|
|
.Ss Swapping on RAID
|
|
|
|
A RAID device can be used as a swap device.
|
|
|
|
In order to ensure that a RAID device used as a swap device
|
|
|
|
is correctly unconfigured when the system is shutdown or rebooted,
|
|
|
|
it is recommended that the line
|
|
|
|
.Bd -literal -offset indent
|
|
|
|
swapoff=YES
|
|
|
|
.Ed
|
|
|
|
.Pp
|
2002-11-17 02:54:16 +03:00
|
|
|
be added to
|
2002-11-17 01:49:48 +03:00
|
|
|
.Pa /etc/rc.conf .
|
2000-08-10 19:14:14 +04:00
|
|
|
.Ss Unconfiguration
|
2001-11-16 13:25:42 +03:00
|
|
|
The final operation performed by
|
1998-11-13 16:16:46 +03:00
|
|
|
.Nm
|
2001-11-16 13:25:42 +03:00
|
|
|
is to unconfigure a
|
1998-11-13 16:16:46 +03:00
|
|
|
.Xr raid 4
|
2002-10-01 17:40:23 +04:00
|
|
|
device.
|
|
|
|
This is accomplished via a simple:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
1998-11-13 16:16:46 +03:00
|
|
|
raidctl -u raid0
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
at which point the device is ready to be reconfigured.
|
2000-10-27 06:40:37 +04:00
|
|
|
.Ss Performance Tuning
|
|
|
|
Selection of the various parameter values which result in the best
|
|
|
|
performance can be quite tricky, and often requires a bit of
|
|
|
|
trial-and-error to get those values most appropriate for a given system.
|
|
|
|
A whole range of factors come into play, including:
|
|
|
|
.Bl -enum
|
|
|
|
.It
|
2002-10-01 18:20:26 +04:00
|
|
|
Types of components (e.g., SCSI vs. IDE) and their bandwidth
|
2000-10-27 06:40:37 +04:00
|
|
|
.It
|
|
|
|
Types of controller cards and their bandwidth
|
|
|
|
.It
|
|
|
|
Distribution of components among controllers
|
|
|
|
.It
|
|
|
|
IO bandwidth
|
|
|
|
.It
|
2001-07-10 05:30:52 +04:00
|
|
|
file system access patterns
|
2001-11-16 13:25:42 +03:00
|
|
|
.It
|
2000-10-27 06:40:37 +04:00
|
|
|
CPU speed
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
As with most performance tuning, benchmarking under real-life loads
|
2002-10-01 17:40:23 +04:00
|
|
|
may be the only way to measure expected performance.
|
|
|
|
Understanding some of the underlying technology is also useful in tuning.
|
|
|
|
The goal of this section is to provide pointers to those parameters which may
|
2000-10-27 06:40:37 +04:00
|
|
|
make significant differences in performance.
|
|
|
|
.Pp
|
2002-10-01 17:40:23 +04:00
|
|
|
For a RAID 1 set, a SectPerSU value of 64 or 128 is typically sufficient.
|
|
|
|
Since data in a RAID 1 set is arranged in a linear
|
2000-10-27 06:40:37 +04:00
|
|
|
fashion on each component, selecting an appropriate stripe size is
|
2002-10-01 17:40:23 +04:00
|
|
|
somewhat less critical than it is for a RAID 5 set.
|
|
|
|
However: a stripe size that is too small will cause large IO's to be
|
|
|
|
broken up into a number of smaller ones, hurting performance.
|
|
|
|
At the same time, a large stripe size may cause problems with
|
|
|
|
concurrent accesses to stripes, which may also affect performance.
|
|
|
|
Thus values in the range of 32 to 128 are often the most effective.
|
|
|
|
.Pp
|
|
|
|
Tuning RAID 5 sets is trickier.
|
|
|
|
In the best case, IO is presented to the RAID set one stripe at a time.
|
|
|
|
Since the entire stripe is available at the beginning of the IO,
|
|
|
|
the parity of that stripe can be calculated before the stripe is written,
|
|
|
|
and then the stripe data and parity can be written in parallel.
|
|
|
|
When the amount of data being written is less than a full stripe worth, the
|
2000-10-27 06:40:37 +04:00
|
|
|
.Sq small write
|
2002-10-01 17:40:23 +04:00
|
|
|
problem occurs.
|
|
|
|
Since a
|
2000-10-27 06:40:37 +04:00
|
|
|
.Sq small write
|
|
|
|
means only a portion of the stripe on the components is going to
|
|
|
|
change, the data (and parity) on the components must be updated
|
2002-10-01 17:40:23 +04:00
|
|
|
slightly differently.
|
|
|
|
First, the
|
2000-10-27 06:40:37 +04:00
|
|
|
.Sq old parity
|
2001-11-16 13:25:42 +03:00
|
|
|
and
|
2000-10-27 06:40:37 +04:00
|
|
|
.Sq old data
|
2002-10-01 17:40:23 +04:00
|
|
|
must be read from the components.
|
|
|
|
Then the new parity is constructed,
|
2000-10-27 06:40:37 +04:00
|
|
|
using the new data to be written, and the old data and old parity.
|
2002-10-01 17:40:23 +04:00
|
|
|
Finally, the new data and new parity are written.
|
|
|
|
All this extra data shuffling results in a serious loss of performance,
|
|
|
|
and is typically 2 to 4 times slower than a full stripe write (or read).
|
|
|
|
To combat this problem in the real world, it may be useful
|
|
|
|
to ensure that stripe sizes are small enough that a
|
2000-10-27 06:40:37 +04:00
|
|
|
.Sq large IO
|
2002-10-01 17:40:23 +04:00
|
|
|
from the system will use exactly one large stripe write.
|
|
|
|
As is seen later, there are some file system dependencies
|
|
|
|
which may come into play here as well.
|
2000-10-27 06:40:37 +04:00
|
|
|
.Pp
|
2001-11-16 13:25:42 +03:00
|
|
|
Since the size of a
|
2000-10-27 06:40:37 +04:00
|
|
|
.Sq large IO
|
|
|
|
is often (currently) only 32K or 64K, on a 5-drive RAID 5 set it may
|
|
|
|
be desirable to select a SectPerSU value of 16 blocks (8K) or 32
|
2002-10-01 17:40:23 +04:00
|
|
|
blocks (16K).
|
|
|
|
Since there are 4 data sectors per stripe, the maximum
|
|
|
|
data per stripe is 64 blocks (32K) or 128 blocks (64K).
|
|
|
|
Again, empirical measurement will provide the best indicators of which
|
2009-11-17 22:09:38 +03:00
|
|
|
values will yield better performance.
|
2000-10-27 06:40:37 +04:00
|
|
|
.Pp
|
2002-10-01 17:40:23 +04:00
|
|
|
The parameters used for the file system are also critical to good performance.
|
|
|
|
For
|
2001-11-16 13:25:42 +03:00
|
|
|
.Xr newfs 8 ,
|
2000-10-27 06:40:37 +04:00
|
|
|
for example, increasing the block size to 32K or 64K may improve
|
2002-10-01 17:40:23 +04:00
|
|
|
performance dramatically.
|
|
|
|
As well, changing the cylinders-per-group
|
2000-10-27 06:40:37 +04:00
|
|
|
parameter from 16 to 32 or higher is often not only necessary for
|
2002-10-01 17:40:23 +04:00
|
|
|
larger file systems, but may also have positive performance implications.
|
2000-02-26 07:02:03 +03:00
|
|
|
.Ss Summary
|
|
|
|
Despite the length of this man-page, configuring a RAID set is a
|
2002-10-01 17:40:23 +04:00
|
|
|
relatively straight-forward process.
|
|
|
|
All that needs to be done is the following steps:
|
2000-02-26 07:02:03 +03:00
|
|
|
.Bl -enum
|
2001-11-16 13:25:42 +03:00
|
|
|
.It
|
|
|
|
Use
|
|
|
|
.Xr disklabel 8
|
2000-02-26 07:02:03 +03:00
|
|
|
to create the components (of type RAID).
|
2001-11-16 13:25:42 +03:00
|
|
|
.It
|
2002-10-01 18:20:26 +04:00
|
|
|
Construct a RAID configuration file: e.g.,
|
|
|
|
.Pa raid0.conf
|
2001-11-16 13:25:42 +03:00
|
|
|
.It
|
|
|
|
Configure the RAID set with:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
2000-02-26 07:02:03 +03:00
|
|
|
raidctl -C raid0.conf raid0
|
|
|
|
.Ed
|
2001-11-16 13:25:42 +03:00
|
|
|
.It
|
|
|
|
Initialize the component labels with:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
2000-02-26 07:02:03 +03:00
|
|
|
raidctl -I 123456 raid0
|
|
|
|
.Ed
|
2001-11-16 13:25:42 +03:00
|
|
|
.It
|
|
|
|
Initialize other important parts of the set with:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
2000-02-26 07:02:03 +03:00
|
|
|
raidctl -i raid0
|
|
|
|
.Ed
|
|
|
|
.It
|
2001-11-16 13:25:42 +03:00
|
|
|
Get the default label for the RAID set:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
2017-07-04 00:28:48 +03:00
|
|
|
disklabel raid0 > /tmp/label
|
2000-02-26 07:02:03 +03:00
|
|
|
.Ed
|
2001-11-16 13:25:42 +03:00
|
|
|
.It
|
|
|
|
Edit the label:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
2000-02-26 07:02:03 +03:00
|
|
|
vi /tmp/label
|
|
|
|
.Ed
|
2001-11-16 13:25:42 +03:00
|
|
|
.It
|
|
|
|
Put the new label on the RAID set:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
2000-02-26 07:02:03 +03:00
|
|
|
disklabel -R -r raid0 /tmp/label
|
|
|
|
.Ed
|
2001-11-16 13:25:42 +03:00
|
|
|
.It
|
|
|
|
Create the file system:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
2001-11-16 13:25:42 +03:00
|
|
|
newfs /dev/rraid0e
|
2000-02-26 07:02:03 +03:00
|
|
|
.Ed
|
|
|
|
.It
|
2001-11-16 13:25:42 +03:00
|
|
|
Mount the file system:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
2000-02-26 07:02:03 +03:00
|
|
|
mount /dev/raid0e /mnt
|
|
|
|
.Ed
|
|
|
|
.It
|
|
|
|
Use:
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal -offset indent
|
2000-02-26 07:02:03 +03:00
|
|
|
raidctl -c raid0.conf raid0
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
To re-configure the RAID set the next time it is needed, or put
|
2002-10-01 18:20:26 +04:00
|
|
|
.Pa raid0.conf
|
|
|
|
into
|
|
|
|
.Pa /etc
|
|
|
|
where it will automatically be started by the
|
|
|
|
.Pa /etc/rc.d
|
|
|
|
scripts.
|
2000-02-26 07:02:03 +03:00
|
|
|
.El
|
1998-11-13 16:16:46 +03:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr ccd 4 ,
|
2001-11-16 14:06:46 +03:00
|
|
|
.Xr raid 4 ,
|
1998-11-13 16:16:46 +03:00
|
|
|
.Xr rc 8
|
|
|
|
.Sh HISTORY
|
|
|
|
RAIDframe is a framework for rapid prototyping of RAID structures
|
|
|
|
developed by the folks at the Parallel Data Laboratory at Carnegie
|
2001-11-16 13:25:42 +03:00
|
|
|
Mellon University (CMU).
|
1998-11-13 16:16:46 +03:00
|
|
|
A more complete description of the internals and functionality of
|
|
|
|
RAIDframe is found in the paper "RAIDframe: A Rapid Prototyping Tool
|
|
|
|
for RAID Systems", by William V. Courtright II, Garth Gibson, Mark
|
|
|
|
Holland, LeAnn Neal Reilly, and Jim Zelenka, and published by the
|
|
|
|
Parallel Data Laboratory of Carnegie Mellon University.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Nm
|
2002-10-01 17:40:23 +04:00
|
|
|
command first appeared as a program in CMU's RAIDframe v1.1 distribution.
|
|
|
|
This version of
|
1998-11-13 16:16:46 +03:00
|
|
|
.Nm
|
|
|
|
is a complete re-write, and first appeared in
|
|
|
|
.Nx 1.4 .
|
|
|
|
.Sh COPYRIGHT
|
2001-11-16 14:06:46 +03:00
|
|
|
.Bd -literal
|
1998-11-13 16:16:46 +03:00
|
|
|
The RAIDframe Copyright is as follows:
|
|
|
|
|
|
|
|
Copyright (c) 1994-1996 Carnegie-Mellon University.
|
|
|
|
All rights reserved.
|
|
|
|
|
|
|
|
Permission to use, copy, modify and distribute this software and
|
|
|
|
its documentation is hereby granted, provided that both the copyright
|
|
|
|
notice and this permission notice appear in all copies of the
|
|
|
|
software, derivative works or modified versions, and any portions
|
|
|
|
thereof, and that both notices appear in supporting documentation.
|
|
|
|
|
|
|
|
CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
|
|
|
|
CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
|
|
|
|
FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
|
|
|
|
|
|
|
|
Carnegie Mellon requests users of this software to return to
|
|
|
|
|
|
|
|
Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
|
|
|
|
School of Computer Science
|
|
|
|
Carnegie Mellon University
|
|
|
|
Pittsburgh PA 15213-3890
|
|
|
|
|
|
|
|
any improvements or extensions that they make and grant Carnegie the
|
|
|
|
rights to redistribute these changes.
|
|
|
|
.Ed
|
2001-11-16 14:06:46 +03:00
|
|
|
.Sh WARNINGS
|
|
|
|
Certain RAID levels (1, 4, 5, 6, and others) can protect against some
|
2002-10-01 17:40:23 +04:00
|
|
|
data loss due to component failure.
|
|
|
|
However the loss of two components of a RAID 4 or 5 system,
|
|
|
|
or the loss of a single component of a RAID 0 system will
|
|
|
|
result in the entire file system being lost.
|
2001-11-16 14:06:46 +03:00
|
|
|
RAID is
|
2002-10-01 18:20:26 +04:00
|
|
|
.Em NOT
|
2001-11-16 14:06:46 +03:00
|
|
|
a substitute for good backup practices.
|
|
|
|
.Pp
|
|
|
|
Recomputation of parity
|
2002-10-01 18:20:26 +04:00
|
|
|
.Em MUST
|
2002-10-01 17:40:23 +04:00
|
|
|
be performed whenever there is a chance that it may have been compromised.
|
|
|
|
This includes after system crashes, or before a RAID
|
|
|
|
device has been used for the first time.
|
|
|
|
Failure to keep parity correct will be catastrophic should a
|
2002-10-01 18:20:26 +04:00
|
|
|
component ever fail \(em it is better to use RAID 0 and get the
|
2002-10-01 17:40:23 +04:00
|
|
|
additional space and speed, than it is to use parity, but
|
|
|
|
not keep the parity correct.
|
|
|
|
At least with RAID 0 there is no perception of increased data security.
|
2011-07-28 22:25:22 +04:00
|
|
|
.Pp
|
|
|
|
When replacing a failed component of a RAID set, it is a good
|
|
|
|
idea to zero out the first 64 blocks of the new component to insure the
|
2011-08-02 14:28:00 +04:00
|
|
|
RAIDframe driver doesn't erroneously detect a component label in the
|
|
|
|
new component.
|
|
|
|
This is particularly true on
|
2012-03-23 22:28:13 +04:00
|
|
|
.Em RAID 1
|
2011-07-28 22:25:22 +04:00
|
|
|
sets because there is at most one correct component label in a failed RAID
|
|
|
|
1 installation, and the RAIDframe driver picks the component label with the
|
|
|
|
highest serial number and modification value as the authoritative source
|
|
|
|
for the failed RAID set when choosing which component label to use to
|
|
|
|
configure the RAID set.
|
2001-11-16 14:06:46 +03:00
|
|
|
.Sh BUGS
|
|
|
|
Hot-spare removal is currently not available.
|