]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
mdadm-0.7 mdadm-0.7
authorNeil Brown <neilb@suse.de>
Fri, 8 Mar 2002 00:03:52 +0000 (00:03 +0000)
committerNeil Brown <neilb@suse.de>
Fri, 8 Mar 2002 00:03:52 +0000 (00:03 +0000)
21 files changed:
Assemble.c
Build.c
ChangeLog
Create.c
Detail.c
Examine.c
Kill.c [new file with mode: 0644]
Makefile
Manage.c
Monitor.c
ReadMe.c
TAGS
TODO
config.c
makedist
mdadm.8 [moved from mdctl.8 with 94% similarity]
mdadm.c [moved from mdctl.c with 98% similarity]
mdadm.h [moved from mdctl.h with 97% similarity]
mdadm.man [moved from mdctl.man with 88% similarity]
mdctl.spec
util.c

index 1a4cb7ed6ee22a956fbe03c4e9303d0a79a330d6..53c09d61e110cdb468f0c69fba19e4fcb1b792f3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * mdctl - manage Linux "md" devices aka RAID arrays.
+ * mdadm - manage Linux "md" devices aka RAID arrays.
  *
  * Copyright (C) 2001-2002 Neil Brown <neilb@cse.unsw.edu.au>
  *
@@ -27,7 +27,7 @@
  *           Australia
  */
 
-#include       "mdctl.h"
+#include       "mdadm.h"
 #include       "md_u.h"
 #include       "md_p.h"
 
diff --git a/Build.c b/Build.c
index 51f2df07c3744389be1bde877ac061d63d2ba003..42aab1f9e7d46944d7a3e8b321519be0f594b5ab 100644 (file)
--- a/Build.c
+++ b/Build.c
@@ -1,5 +1,5 @@
 /*
- * mdctl - manage Linux "md" devices aka RAID arrays.
+ * mdadm - manage Linux "md" devices aka RAID arrays.
  *
  * Copyright (C) 2001-2002 Neil Brown <neilb@cse.unsw.edu.au>
  *
@@ -27,7 +27,7 @@
  *           Australia
  */
 
-#include "mdctl.h"
+#include "mdadm.h"
 
 #define REGISTER_DEV           _IO (MD_MAJOR, 1)
 #define START_MD               _IO (MD_MAJOR, 2)
index b27e2d5a5c9dabda52f4465db14ce1baaa06475f..82a2b7b7aed84390dc9121625185fc3e30a4ec5d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,15 @@
 
+Changes Prior to 0.7 release   
+
+    -   Fix makefile to install binary at /sbin and not /sbin/sbin
+       Also install man page.
+    -   Add --zero-superblock based on --destroywithextremeprejudice
+       from Dale Stephenson <steph@snapserver.com>
+    -   change name to mdadm.  It is palandromic, and much nicer to pronouce.
+       
 Changes Prior to 0.6 release
 
-       -   Remove the limit on the number of device names that can be
+    -   Remove the limit on the number of device names that can be
        given on the command line.
     -   Fix bug in --assemble --force where it would only update a 
        single superblock.
index 55a9eca7408a84e16bddb7be5ec409b057601c78..d801fb43c4c03818a8390d60914898ada436dc19 100644 (file)
--- a/Create.c
+++ b/Create.c
@@ -1,5 +1,5 @@
 /*
- * mdctl - manage Linux "md" devices aka RAID arrays.
+ * mdadm - manage Linux "md" devices aka RAID arrays.
  *
  * Copyright (C) 2001-2002 Neil Brown <neilb@cse.unsw.edu.au>
  *
@@ -27,7 +27,7 @@
  *           Australia
  */
 
-#include "mdctl.h"
+#include "mdadm.h"
 #include       "md_u.h"
 #include       "md_p.h"
 
index 7c2860d62c957d35e842118a0fd4dbee0dc9c331..232b458a7dd0ee969fe65759881a404be7d0b28a 100644 (file)
--- a/Detail.c
+++ b/Detail.c
@@ -1,5 +1,5 @@
 /*
- * mdctl - manage Linux "md" devices aka RAID arrays.
+ * mdadm - manage Linux "md" devices aka RAID arrays.
  *
  * Copyright (C) 2001-2002 Neil Brown <neilb@cse.unsw.edu.au>
  *
@@ -27,7 +27,7 @@
  *           Australia
  */
 
-#include       "mdctl.h"
+#include       "mdadm.h"
 #include       "md_p.h"
 #include       "md_u.h"
 
index c8fbfbbb07d299bafbd73dfea2826e37a3ea367d..dc33e0fec2eee0be55415dc30b65e1c3df12235a 100644 (file)
--- a/Examine.c
+++ b/Examine.c
@@ -1,5 +1,5 @@
 /*
- * mdctl - manage Linux "md" devices aka RAID arrays.
+ * mdadm - manage Linux "md" devices aka RAID arrays.
  *
  * Copyright (C) 2001-2002 Neil Brown <neilb@cse.unsw.edu.au>
  *
@@ -27,7 +27,7 @@
  *           Australia
  */
 
-#include       "mdctl.h"
+#include       "mdadm.h"
 #include       "dlink.h"
 
 #if ! defined(__BIG_ENDIAN) && ! defined(__LITTLE_ENDIAN)
@@ -50,7 +50,7 @@ int Examine(mddev_dev_t devlist, int brief, char *conffile)
         *
         *   utime, state etc
         *
