CVS commit: [netbsd-10] src/sbin/raidctl

2024-04-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Apr 28 12:12:00 UTC 2024

Modified Files:
src/sbin/raidctl [netbsd-10]: raidctl.8 raidctl.c

Log Message:
Pull up following revision(s) (requested by oster in ticket #675):

sbin/raidctl/raidctl.8: revision 1.81
sbin/raidctl/raidctl.c: revision 1.80

Implement command-line configuration of simple RAID sets with raidctl
based on the usage pattern:

 raidctl  create...

For example,

 raidctl raid0 create mirror absent /dev/wd1e

will create a RAID level 1 (mirror) set with an absent first component
and /dev/wd1e as the second component. The resulting RAID device will
be marked as auto-configurable, will have a serial number set (based
on the current time), and parity will be initialized. Reasonable
performance values are automatically used by default for other parameters
normally specified in the configuration file.

Also: Only print out Autoconfig status if being verbose.


To generate a diff of this commit:
cvs rdiff -u -r1.79.2.1 -r1.79.2.2 src/sbin/raidctl/raidctl.8
cvs rdiff -u -r1.78.2.1 -r1.78.2.2 src/sbin/raidctl/raidctl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/raidctl/raidctl.8
diff -u src/sbin/raidctl/raidctl.8:1.79.2.1 src/sbin/raidctl/raidctl.8:1.79.2.2
--- src/sbin/raidctl/raidctl.8:1.79.2.1	Sun Apr 28 12:09:08 2024
+++ src/sbin/raidctl/raidctl.8	Sun Apr 28 12:12:00 2024
@@ -1,4 +1,4 @@
-.\" $NetBSD: raidctl.8,v 1.79.2.1 2024/04/28 12:09:08 martin Exp $
+.\" $NetBSD: raidctl.8,v 1.79.2.2 2024/04/28 12:12:00 martin Exp $
 .\"
 .\" Copyright (c) 1998, 2002 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -53,7 +53,7 @@
 .\" any improvements or extensions that they make and grant Carnegie the
 .\" rights to redistribute these changes.
 .\"
-.Dd September 16, 2023
+.Dd September 20, 2023
 .Dt RAIDCTL 8
 .Os
 .Sh NAME
@@ -61,6 +61,10 @@
 .Nd configuration utility for the RAIDframe disk driver
 .Sh SYNOPSIS
 .Nm
+.Ar dev
+.Ar command
+.Op Ar arg Op ...
+.Nm
 .Op Fl v
 .Fl A Op yes | no | forceroot | softroot
 .Ar dev
@@ -148,7 +152,27 @@ For more information about the RAIDframe
 This document assumes the reader has at least rudimentary knowledge of
 RAID and RAID concepts.
 .Pp
-The command-line options for
+The simplified command-line options for
+.Nm
+are as follows:
+.Bl -tag -width indent
+.It Ic create Ar level Ar component1 Ar component2 Ar ...
+where
+.Ar level
+specifies the RAID level and is one of
+.Ar 0
+,
+.Ar 1 
+(or
+.Ar mirror
+), or
+.Ar 5
+and each of
+.Ar componentN
+specify the devices to be configured into the RAID set.
+.El
+.Pp
+The advanced command-line options for
 .Nm
 are as follows:
 .Bl -tag -width indent
@@ -370,6 +394,38 @@ for many others, or just simply
 .Pa /dev/rraid0[cd] ) .
 It is recommended that the partitions used to represent the
 RAID device are not used for file systems.
+.Ss Simple RAID configuration
+For simple RAID configurations using RAID levels 0 (simple striping),
+1 (mirroring), or 5 (striping with distributed parity)
+.Nm
+supports command-line configuration of RAID setups without
+the use of a configuration file.  For example,
+.Bd -literal -offset indent
+raidctl raid0 create 0 /dev/wd0e /dev/wd1e /dev/wd2e
+.Ed
+.Pp
+will create a RAID level 0 set on the device named
+.Pa raid0
+using the components
+.Pa /dev/wd0e ,
+.Pa /dev/wd1e ,
+and
+.Pa /dev/wd2e .
+Similarly,
+.Bd -literal -offset indent
+raidctl raid0 create mirror absent /dev/wd1e
+.Ed
+.Pp
+will create a RAID level 1 (mirror) set with an absent first component
+and
+.Pa /dev/wd1e
+as the second component.  In all cases the resulting RAID device will
+be marked as auto-configurable, will have a serial number set (based
+on the current time), and parity will be initialized (if the RAID level
+has parity and sufficent components are present).  Reasonable
+performance values are automatically used by default for other
+parameters normally specified in the configuration file.
+.Pp
 .Ss Configuration file
 The format of the configuration file is complex, and
 only an abbreviated treatment is given here.
@@ -540,6 +596,10 @@ for a more complete configuration file e
 device special files.
 .El
 .Sh EXAMPLES
+The examples given in this section are for more complex
+setups than can be configured with the simplified command-line
+configuration option described early.
+.Pp
 It is highly recommended that before using the RAID driver for real
 file systems that the system administrator(s) become quite familiar
 with the use of

Index: src/sbin/raidctl/raidctl.c
diff -u src/sbin/raidctl/raidctl.c:1.78.2.1 src/sbin/raidctl/raidctl.c:1.78.2.2
--- src/sbin/raidctl/raidctl.c:1.78.2.1	Sun Apr 28 12:09:08 2024
+++ src/sbin/raidctl/raidctl.c	Sun Apr 28 12:12:00 2024
@@ -1,4 +1,4 @@
-/*  $NetBSD: raidctl.c,v 1.78.2.1 2024/04/28 12:09:08 martin Exp $   */
+/*  $NetBSD: raidctl.c,v 1.78.2.2 

CVS commit: [netbsd-10] src/sbin/raidctl

2024-04-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Apr 28 12:12:00 UTC 2024

Modified Files:
src/sbin/raidctl [netbsd-10]: raidctl.8 raidctl.c

Log Message:
Pull up following revision(s) (requested by oster in ticket #675):

sbin/raidctl/raidctl.8: revision 1.81
sbin/raidctl/raidctl.c: revision 1.80

Implement command-line configuration of simple RAID sets with raidctl
based on the usage pattern:

 raidctl  create...

For example,

 raidctl raid0 create mirror absent /dev/wd1e

will create a RAID level 1 (mirror) set with an absent first component
and /dev/wd1e as the second component. The resulting RAID device will
be marked as auto-configurable, will have a serial number set (based
on the current time), and parity will be initialized. Reasonable
performance values are automatically used by default for other parameters
normally specified in the configuration file.

Also: Only print out Autoconfig status if being verbose.


To generate a diff of this commit:
cvs rdiff -u -r1.79.2.1 -r1.79.2.2 src/sbin/raidctl/raidctl.8
cvs rdiff -u -r1.78.2.1 -r1.78.2.2 src/sbin/raidctl/raidctl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.