diff options
| author | christos <christos@NetBSD.org> | 2016-01-06 17:41:36 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2016-01-06 17:41:36 +0000 |
| commit | d201620fd1d8b02834be12c8c8c8ade0711235df (patch) | |
| tree | 0e82d46db88f0e13087339c2a064569d2350e765 /sbin/raidctl | |
| parent | 5a66c9bc531266df9bd492ab415099b3c124c4ad (diff) | |
Access to the SET_LAST_UNIT ioctl.
Diffstat (limited to 'sbin/raidctl')
| -rw-r--r-- | sbin/raidctl/raidctl.8 | 13 | ||||
| -rw-r--r-- | sbin/raidctl/raidctl.c | 19 |
2 files changed, 27 insertions, 5 deletions
diff --git a/sbin/raidctl/raidctl.8 b/sbin/raidctl/raidctl.8 index ede2b0f9ae3..2b8d7398b83 100644 --- a/sbin/raidctl/raidctl.8 +++ b/sbin/raidctl/raidctl.8 @@ -1,4 +1,4 @@ -.\" $NetBSD: raidctl.8,v 1.69 2015/06/30 22:16:12 wiz Exp $ +.\" $NetBSD: raidctl.8,v 1.70 2016/01/06 17:41:36 christos 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 June 30, 2015 +.Dd January 6, 2016 .Dt RAIDCTL 8 .Os .Sh NAME @@ -125,6 +125,9 @@ .Nm .Op Fl v .Fl u Ar dev +.Nm +.Op Fl v +.Fl U Ar unit Ar dev .Sh DESCRIPTION .Nm is the user-land control program for @@ -318,6 +321,12 @@ achieved in each of these areas. 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. +.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 . .It Fl v Be more verbose. For operations such as reconstructions, parity diff --git a/sbin/raidctl/raidctl.c b/sbin/raidctl/raidctl.c index e179417c519..655ee373abd 100644 --- a/sbin/raidctl/raidctl.c +++ b/sbin/raidctl/raidctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: raidctl.c,v 1.63 2015/09/08 08:59:09 bad Exp $ */ +/* $NetBSD: raidctl.c,v 1.64 2016/01/06 17:41:36 christos Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -39,7 +39,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: raidctl.c,v 1.63 2015/09/08 08:59:09 bad Exp $"); +__RCSID("$NetBSD: raidctl.c,v 1.64 2016/01/06 17:41:36 christos Exp $"); #endif @@ -114,6 +114,7 @@ main(int argc,char *argv[]) int fd; int force; int openmode; + int last_unit; num_options = 0; action = 0; @@ -122,9 +123,10 @@ main(int argc,char *argv[]) do_rewrite = 0; serial_number = 0; force = 0; + last_unit = 0; openmode = O_RDWR; /* default to read/write */ - while ((ch = getopt(argc, argv, "a:A:Bc:C:f:F:g:GiI:l:mM:r:R:sSpPuv")) + while ((ch = getopt(argc, argv, "a:A:Bc:C:f:F:g:GiI:l:mM:r:R:sSpPuU:v")) != -1) switch(ch) { case 'a': @@ -244,6 +246,13 @@ main(int argc,char *argv[]) action = RAIDFRAME_SHUTDOWN; num_options++; break; + case 'U': + action = RAIDFRAME_SET_LAST_UNIT; + num_options++; + last_unit = atoi(optarg); + if (last_unit < 0) + errx(1, "Bad last unit %s", optarg); + break; case 'v': verbose = 1; /* Don't bump num_options, as '-v' is not @@ -342,6 +351,10 @@ main(int argc,char *argv[]) case RAIDFRAME_SHUTDOWN: do_ioctl(fd, RAIDFRAME_SHUTDOWN, NULL, "RAIDFRAME_SHUTDOWN"); break; + case RAIDFRAME_SET_LAST_UNIT: + do_ioctl(fd, RAIDFRAME_SET_LAST_UNIT, &last_unit, + "RAIDFRAME_SET_LAST_UNIT"); + break; default: break; } |