-        * If (brief) gather devices for same array and just print a mdctl.conf line including devices=
+        * If (brief) gather devices for same array and just print a mdadm.conf line including devices=
         * if devlist==NULL, use conf_get_devs(
         */
        int fd; 
diff --git a/Kill.c b/Kill.c
new file mode 100644 (file)
index 0000000..a57bdf8
--- /dev/null
+++ b/Kill.c
@@ -0,0 +1,83 @@
+/*
+ * mdadm - manage Linux "md" devices aka RAID arrays.
+ *
+ * Copyright (C) 2001-2002 Neil Brown <neilb@cse.unsw.edu.au>
+ *
+ *
+ *    This program is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 2 of the License, or
+ *    (at your option) any later version.
+ *
+ *    This program is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with this program; if not, write to the Free Software
+ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ *    Author: Neil Brown
+ *    Email: <neilb@cse.unsw.edu.au>
+ *    Paper: Neil Brown
+ *           School of Computer Science and Engineering
+ *           The University of New South Wales
+ *           Sydney, 2052
+ *           Australia
+ *
+ *    Added by Dale Stephenson
+ *    steph@snapserver.com
+ */
+
+#include       "mdadm.h"
+#include       "md_u.h"
+#include       "md_p.h"
+
+int Kill(char *dev, int force)
+{
+       /*
+        * Nothing fancy about Kill.  It just zeroes out a superblock
+        * Definitely not safe.
+        */
+
+       mdp_super_t super;
+       int fd, rv = 0;
+               
+       fd = open(dev, O_RDWR);
+       if (fd < 0) {
+               fprintf(stderr, Name ": Couldn't open %s for write - not zeroing\n",
+                       dev);
+               return 1;
+       } 
+       rv = load_super(fd, &super);
+       if (force && rv >= 5)
+               rv = 0; /* ignore bad data in superblock */
+       switch(rv) {
+       case 1:
+               fprintf(stderr, Name ": cannot file device size for %s: %s\n",
+                       dev, strerror(errno));
+               break;
+       case 2:
+               fprintf(stderr, Name ": %s is too small for md.\n", dev);
+               break;
+       case 3:
+       case 4:
+               fprintf(stderr, Name ": cannot access superblock on %s.\n", dev);
+               break;
+       case 5:
+       case 6:
+               fprintf(stderr, Name ": %s does not appear to have an MD superblock.\n", dev);
+               break;
+       }
+       if (!rv) {
+               memset(&super, 0, sizeof(super));
+               if (store_super(fd, &super)) {
+                       fprintf(stderr, Name ": Could not zero superblock on %s\n",
+                               dev);
+                       rv = 1;
+               }
+       }
+       close(fd);
+       return rv;
+}
index 551345162d55a22a8152c00be71d03a3f65cd3d2..22cd52fea4948b4ea1b5f93af9282bdaa0a73cae 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 #
-# mdctl - manage Linux "md" devices aka RAID arrays.
+# mdadm - manage Linux "md" devices aka RAID arrays.
 #
 # Copyright (C) 2001-2002 Neil Brown <neilb@cse.unsw.edu.au>
 #
@@ -31,25 +31,28 @@ CC = gcc
 CFLAGS = -Wall,error,strict-prototypes -ggdb
 
 INSTALL = /usr/bin/install
-DESTDIR = /sbin
+DESTDIR = /.
+BINDIR  = /sbin
+MANDIR  = /usr/share/man/man8
 
-OBJS =  mdctl.o config.o  ReadMe.o util.o Manage.o Assemble.o Build.o Create.o Detail.o Examine.o Monitor.o dlink.o
+OBJS =  mdadm.o config.o  ReadMe.o util.o Manage.o Assemble.o Build.o Create.o Detail.o Examine.o Monitor.o dlink.o Kill.o
 
-all : mdctl mdctl.man
+all : mdadm mdadm.man
 
-mdctl : $(OBJS)
-       $(CC) -o mdctl $^
+mdadm : $(OBJS)
+       $(CC) -o mdadm $^
 
-mdctl.man : mdctl.8
-       nroff -man mdctl.8 > mdctl.man
+mdadm.man : mdadm.8
+       nroff -man mdadm.8 > mdadm.man
 
-$(OBJS) : mdctl.h
+$(OBJS) : mdadm.h
 
-install : mdctl
-       $(INSTALL) -m 755 mdctl $(DESTDIR)/sbin
+install : mdadm mdadm.8
+       $(INSTALL) -m 755 mdadm $(DESTDIR)/$(BINDIR)
+       $(INSTALL) -m 644 mdadm.8 $(DESTDIR)/$(MANDIR)
 
 clean : 
-       rm -f mdctl $(OBJS) core mdctl.man
+       rm -f mdadm $(OBJS) core mdadm.man
 
 dist : clean
        ./makedist
index cab49bcc04b2ed43a61e1fca8ea658197f6d1ee2..b3e048e6d5b7cf116706bb5eb4ba3084dcd62677 100644 (file)
--- a/Manage.c
+++ b/Manage.c
@@ -1,5 +1,5 @@
 /*
- * mdctl - manage Linux "md" devices aka RAID arrays.
+ * mdadm - manage Linux "md" devices aka RAID arrays.
  *
  * Copyright (C) 2001-2002 Neil Brown <neilb@cse.unsw.edu.au>
  *
@@ -27,7 +27,7 @@
  *           Australia
  */
 
-#include "mdctl.h"
+#include "mdadm.h"
 #include "md_u.h"
 #include "md_p.h"
 
index 4f4aa0ec9debec2ea8142fc82328e3ca9ed6b3b8..bdab9427bd87f5226a00a73202688a8fc319de34 100644 (file)
--- a/Monitor.c
+++ b/Monitor.c
@@ -1,5 +1,5 @@
 /*
- * mdctl - manage Linux "md" devices aka RAID arrays.
+ * mdadm - manage Linux "md" devices aka RAID arrays.
  *
  * Copyright (C) 2001-2002 Neil Brown <neilb@cse.unsw.edu.au>
  *
@@ -27,7 +27,7 @@
  *           Australia
  */
 
-#include       "mdctl.h"
+#include       "mdadm.h"
 #include       "md_p.h"
 #include       "md_u.h"
 #include       <sys/signal.h>
index 5128cbfcd1933747479be9d91a12977f304b057d..e13075c3077149e92fb8496200367cdcaea6d6e2 100644 (file)
--- a/ReadMe.c
+++ b/ReadMe.c
@@ -1,5 +1,5 @@
 /*
- * mdctl - manage Linux "md" devices aka RAID arrays.
+ * mdadm - manage Linux "md" devices aka RAID arrays.
  *
  * Copyright (C) 2001-2002 Neil Brown <neilb@cse.unsw.edu.au>
  *
  *           Australia
  */
 
-#include "mdctl.h"
+#include "mdadm.h"
 
-char Version[] = Name " - v0.6 -  7 March 2002\n";
+char Version[] = Name " - v0.7 -  8 March 2002\n";
 /*
  * File: ReadMe.c
  *
  * This file contains general comments about the implementation
- * and the various usage messages that can be displayed by mdctl
+ * and the various usage messages that can be displayed by mdadm
  *
- * mdctl is a single program that can be used to control Linux md devices.
+ * mdadm is a single program that can be used to control Linux md devices.
  * It is intended to provide all the functionality of the mdtools and
  * raidtools but with a very different interface.
- * mdctl can perform all functions without a configuration file.
+ * mdadm can perform all functions without a configuration file.
  * There is the option of using a configuration file, but not in the same
  * way that raidtools uses one
  * raidtools uses a configuration file to describe how to create a RAID
@@ -48,7 +48,7 @@ char Version[] = Name " - v0.6 -  7 March 2002\n";
  * file for such things as stopping a raid array which needs to know
  * nothing about the array.
  *
- * The configuration file that can be used by mdctl lists two
+ * The configuration file that can be used by mdadm lists two
  * different things:
  * 1/ a mapping from uuid to md device to identify which arrays are
  *    expect and what names (numbers) they should be given
@@ -58,7 +58,7 @@ char Version[] = Name " - v0.6 -  7 March 2002\n";
  */
 
 /*
- * mdctl has 4 major modes of operation:
+ * mdadm has 4 major modes of operation:
  * 1/ Create
  *     This mode is used to create a new array with a superbock
  *     It can progress in several step create-add-add-run
@@ -66,7 +66,7 @@ char Version[] = Name " - v0.6 -  7 March 2002\n";
  * 2/ Assemble
  *     This mode is used to assemble the parts of a previously created
  *     array into an active array.  Components can be explicitly given
- *     or can be searched for.  mdctl (optionally) check that the components
+ *     or can be searched for.  mdadm (optionally) check that the components
  *     do form a bonafide array, and can, on request, fiddle superblock
  *     version numbers so as to assemble a faulty array.
  * 3/ Build
@@ -87,6 +87,8 @@ struct option long_options[] = {
     {"detail",    0, 0, 'D'},
     {"examine",   0, 0, 'E'},
     {"follow",    0, 0, 'F'},
+    {"grow",      0, 0, 'G'}, /* not yet implemented */
+    {"zero-superblock", 0, 0, 'H'},
 
     /* synonyms */
     {"monitor",   0, 0, 'F'},
@@ -136,21 +138,21 @@ struct option long_options[] = {
 };
 
 char Usage[] =
-"Usage: mdctl --help\n"
+"Usage: mdadm --help\n"
 "  for help\n"
 ;
 
 char Help[] =
-"Usage: mdctl --create device options...\n"
-"       mdctl --assemble device options...\n"
-"       mdctl --build device options...\n"
-"       mdctl --detail device\n"
-"       mdctl --examine device\n"
-"       mdctl --follow options...\n"
-"       mdctl device options...\n"
-" mdctl is used for controlling Linux md devices (aka RAID arrays)\n"
+"Usage: mdadm --create device options...\n"
+"       mdadm --assemble device options...\n"
+"       mdadm --build device options...\n"
+"       mdadm --detail device\n"
+"       mdadm --examine device\n"
+"       mdadm --follow options...\n"
+"       mdadm device options...\n"
+" mdadm is used for controlling Linux md devices (aka RAID arrays)\n"
 " For detail help on major modes use, e.g.\n"
-"         mdctl --assemble --help\n"
+"         mdadm --assemble --help\n"
 "\n"
 "Any parameter that does not start with '-' is treated as a device name\n"
 "The first such name is normally the name of an md device.  Subsequent\n"
@@ -167,7 +169,7 @@ char Help[] =
 "\n"
 "  --help        -h   : This help message or, after above option,\n"
 "                       mode specific help message\n"
-"  --version     -V   : Print version information for mdctl\n"
+"  --version     -V   : Print version information for mdadm\n"
 "  --verbose     -v   : Be more verbose about what is happening\n"
 "\n"
 " For create or build:\n"
@@ -209,11 +211,12 @@ char Help[] =
 "  --stop        -S   : deactive array, releasing all resources\n"
 "  --readonly    -o   : mark array as readonly\n"
 "  --readwrite   -w   : mark array as readwrite\n"
+"  --zero-superblock  : erase the MD superblock from a device.\n"
 ;
 
 
 char Help_create[] =
-"Usage:  mdctl --create device -chunk=X --level=Y --raid-disks=Z devices\n"
+"Usage:  mdadm --create device -chunk=X --level=Y --raid-disks=Z devices\n"
 "\n"
 " This usage will initialise a new md array and possibly associate some\n"
 " devices with it.  If enough devices are given to complete the array,\n"
@@ -240,7 +243,7 @@ char Help_create[] =
 ;
 
 char Help_build[] =
-"Usage:  mdctl --build device -chunk=X --level=Y --raid-disks=Z devices\n"
+"Usage:  mdadm --build device -chunk=X --level=Y --raid-disks=Z devices\n"
 "\n"
 " This usage is similar to --create.  The difference is that it creates\n"
 " a legacy array with a superblock.  With these arrays there is no\n"
@@ -253,12 +256,12 @@ char Help_build[] =
 ;
 
 char Help_assemble[] =
-"Usage: mdctl --assemble device options...\n"
-"       mdctl --assemble --scan options...\n"
+"Usage: mdadm --assemble device options...\n"
+"       mdadm --assemble --scan options...\n"
 "\n"
 "This usage assembles one or more raid arrays from pre-existing\n"
 "components.\n"
-"For each array, mdctl needs to know the md device, the identify of\n"
+"For each array, mdadm needs to know the md device, the identify of\n"
 "the array, and a number of sub devices. These can be found in a number\n"
 "of ways.\n"
 "\n"
diff --git a/TAGS b/TAGS
index 6c159c9b436e765cc15df76d6cdf1641d84b6a5b..a7e975c7cfa666e442caf1eea71ea164187d21ea 100644 (file)
--- a/TAGS
+++ b/TAGS
@@ -1,4 +1,110 @@
 \f
+Assemble.c,22
+int Assemble(\7f34,1176
+\f
+Build.c,100
+#define REGISTER_DEV \7f32,1140
+#define START_MD \7f33,1181
+#define STOP_MD \7f34,1222
+int Build(\7f36,1264
+\f
+COPYING,99
+program will \7fwill\ 152,2561
+program proprietary.\7fproprietary\ 153,2632
+PROGRAM PROVE \7fPROVE\ 1267,14397
+\f
+ChangeLog,294
+    -   When --assemble --force,\7f13,443
+    -   When marking drives as not-failed in the superblock,\7f16,627
+       are passed as unsigned lock,\7f23,1044
+    -   If HOT_ADD_DISK failes for -a,\7f24,1100
+       if we cannot read from the array,\7f25,1166
+       and mdctl.conf compatible description with uuid=\7f31,1443
+\f
+Create.c,20
+int Create(\7f34,1176
+\f
+Detail.c,20
+int Detail(\7f34,1176
+\f
+Examine.c,21
+int Examine(\7f38,1285
+\f
+Kill.c,18
+int Kill(\7f37,1237
+\f
+Makefile,12
+CC \7f30,1091
+\f
+Manage.c,161
+#define REGISTER_DEV \7f34,1176
+#define START_MD \7f35,1217
+#define STOP_MD \7f36,1258
+int Manage_ro(\7f38,1300
+int Manage_runstop(\7f75,2154
+int Manage_subdevs(\7f118,3161
+\f
+Monitor.c,49
+int Monitor(\7f37,1283
+static void alert(\7f175,4727
+\f
+ReadMe.c,266
+char Version[\7f32,1140
+char short_options[\7f81,3226
+struct option long_options[\7f82,3290
+char Usage[\7f140,4885
+char Help[\7f145,4942
+char Help_create[\7f218,8393
+char Help_build[\7f245,9615
+char Help_assemble[\7f258,10155
+mapping_t r5layout[\7f317,13101
+mapping_t pers[\7f331,13317
+\f
+TODO,590
+* write proc.c to parse /proc/mdstat file,\7f5,65
+   Build list of arrays:  name,\7f6,140
+* --detail --scan to read mdctl.conf,\7f8,189
+* --detail --scan to read mdctl.conf, and then iterate over these,\7f8,189
+- set md_minor,\7f34,933
+- for create raid5,\7f35,976
+   all working,\7f36,1019
+   one missing,\7f37,1050
+   one missing, one spare,\7f37,1050
+- when RUN_ARRAY,\7f40,1152
+- get --detail to extract extra stuff from superblock,\7f42,1206
+- when --assemble --scan,\7f48,1368
+- when --assemble --scan, if an underlying device is an md device,\7f48,1368
+ARRAY lines in config file to have super_minor=\7f62,1797
+\f
+config.c,479
+char DefaultConfFile[\7f68,2401
+char *keywords[\7f70,2446
+int match_keyword(\7f77,2645
+char *conf_word(\7f97,3153
+char *conf_line(\7f163,4744
+void free_line(\7f184,5046
+struct conf_dev \7fconf_dev\ 1195,5188
+} *cdevlist \7f198,5249
+int devline(\7f202,5272
+mddev_ident_t mddevlist \7f220,5595
+mddev_ident_t *mddevlp \7f221,5627
+void arrayline(\7f223,5665
+int loaded \7f303,7978
+void load_conffile(\7f305,7995
+mddev_ident_t conf_get_ident(\7f338,8486
+mddev_dev_t conf_get_devs(\7f348,8688
+int match_oneof(\7f383,9316
+\f
+dlink.c,177
+void *dl_head(\7f11,180
+void dl_free(\7f20,289
+void dl_init(\7f26,363
+void dl_insert(\7f32,430
+void dl_add(\7f40,598
+void dl_del(\7f48,763
+char *dl_strndup(\7f57,969
+char *dl_strdup(\7f73,1176
+\f
 dlink.h,193
 struct __dl_head\7f__dl_head\ 15,100
 #define        dl_alloc(\7fdl_alloc\ 111,187
@@ -7,6 +113,11 @@ struct __dl_head\7f__dl_head\ 15,100
 #define dl_next(\7fdl_next\ 115,391
 #define dl_prev(\7fdl_prev\ 116,461
 \f
+makedist,127
+target=\7f3,11
+( cd .. ; ln -s mdctl mdctl-$version \7f19,352
+( cd .. ; ln -s mdctl mdctl-$version ; tar czhvf - --exclude=\7f19,352
+\f
 md_p.h,1316
 #define _MD_P_H\7f16,582
 #define MD_RESERVED_BYTES      \7f44,1414
@@ -41,8 +152,8 @@ typedef struct mdp_device_descriptor_s \7fmdp_device_descriptor_s\ 182,2946
 #define MD_SB_CLEAN    \7f96,3390
 #define MD_SB_ERRORS   \7f97,3413
 typedef struct mdp_superblock_s \7fmdp_superblock_s\ 199,3438
-} mdp_super_t;\7fmdp_super_t\ 1164,5820
-static inline __u64 md_event(\7f166,5836
+} mdp_super_t;\7fmdp_super_t\ 1164,5835
+static inline __u64 md_event(\7f166,5851
 \f
 md_u.h,1118
 #define _MD_U_H\7f16,590
@@ -77,123 +188,73 @@ typedef struct mdu_start_info_s \7fmdu_start_info_s\ 197,2713
 typedef struct mdu_param_s\7fmdu_param_s\ 1108,2878
 } mdu_param_t;\7fmdu_param_t\ 1113,3014
 \f
-mdctl.h,826
-#define        __USE_LARGEFILE64\7f30,1115
-#define        MD_MAJOR \7f47,1491
-#define Name \7f52,1531
-extern char short_options[\7f54,1553
-extern struct option long_options[\7f55,1582
-extern char Version[\7f56,1619
-extern char Version[], Usage[\7f56,1619
-extern char Version[], Usage[], Help[\7f56,1619
-extern char Version[], Usage[], Help[], Help_create[\7f56,1619
-extern char Version[], Usage[], Help[], Help_create[], Help_build[\7f56,1619
-extern char Version[], Usage[], Help[], Help_create[], Help_build[], Help_assemble[\7f56,1619
-typedef struct mddev_ident_s \7fmddev_ident_s\ 168,2055
-} *mddev_ident_t;\7fmddev_ident_t\ 180,2292
-typedef struct mddev_dev_s \7fmddev_dev_s\ 183,2359
-} *mddev_dev_t;\7fmddev_dev_t\ 186,2431
-typedef struct mapping \7fmapping\ 188,2448
-} mapping_t;\7fmapping_t\ 191,2496
-extern mapping_t r5layout[\7f95,2606
-extern mapping_t r5layout[], pers[\7f95,2606
-\f
-Assemble.c,22
-int Assemble(\7f34,1171
-\f
-Build.c,100
-#define REGISTER_DEV \7f32,1135
-#define START_MD \7f33,1176
-#define STOP_MD \7f34,1217
-int Build(\7f36,1259
+mdctl.8,252
+real block devices. This allows multiple devices \7f14,241
+{left,right}-{,a}symmetric,\7f185,4006
+{left,right}-{,a}symmetric, la,\7f185,4006
+{left,right}-{,a}symmetric, la, ra,\7f185,4006
+{left,right}-{,a}symmetric, la, ra, ls,\7f185,4006
+.BR --layout=\7f188,4087
 \f
-Create.c,20
-int Create(\7f34,1171
-\f
-Detail.c,20
-int Detail(\7f34,1171
-\f
-Examine.c,21
-int Examine(\7f37,1261
-\f
-Manage.c,161
-#define REGISTER_DEV \7f34,1171
-#define START_MD \7f35,1212
-#define STOP_MD \7f36,1253
-int Manage_ro(\7f38,1295
-int Manage_runstop(\7f75,2149
-int Manage_subdevs(\7f118,3161
-\f
-ReadMe.c,265
-char Version[\7f32,1135
-char short_options[\7f81,3222
-struct option long_options[\7f82,3280
-char Usage[\7f123,4484
-char Help[\7f128,4541
-char Help_create[\7f185,7233
-char Help_build[\7f212,8453
-char Help_assemble[\7f225,8993
-mapping_t r5layout[\7f284,11939
-mapping_t pers[\7f298,12155
-\f
-config.c,479
-char DefaultConfFile[\7f68,2396
-char *keywords[\7f70,2441
-int match_keyword(\7f77,2640
-char *conf_word(\7f97,3148
-char *conf_line(\7f163,4739
-void free_line(\7f184,5041
-struct conf_dev \7fconf_dev\ 1195,5183
-} *cdevlist \7f198,5244
-int devline(\7f202,5267
-mddev_ident_t mddevlist \7f220,5590
-mddev_ident_t *mddevlp \7f221,5622
-void arrayline(\7f223,5660
-int loaded \7f289,7453
-void load_conffile(\7f291,7470
-mddev_ident_t conf_get_ident(\7f324,7961
-mddev_dev_t conf_get_devs(\7f334,8163
-int match_oneof(\7f369,8791
+mdctl.c,64
+int open_mddev(\7f33,1158
+int main(\7f50,1477
+#define O(\7fO\ 1177,4288
 \f
-dlink.c,177
-void *dl_head(\7f11,180
-void dl_free(\7f20,289
-void dl_init(\7f26,363
-void dl_insert(\7f32,430
-void dl_add(\7f40,598
-void dl_del(\7f48,763
-char *dl_strndup(\7f57,969
-char *dl_strdup(\7f73,1176
+mdctl.h,855
+#define        __USE_LARGEFILE64\7f30,1120
+#define        MD_MAJOR \7f47,1496
+#define Name \7f52,1536
+extern char short_options[\7f54,1558
+extern struct option long_options[\7f55,1587
+extern char Version[\7f56,1624
+extern char Version[], Usage[\7f56,1624
+extern char Version[], Usage[], Help[\7f56,1624
+extern char Version[], Usage[], Help[], Help_create[\7f56,1624
+extern char Version[], Usage[], Help[], Help_create[], Help_build[\7f56,1624
+extern char Version[], Usage[], Help[], Help_create[], Help_build[], Help_assemble[\7f56,1624
+typedef struct mddev_ident_s \7fmddev_ident_s\ 168,2060
+} *mddev_ident_t;\7fmddev_ident_t\ 183,2389
+typedef struct mddev_dev_s \7fmddev_dev_s\ 186,2456
+} *mddev_dev_t;\7fmddev_dev_t\ 192,2644
+typedef struct mapping \7fmapping\ 194,2661
+} mapping_t;\7fmapping_t\ 197,2709
+#define Sendmail \7f100,2740
+extern mapping_t r5layout[\7f105,2884
+extern mapping_t r5layout[], pers[\7f105,2884
 \f
-mdctl.c,64
-int open_mddev(\7f33,1153
-int main(\7f50,1472
-#define O(\7fO\ 1149,3610
+mdctl.spec,235
+Summary: mdctl is used for controlling Linux md devices \7f1,0
+option of using a configuration file,\7f18,630
+raidtools uses a configuration file to describe how to create a RAID array,\7f21,718
+Further,\7f23,871
+stopping a raid array,\7f24,941
 \f
 raid5extend.c,39
 int phys2log(\7f2,1
 raid5_extend(\7f46,902
 \f
-util.c,573
-int parse_uuid(\7f40,1354
-int md_get_version(\7f82,2117
-int get_linux_version(\7f101,2476
-int enough(\7f113,2673
-int same_uuid(\7f129,2923
-void uuid_from_super(\7f139,3052
-int compare_super(\7f153,3329
-int load_super(\7f187,4292
-int store_super(\7f227,4950
-int check_ext2(\7f253,5321
-int check_reiser(\7f284,6084
-int check_raid(\7f308,6640
-int ask(\7f324,7003
-char *map_num(\7f344,7368
-int map_name(\7f354,7503
-struct devmap \7fdevmap\ 1369,7832
-} *devlist \7f373,7911
-int devlist_ready \7f374,7930
-#define  __USE_XOPEN_EXTENDED\7f376,7954
-int add_dev(\7f380,8003
-char *map_dev(\7f396,8370
-int calc_sb_csum(\7f412,8645
+util.c,600
+int parse_uuid(\7f40,1359
+int md_get_version(\7f82,2122
+int get_linux_version(\7f101,2481
+int enough(\7f113,2678
+int same_uuid(\7f129,2928
+void uuid_from_super(\7f139,3057
+int compare_super(\7f153,3334
+int load_super(\7f187,4297
+int store_super(\7f227,4955
+int check_ext2(\7f253,5326
+int check_reiser(\7f284,6089
+int check_raid(\7f308,6645
+int ask(\7f324,7008
+char *map_num(\7f344,7373
+int map_name(\7f354,7508
+struct devmap \7fdevmap\ 1369,7837
+} *devlist \7f373,7916
+int devlist_ready \7f374,7935
+#define  __USE_XOPEN_EXTENDED\7f376,7959
+int add_dev(\7f380,8008
+char *map_dev(\7f396,8375
+int calc_sb_csum(\7f412,8650
+char *human_size(\7f428,9046
diff --git a/TODO b/TODO
index a23e0fe8851c59c0c354e242f559fa0fc3174572..061a2b42499d5d257f19224121d473d524642db3 100644 (file)
--- a/TODO
+++ b/TODO
@@ -5,7 +5,7 @@
 * write proc.c to parse /proc/mdstat file, and maybe /proc/partitions too.
    Build list of arrays:  name, rebuild-percent
 
-* --detail --scan to read mdctl.conf, and then iterate over these,
+* --detail --scan to read mdadm.conf, and then iterate over these,
     but assume --brief.  --verbose can override
     check each subdevice to see if it is in conf_get_devs.
     Warn if not.
@@ -23,7 +23,7 @@
      spare added
 
 ------------------------------------
-- --examine --scan scans all drives and build an mdctl.conf file DONE
+- --examine --scan scans all drives and build an mdadm.conf file DONE
 
 - check superblock checksum in examine DONE
 - report "chunk" or "rounding" depending on raid level DONE
@@ -49,9 +49,9 @@
   then try to assemble that device first.
 
 
-- mdctl -S /dev/md0 /dev/md1 gives internal error FIXED
+- mdadm -S /dev/md0 /dev/md1 gives internal error FIXED
 
-- mdctl --detail --scan print summary of what it can find?
+- mdadm --detail --scan print summary of what it can find?
 
 
 ---------
index 4fc381c046c109f5b50e5f3d3f0fa5e2fa322764..ea2f971ebce4469f6f777932da520cb5f1fbeb59 100644 (file)
--- a/config.c
+++ b/config.c
@@ -1,5 +1,5 @@
 /*
- * mdctl - manage Linux "md" devices aka RAID arrays.
+ * mdadm - manage Linux "md" devices aka RAID arrays.
  *
  * Copyright (C) 2001-2002 Neil Brown <neilb@cse.unsw.edu.au>
  *
@@ -27,7 +27,7 @@
  *           Australia
  */
 
-#include       "mdctl.h"
+#include       "mdadm.h"
 #include       "dlink.h"
 #include       <glob.h>
 #include       <fnmatch.h>
@@ -65,7 +65,7 @@
  *
  */
 
-char DefaultConfFile[] = "/etc/mdctl.conf";
+char DefaultConfFile[] = "/etc/mdadm.conf";
 
 char *keywords[] = { "device", "array", NULL };
 
index dae9949b3be87bfd6df1980b7c35bd11c4e54535..73f1ea31f976f0663cf34a2c8d63f94301219fd0 100755 (executable)
--- a/makedist
+++ b/makedist
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-target=${1-~/public_html/source/mdctl}
+target=${1-~/public_html/source/mdadm}
 if [ -d $target ]
 then :
 else echo $target is not a directory
@@ -9,13 +9,13 @@ fi
 set `grep '^char Version' ReadMe.c `
 version=`echo $7 | sed 's/v//'`
 echo version = $version
-base=mdctl-$version.tgz
+base=mdadm-$version.tgz
 if [ -f $target/$base ] 
 then 
   echo $target/$base exists.
   exit 1
 fi
 trap "rm $target/$base; exit" 1 2 3
-( cd .. ; ln -s mdctl mdctl-$version ; tar czhvf - --exclude='*,v' --exclude='*.o' --exclude mdctl --exclude=RCS mdctl-$version ; rm mdctl-$version )  > $target/$base
+( cd .. ; ln -s mdadm mdadm-$version ; tar czhvf - --exclude='*,v' --exclude='*.o' --exclude mdadm --exclude=RCS mdadm-$version ; rm mdadm-$version )  > $target/$base
 chmod a+r $target/$base
 ls -l $target/$base
diff --git a/mdctl.8 b/mdadm.8
similarity index 94%
rename from mdctl.8
rename to mdadm.8
index 153d7b5d793692b2ea0aa1b9f4d8a6a7d2fac304..7eba10ca1dc698ea4db717ddb896a0c41c2c26ae 100644 (file)
--- a/mdctl.8
+++ b/mdadm.8
@@ -1,13 +1,13 @@
 .\" -*- nroff -*-
-.TH mdctl 8
+.TH mdadm 8
 .SH NAME
-mdctl \- manage MD devices
+mdadm \- manage MD devices
 .I aka
 Linux Software Raid.
 
 .SH SYNOPSIS
 
-.BI mdctl " [mode] <raiddevice> [options] <subdevices>"
+.BI mdadm " [mode] <raiddevice> [options] <subdevices>"
 
 .SH DESCRIPTION 
 RAID devices are virtual devices created from two or more
@@ -32,29 +32,29 @@ and
 
 Recent kernels (2002) also support a mode known as
 .BR MULTIPATH .
-.B mdctl
+.B mdadm
 does not support MULTIPATH as yet.
 
-.B mdctl
+.B mdadm
 is a program that can be used to create and manage MD devices.  As
 such it provides a similar set of functionality to the
 .B raidtools
 packages.
 The key differences between
-.B mdctl
+.B mdadm
 and
 .B raidtools
 are:
 .IP \(bu 4
-.B mdctl
+.B mdadm
 is a single program and not a collection of programs.
 .IP \(bu 4
-.B mdctl
+.B mdadm
 can perform (almost) all of its functions without having a
-configuration file.  Also mdctl helps with management of the configuration
+configuration file.  Also mdadm helps with management of the configuration
 file.
 .IP \(bu 4
-.B mdctl
+.B mdadm
 can provide information about your arrays (through Detail and Examine)
 that
 .B  raidtools
@@ -62,17 +62,17 @@ cannot.
 .IP \(bu 4
 .B raidtools
 can manage MULTIPATH devices which
-.B mdctl
+.B mdadm
 cannot yet manage.
 
 .SH MODES
-mdctl has 7 major modes of operation:
+mdadm has 7 major modes of operation:
 .TP
 .B Assemble
 Assemble the parts of a previously created
 array into an active array. Components can be explicitly given
 or can be searched for. 
-.B mdctl
+.B mdadm
 checks that the components
 do form a bona fide array, and can, on request, fiddle superblock
 information so as to assemble a faulty array.
@@ -99,7 +99,7 @@ Examine a device to see if it is part of an md array, and print out
 the details of that array.
 This mode can also be used to examine a large number of devices and to
 print out a summary of the arrays found in a format suitable for the
-.B mdctl.conf
+.B mdadm.conf
 configuration file.
 
 .TP
@@ -150,7 +150,7 @@ Display help message or, after above option, mode specific help message.
 
 .TP
 .BR -V ", " --version
-Print version information for mdctl.
+Print version information for mdadm.
 
 .TP
 .BR -v ", " --verbose
@@ -224,7 +224,7 @@ the array is later assembled as /dev/md2.
 .TP
 .BR -c ", " --config=
 config file.  Default is
-.BR /etc/mdctl.conf .
+.BR /etc/mdadm.conf .
 
 .TP
 .BR -s ", " --scan
@@ -285,22 +285,22 @@ mark array as readwrite.
 
 .HP 12
 Usage:
-.B mdctl --assemble
+.B mdadm --assemble
 .I device options...
 .HP 12
 Usage:
-.B mdctl --assemble --scan
+.B mdadm --assemble --scan
 .I  options...
 
 .PP
 This usage assembles one or more raid arrays from pre-existing components.
-For each array, mdctl needs to know the md device, the identity of the
+For each array, mdadm needs to know the md device, the identity of the
 array, and a number of sub devices. These can be found in a number of ways.
 
 The md device is either given before 
 .B --scan
 or is found from the config file. In the latter case, multiple md devices
-can be started with a single mdctl command.
+can be started with a single mdadm command.
 
 The identity can be given with the 
 .B --uuid
@@ -319,7 +319,7 @@ The config file is only used if explicitly named with
 or requested with 
 .B --scan. 
 In the later case,
-.B /etc/mdctl.conf
+.B /etc/mdadm.conf
 is used.
 
 If 
@@ -341,7 +341,7 @@ flag.
 
 .HP 12
 Usage:
-.B mdctl --build
+.B mdadm --build
 .I device
 .BI --chunk= X
 .BI --level= Y
@@ -363,7 +363,7 @@ and the array will be started once complete.
 
 .HP 12
 Usage:
-.B mdctl --create
+.B mdadm --create
 .I device
 .BI --chunk= X
 .BI --level= Y
@@ -406,29 +406,29 @@ start the array readonly - not supported yet.
 .SH DETAIL MODE
 .HP 12
 Usage:
-.B mdctl --detail
+.B mdadm --detail
 .RB [ --brief ]
 .I device ...
 .PP
 
 This usage sill print out the details of the given array including a
 list of component devices.  To determine names for the devices,
-.B mdctl
+.B mdadm
 searches
 .B /dev
 for device files with the right major and minor numbers.
 
 With
 .B --brief
-.B mdctl
+.B mdadm
 prints a single line that identifies the level, number of disks, and
 UUID of the array.  This line is suitable for inclusion in
-.BR /etc/mdctl.conf .
+.BR /etc/mdadm.conf .
 
 .SH EXAMINE MODE
 .HP 12
 Usage:
-.B mdctl --examine
+.B mdadm --examine
 .RB [ --scan ]
 .RB [ --brief ]
 .I device ...
@@ -449,7 +449,7 @@ but this implication can be countered by specifying
 
 With
 .B --brief
-.B mdctl
+.B mdadm
 will output an config file entry of each distinct array that was
 found.  This entry will list the UUID, the raid level, and a list of
 the individual devices on which a superblock for that array was found.
@@ -458,7 +458,7 @@ configuration file, but should
 .B NOT
 be used blindly.  Often the array description that you want in the
 configuration file is much less specific than that given by
-.BR "mdctl -Bs" .
+.BR "mdadm -Bs" .
 For example, you normally do not want to list the devices,
 particularly if they are SCSI devices.
 
@@ -475,9 +475,9 @@ filesystem,
 .B /proc/mdstat
 gives you informations about md devices status.
 This file is not currently used by
-.BR mdctl .
+.BR mdadm .
 
-.SS /etc/mdctl.conf
+.SS /etc/mdadm.conf
 
 The config file is line oriented with, as usual, blank lines and lines
 beginning with a hash (or pound sign or sharp or number sign,
@@ -495,7 +495,7 @@ The DEVICE lines usually come first. All remaining words on the line
 are treated as names of devices, possibly containing wild cards (see
 .IR glob (7)).
 These list all the devices that
-.B mdctl
+.B mdadm
 is allowed to scan
 when looking for devices with RAID superblocks.
 Each line can contain multiple device names, and there can be multiple
@@ -534,14 +534,14 @@ listed there must also be listed on a DEVICE line.
 .B level=
 The value is a raid level.  This is normally used to identify an
 array, but is supported so that the output of
-.B "mdctl --examine --scan"
+.B "mdadm --examine --scan"
 can be use directly in the configuration file.
 .TP
 .B disks=
 The value is the number of disks in a complete active array.  As with
 .B level=
 this is mainly for compatibility with the output of
-.BR "mdctl --examine --scan" .
+.BR "mdadm --examine --scan" .
 
 .SH TODO
 
diff --git a/mdctl.c b/mdadm.c
similarity index 98%
rename from mdctl.c
rename to mdadm.c
index 054fbc4d253ef9c86d9af9ab947816181f0a41df..54a718bb1edd28bb9f0f7eb627ed0c639b73b340 100644 (file)
--- a/mdctl.c
+++ b/mdadm.c
@@ -1,5 +1,5 @@
 /*
- * mdctl - manage Linux "md" devices aka RAID arrays.
+ * mdadm - manage Linux "md" devices aka RAID arrays.
  *
  * Copyright (C) 2001-2002 Neil Brown <neilb@cse.unsw.edu.au>
  *
@@ -27,7 +27,7 @@
  *           Australia
  */
 
-#include "mdctl.h"
+#include "mdadm.h"
 #include "md_p.h"
 
 int open_mddev(char *dev)
@@ -101,6 +101,7 @@ int main(int argc, char *argv[])
                case 'D':
                case 'E':
                case 'F':
+               case 'H':
                        /* setting mode - only once */
                        if (mode) {
                                fprintf(stderr, Name ": --%s/-%c not allowed, mode already set to %s\n",
@@ -291,13 +292,12 @@ int main(int argc, char *argv[])
                        }
                        continue;
                case O('C','f'): /* force honouring of device list */
+               case O('A','f'): /* force assembly */
+               case O('H','f'): /* force zero */
                        force=1;
                        continue;
 
                        /* now for the Assemble options */
-               case O('A','f'): /* force assembly */
-                       force = 1;
-                       continue;
                case O('A','u'): /* uuid of array */
                        if (ident.uuid_set) {
                                fprintf(stderr, Name ": uuid cannot be set twice.  "
@@ -535,6 +535,11 @@ int main(int argc, char *argv[])
        case 'F': /* Follow */
                rv= Monitor(devlist, mailaddr, program,
                            delay?delay:60, configfile);
+               break;
+       case 'H': /* Zero superblock */
+               for (dv=devlist ; dv; dv=dv->next)
+                       rv |= Kill(dv->devname, force);
+               break;
        }
        exit(rv);
 }
diff --git a/mdctl.h b/mdadm.h
similarity index 97%
rename from mdctl.h
rename to mdadm.h
index 5aa61ce1cd80a72bfe205e1b14f3dacabbafb203..6959cfed42f8291301acf853e9599ec326332713 100644 (file)
--- a/mdctl.h
+++ b/mdadm.h
@@ -1,5 +1,5 @@
 /*
- * mdctl - manage Linux "md" devices aka RAID arrays.
+ * mdadm - manage Linux "md" devices aka RAID arrays.
  *
  * Copyright (C) 2001-2002 Neil Brown <neilb@cse.unsw.edu.au>
  *
@@ -49,7 +49,7 @@ extern __off64_t lseek64 __P ((int __fd, __off64_t __offset, int __whence));
 
 #include       "md_u.h"
 
-#define Name "mdctl"
+#define Name "mdadm"
 
 extern char short_options[];
 extern struct option long_options[];
@@ -137,6 +137,8 @@ extern int Monitor(mddev_dev_t devlist,
                  int period,
                  char *config);
 
+extern int Kill(char *dev, int force);
+
 extern int md_get_version(int fd);
 extern int get_linux_version();
 extern int parse_uuid(char *str, int uuid[4]);
similarity index 88%
rename from mdctl.man
rename to mdadm.man
index 682bc828d1edb63edd8a0e3722fc957cc0d08107..b12de9529d34c885f47f64d595f436a2140e3ef4 100644 (file)
--- a/mdctl.man
+++ b/mdadm.man
@@ -1,13 +1,13 @@
-mdctl(8)                                                 mdctl(8)
+mdadm(8)                                                 mdadm(8)
 
 
 
 N\bNA\bAM\bME\bE
-       mdctl - manage MD devices _\ba_\bk_\ba Linux Software Raid.
+       mdadm - manage MD devices _\ba_\bk_\ba Linux Software Raid.
 
 
 S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
-       m\bmd\bdc\bct\btl\bl _\b[_\bm_\bo_\bd_\be_\b] _\b<_\br_\ba_\bi_\bd_\bd_\be_\bv_\bi_\bc_\be_\b> _\b[_\bo_\bp_\bt_\bi_\bo_\bn_\bs_\b] _\b<_\bs_\bu_\bb_\bd_\be_\bv_\bi_\bc_\be_\bs_\b>
+       m\bmd\bda\bad\bdm\bm _\b[_\bm_\bo_\bd_\be_\b] _\b<_\br_\ba_\bi_\bd_\bd_\be_\bv_\bi_\bc_\be_\b> _\b[_\bo_\bp_\bt_\bi_\bo_\bn_\bs_\b] _\b<_\bs_\bu_\bb_\bd_\be_\bv_\bi_\bc_\be_\bs_\b>
 
 
 D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
@@ -25,34 +25,34 @@ D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
        ing), R\bRA\bAI\bID\bD1\b1 (mirroring), R\bRA\bAI\bID\bD4\b4 and R\bRA\bAI\bID\bD5\b5.\b.
 
        Recent kernels (2002) also support a mode known as  M\bMU\bUL\bLT\bTI\bI-\b-
-       P\bPA\bAT\bTH\bH.  m\bmd\bdc\bct\btl\bl does not support MULTIPATH as yet.
+       P\bPA\bAT\bTH\bH.  m\bmd\bda\bad\bdm\bm does not support MULTIPATH as yet.
 
-       m\bmd\bdc\bct\btl\bl  is  a program that can be used to create and manage
+       m\bmd\bda\bad\bdm\bm  is  a program that can be used to create and manage
        MD devices.  As such it provides a similar  set  of  func-
        tionality  to the r\bra\bai\bid\bdt\bto\boo\bol\bls\bs packages.  The key differences
-       between m\bmd\bdc\bct\btl\bl and r\bra\bai\bid\bdt\bto\boo\bol\bls\bs are:
+       between m\bmd\bda\bad\bdm\bm and r\bra\bai\bid\bdt\bto\boo\bol\bls\bs are:
 
-       +\bo   m\bmd\bdc\bct\btl\bl is a single program and not a collection of pro-
+       +\bo   m\bmd\bda\bad\bdm\bm is a single program and not a collection of pro-
            grams.
 
-       +\bo   m\bmd\bdc\bct\btl\bl  can perform (almost) all of its functions with-
-           out having a configuration  file.   Also  mdctl  helps
+       +\bo   m\bmd\bda\bad\bdm\bm  can perform (almost) all of its functions with-
+           out having a configuration  file.   Also  mdadm  helps
            with management of the configuration file.
 
-       +\bo   m\bmd\bdc\bct\btl\bl   can  provide  information  about  your  arrays
+       +\bo   m\bmd\bda\bad\bdm\bm   can  provide  information  about  your  arrays
            (through Detail and Examine) that r\bra\bai\bid\bdt\bto\boo\bol\bls\bs cannot.
 
-       +\bo   r\bra\bai\bid\bdt\bto\boo\bol\bls\bs can manage  MULTIPATH  devices  which  m\bmd\bdc\bct\btl\bl
+       +\bo   r\bra\bai\bid\bdt\bto\boo\bol\bls\bs can manage  MULTIPATH  devices  which  m\bmd\bda\bad\bdm\bm
            cannot yet manage.
 
 
 M\bMO\bOD\bDE\bES\bS
-       mdctl has 7 major modes of operation:
+       mdadm has 7 major modes of operation:
 
        A\bAs\bss\bse\bem\bmb\bbl\ble\be
               Assemble  the  parts  of a previously created array
               into an active array. Components can be  explicitly
-              given  or  can  be searched for.  m\bmd\bdc\bct\btl\bl checks that
+              given  or  can  be searched for.  m\bmd\bda\bad\bdm\bm checks that
               the components do form a bona fide array, and  can,
               on  request, fiddle superblock information so as to
               assemble a faulty array.
@@ -76,7 +76,7 @@ M\bMO\bOD\bDE\bES\bS
               This mode can also be used to examine a large  num-
               ber  of  devices  and to print out a summary of the
               arrays  found  in  a  format   suitable   for   the
-              m\bmd\bdc\bct\btl\bl.\b.c\bco\bon\bnf\bf configuration file.
+              m\bmd\bda\bad\bdm\bm.\b.c\bco\bon\bnf\bf configuration file.
 
 
        F\bFo\bol\bll\blo\bow\bw o\bor\br M\bMo\bon\bni\bit\bto\bor\br
@@ -122,7 +122,7 @@ O\bOP\bPT\bTI\bIO\bON\bNS\bS
 
 
        -\b-V\bV, -\b--\b-v\bve\ber\brs\bsi\bio\bon\bn
-              Print version information for mdctl.
+              Print version information for mdadm.
 
 
        -\b-v\bv, -\b--\b-v\bve\ber\brb\bbo\bos\bse\be
@@ -197,7 +197,7 @@ F\bFo\bor\br a\bas\bss\bse\bem\bmb\bbl\ble\be:\b:
 
 
        -\b-c\bc, -\b--\b-c\bco\bon\bnf\bfi\big\bg=\b=
-              config file.  Default is /\b/e\bet\btc\bc/\b/m\bmd\bdc\bct\btl\bl.\b.c\bco\bon\bnf\bf.
+              config file.  Default is /\b/e\bet\btc\bc/\b/m\bmd\bda\bad\bdm\bm.\b.c\bco\bon\bnf\bf.
 
 
        -\b-s\bs, -\b--\b-s\bsc\bca\ban\bn
@@ -254,19 +254,19 @@ G\bGe\ben\bne\ber\bra\bal\bl m\bma\ban\bna\bag\bge\bem\bme\ben\bnt\bt
 
 
 A\bAS\bSS\bSE\bEM\bMB\bBL\bLY\bY M\bMO\bOD\bDE\bE
-       Usage: m\bmd\bdc\bct\btl\bl -\b--\b-a\bas\bss\bse\bem\bmb\bbl\ble\be _\bd_\be_\bv_\bi_\bc_\be _\bo_\bp_\bt_\bi_\bo_\bn_\bs_\b._\b._\b.
+       Usage: m\bmd\bda\bad\bdm\bm -\b--\b-a\bas\bss\bse\bem\bmb\bbl\ble\be _\bd_\be_\bv_\bi_\bc_\be _\bo_\bp_\bt_\bi_\bo_\bn_\bs_\b._\b._\b.
 
-       Usage: m\bmd\bdc\bct\btl\bl -\b--\b-a\bas\bss\bse\bem\bmb\bbl\ble\be -\b--\b-s\bsc\bca\ban\bn _\bo_\bp_\bt_\bi_\bo_\bn_\bs_\b._\b._\b.
+       Usage: m\bmd\bda\bad\bdm\bm -\b--\b-a\bas\bss\bse\bem\bmb\bbl\ble\be -\b--\b-s\bsc\bca\ban\bn _\bo_\bp_\bt_\bi_\bo_\bn_\bs_\b._\b._\b.
 
 
        This usage assembles one or more  raid  arrays  from  pre-
-       existing  components.  For each array, mdctl needs to know
+       existing  components.  For each array, mdadm needs to know
        the md device, the identity of the array, and a number  of
        sub devices. These can be found in a number of ways.
 
        The  md  device  is either given before -\b--\b-s\bsc\bca\ban\bn or is found
        from the config file. In  the  latter  case,  multiple  md
-       devices can be started with a single mdctl command.
+       devices can be started with a single mdadm command.
 
        The identity can be given with the -\b--\b-u\buu\bui\bid\bd option, with the
        -\b--\b-s\bsu\bup\bpe\ber\br-\b-m\bmi\bin\bno\bor\br option, can be found in in the config  file,
@@ -280,7 +280,7 @@ A\bAS\bSS\bSE\bEM\bMB\bBL\bLY\bY M\bMO\bOD\bDE\bE
 
        The  config  file  is  only  used if explicitly named with
        -\b--\b-c\bco\bon\bnf\bfi\big\bg or requested with -\b--\b-s\bsc\bca\ban\bn.\b.   In  the  later  case,
-       /\b/e\bet\btc\bc/\b/m\bmd\bdc\bct\btl\bl.\b.c\bco\bon\bnf\bf is used.
+       /\b/e\bet\btc\bc/\b/m\bmd\bda\bad\bdm\bm.\b.c\bco\bon\bnf\bf is used.
 
        If  -\b--\b-s\bsc\bca\ban\bn is not given, then the config file will only be
        used to find the identity of md arrays.
@@ -295,7 +295,7 @@ A\bAS\bSS\bSE\bEM\bMB\bBL\bLY\bY M\bMO\bOD\bDE\bE
 
 
 B\bBU\bUI\bIL\bLD\bD M\bMO\bOD\bDE\bE
-       Usage:  m\bmd\bdc\bct\btl\bl  -\b--\b-b\bbu\bui\bil\bld\bd  _\bd_\be_\bv_\bi_\bc_\be -\b--\b-c\bch\bhu\bun\bnk\bk=\b=_\bX -\b--\b-l\ble\bev\bve\bel\bl=\b=_\bY -\b--\b-r\bra\bai\bid\bd-\b-
+       Usage:  m\bmd\bda\bad\bdm\bm  -\b--\b-b\bbu\bui\bil\bld\bd  _\bd_\be_\bv_\bi_\bc_\be -\b--\b-c\bch\bhu\bun\bnk\bk=\b=_\bX -\b--\b-l\ble\bev\bve\bel\bl=\b=_\bY -\b--\b-r\bra\bai\bid\bd-\b-
                    d\bdi\bis\bsk\bks\bs=\b=_\bZ _\bd_\be_\bv_\bi_\bc_\be_\bs
 
 
@@ -312,7 +312,7 @@ B\bBU\bUI\bIL\bLD\bD M\bMO\bOD\bDE\bE
 
 
 C\bCR\bRE\bEA\bAT\bTE\bE M\bMO\bOD\bDE\bE
-       Usage: m\bmd\bdc\bct\btl\bl -\b--\b-c\bcr\bre\bea\bat\bte\be _\bd_\be_\bv_\bi_\bc_\be -\b--\b-c\bch\bhu\bun\bnk\bk=\b=_\bX -\b--\b-l\ble\bev\bve\bel\bl=\b=_\bY
+       Usage: m\bmd\bda\bad\bdm\bm -\b--\b-c\bcr\bre\bea\bat\bte\be _\bd_\be_\bv_\bi_\bc_\be -\b--\b-c\bch\bhu\bun\bnk\bk=\b=_\bX -\b--\b-l\ble\bev\bve\bel\bl=\b=_\bY
                    -\b--\b-r\bra\bai\bid\bd-\b-d\bdi\bis\bsk\bks\bs=\b=_\bZ _\bd_\be_\bv_\bi_\bc_\be_\bs
 
 
@@ -340,21 +340,21 @@ C\bCR\bRE\bEA\bAT\bTE\bE M\bMO\bOD\bDE\bE
 
 
 D\bDE\bET\bTA\bAI\bIL\bL M\bMO\bOD\bDE\bE
-       Usage: m\bmd\bdc\bct\btl\bl -\b--\b-d\bde\bet\bta\bai\bil\bl [-\b--\b-b\bbr\bri\bie\bef\bf] _\bd_\be_\bv_\bi_\bc_\be _\b._\b._\b.
+       Usage: m\bmd\bda\bad\bdm\bm -\b--\b-d\bde\bet\bta\bai\bil\bl [-\b--\b-b\bbr\bri\bie\bef\bf] _\bd_\be_\bv_\bi_\bc_\be _\b._\b._\b.
 
 
        This usage sill print out the details of the  given  array
        including a list of component devices.  To determine names
-       for the devices, m\bmd\bdc\bct\btl\bl searches /\b/d\bde\bev\bv for device files with
+       for the devices, m\bmd\bda\bad\bdm\bm searches /\b/d\bde\bev\bv for device files with
        the right major and minor numbers.
 
-       With  -\b--\b-b\bbr\bri\bie\bef\bf  m\bmd\bdc\bct\btl\bl  prints a single line that identifies
+       With  -\b--\b-b\bbr\bri\bie\bef\bf  m\bmd\bda\bad\bdm\bm  prints a single line that identifies
        the level, number of disks, and UUID of the  array.   This
-       line is suitable for inclusion in /\b/e\bet\btc\bc/\b/m\bmd\bdc\bct\btl\bl.\b.c\bco\bon\bnf\bf.
+       line is suitable for inclusion in /\b/e\bet\btc\bc/\b/m\bmd\bda\bad\bdm\bm.\b.c\bco\bon\bnf\bf.
 
 
 E\bEX\bXA\bAM\bMI\bIN\bNE\bE M\bMO\bOD\bDE\bE
-       Usage: m\bmd\bdc\bct\btl\bl -\b--\b-e\bex\bxa\bam\bmi\bin\bne\be [-\b--\b-s\bsc\bca\ban\bn] [-\b--\b-b\bbr\bri\bie\bef\bf] _\bd_\be_\bv_\bi_\bc_\be _\b._\b._\b.
+       Usage: m\bmd\bda\bad\bdm\bm -\b--\b-e\bex\bxa\bam\bmi\bin\bne\be [-\b--\b-s\bsc\bca\ban\bn] [-\b--\b-b\bbr\bri\bie\bef\bf] _\bd_\be_\bv_\bi_\bc_\be _\b._\b._\b.
 
        This  usage will examine some block devices to see if that
        have a valid RAID superblock on them.  The information  in
@@ -365,14 +365,14 @@ E\bEX\bXA\bAM\bMI\bIN\bNE\bE M\bMO\bOD\bDE\bE
        tion  file  are  checked.  -\b--\b-s\bsc\bca\ban\bn implies -\b--\b-b\bbr\bri\bie\bef\bf but this
        implication can be countered by specifying -\b--\b-v\bve\ber\brb\bbo\bos\bse\be.
 
-       With -\b--\b-b\bbr\bri\bie\bef\bf m\bmd\bdc\bct\btl\bl will output an  config  file  entry  of
+       With -\b--\b-b\bbr\bri\bie\bef\bf m\bmd\bda\bad\bdm\bm will output an  config  file  entry  of
        each  distinct array that was found.  This entry will list
        the UUID, the raid level, and a  list  of  the  individual
        devices  on  which  a superblock for that array was found.
        This output will by syntactically suitable  for  inclusion
        in the configuration file, but should N\bNO\bOT\bT be used blindly.
        Often the array description that you want in the  configu-
-       ration file is much less specific than that given by m\bmd\bdc\bct\btl\bl
+       ration file is much less specific than that given by m\bmd\bda\bad\bdm\bm
        -\b-B\bBs\bs.  For example, you normally do not want  to  list  the
        devices, particularly if they are SCSI devices.
 
@@ -382,10 +382,10 @@ F\bFI\bIL\bLE\bES\bS
    /\b/p\bpr\bro\boc\bc/\b/m\bmd\bds\bst\bta\bat\bt
        If  you're  using the /\b/p\bpr\bro\boc\bc filesystem, /\b/p\bpr\bro\boc\bc/\b/m\bmd\bds\bst\bta\bat\bt gives
        you informations about md devices status.   This  file  is
-       not currently used by m\bmd\bdc\bct\btl\bl.
+       not currently used by m\bmd\bda\bad\bdm\bm.
 
 
-   /\b/e\bet\btc\bc/\b/m\bmd\bdc\bct\btl\bl.\b.c\bco\bon\bnf\bf
+   /\b/e\bet\btc\bc/\b/m\bmd\bda\bad\bdm\bm.\b.c\bco\bon\bnf\bf
        The  config  file  is  line oriented with, as usual, blank
        lines and lines beginning with a hash (or  pound  sign  or
        sharp  or  number  sign,  whichever  you  like to call it)
@@ -403,7 +403,7 @@ F\bFI\bIL\bLE\bES\bS
        The  DEVICE  lines usually come first. All remaining words
        on the line are treated as names of devices, possibly con-
        taining  wild  cards  (see  _\bg_\bl_\bo_\bb(7)).   These list all the
-       devices that m\bmd\bdc\bct\btl\bl is allowed to  scan  when  looking  for
+       devices that m\bmd\bda\bad\bdm\bm is allowed to  scan  when  looking  for
        devices with RAID superblocks.  Each line can contain mul-
        tiple device names,  and  there  can  be  multiple  DEVICE
        lines.  For example:
@@ -439,12 +439,12 @@ F\bFI\bIL\bLE\bES\bS
 
        l\ble\bev\bve\bel\bl=\b= The  value  is a raid level.  This is normally used
               to identify an array, but is supported so that  the
-              output   of  m\bmd\bdc\bct\btl\bl  -\b--\b-e\bex\bxa\bam\bmi\bin\bne\be  -\b--\b-s\bsc\bca\ban\bn  can  be  use
+              output   of  m\bmd\bda\bad\bdm\bm  -\b--\b-e\bex\bxa\bam\bmi\bin\bne\be  -\b--\b-s\bsc\bca\ban\bn  can  be  use
               directly in the configuration file.
 
        d\bdi\bis\bsk\bks\bs=\b= The value is the number  of  disks  in  a  complete
               active  array.   As  with l\ble\bev\bve\bel\bl=\b= this is mainly for
-              compatibility with the output  of  m\bmd\bdc\bct\btl\bl  -\b--\b-e\bex\bxa\bam\bmi\bin\bne\be
+              compatibility with the output  of  m\bmd\bda\bad\bdm\bm  -\b--\b-e\bex\bxa\bam\bmi\bin\bne\be
               -\b--\b-s\bsc\bca\ban\bn.
 
 
@@ -473,4 +473,4 @@ S\bSE\bEE\bE A\bAL\bLS\bSO\bO
 
 
 
-                                                         mdctl(8)
+                                                         mdadm(8)
index a40a1a4b404c969f3d20b1ec61adaeace5419497..e1f6eeccbd0ed991f0934e1d9dae874d8009ec3a 100644 (file)
@@ -1,20 +1,20 @@
-Summary: mdctl is used for controlling Linux md devices (aka RAID arrays)
-Name: mdctl
+Summary: mdadm is used for controlling Linux md devices (aka RAID arrays)
+Name: mdadm
 Version: 0.5
 Release: 1
-Source0: http://www.cse.unsw.edu.au/~neilb/source/mdctl/mdctl-%{version}.tgz
-URL: http://www.cse.unsw.edu.au/~neilb/source/mdctl/
+Source0: http://www.cse.unsw.edu.au/~neilb/source/mdadm/mdadm-%{version}.tgz
+URL: http://www.cse.unsw.edu.au/~neilb/source/mdadm/
 Copyright: GPL
 Group: Utilities/System
 BuildRoot: /var/tmp/%{name}-root
 Packager: Danilo Godec <danci@agenda.si>
 
 %description 
-mdctl is a single program that can be used to control Linux md devices. It
+mdadm is a single program that can be used to control Linux md devices. It
 is intended to provide all the functionality of the mdtools and raidtools
 but with a very different interface.
 
-mdctl can perform all functions without a configuration file. There is the
+mdadm can perform all functions without a configuration file. There is the
 option of using a configuration file, but not in the same way that raidtools
 uses one.
 
@@ -25,7 +25,7 @@ stopping a raid array, which needs to know nothing about the array.
 
 
 %prep
-%setup -q -n mdctl
+%setup -q -n mdadm
 
 %build
 make
@@ -33,7 +33,7 @@ make
 %install
 rm -rf $RPM_BUILD_ROOT
 mkdir -p $RPM_BUILD_ROOT/sbin
-install -m755 mdctl $RPM_BUILD_ROOT/sbin/
+install -m755 mdadm $RPM_BUILD_ROOT/sbin/
 
 %clean
 rm -rf $RPM_BUILD_ROOT
diff --git a/util.c b/util.c
index 17a7e87d6272b968445f588aa52dd5ad0655a2bd..5c70a8354dd78ad32de1c18ed1c3fb14cc1aa1ec 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1,5 +1,5 @@
 /*
- * mdctl - manage Linux "md" devices aka RAID arrays.
+ * mdadm - manage Linux "md" devices aka RAID arrays.
  *
  * Copyright (C) 2001-2002 Neil Brown <neilb@cse.unsw.edu.au>
  *
@@ -27,7 +27,7 @@
  *           Australia
  */
 
-#include       "mdctl.h"
+#include       "mdadm.h"
 #include       "md_p.h"
 #include       <sys/utsname.h>