]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - ReadMe.c
Create.c: fix uclibc build
[thirdparty/mdadm.git] / ReadMe.c
index d3fcb6132fe97f24292aef9c6c1faf3d3339e9c0..d57ebb6c2c3102d2f7cfc1540353a1216c88beb1 100644 (file)
--- a/ReadMe.c
+++ b/ReadMe.c
@@ -2,6 +2,7 @@
  * mdadm - manage Linux "md" devices aka RAID arrays.
  *
  * Copyright (C) 2001-2016 Neil Brown <neilb@suse.com>
+ * Copyright (C) 2016-2017 Jes Sorensen <Jes.Sorensen@gmail.com>
  *
  *
  *    This program is free software; you can redistribute it and/or modify
  *
  *    Author: Neil Brown
  *    Email: <neilb@suse.de>
+ *    Maintainer: Jes Sorensen
+ *    Email: <Jes.Sorensen@gmail.com>
  */
 
 #include "mdadm.h"
 
 #ifndef VERSION
-#define VERSION "3.4"
+#define VERSION "4.3"
 #endif
 #ifndef VERS_DATE
-#define VERS_DATE "28th January 2016"
+#define VERS_DATE "2024-02-15"
 #endif
-char Version[] = "mdadm - v" VERSION " - " VERS_DATE "\n";
+#ifndef EXTRAVERSION
+#define EXTRAVERSION ""
+#endif
+char Version[] = "mdadm - v" VERSION " - " VERS_DATE EXTRAVERSION "\n";
 
 /*
  * File: ReadMe.c
@@ -75,11 +81,12 @@ char Version[] = "mdadm - v" VERSION " - " VERS_DATE "\n";
  *     found, it is started.
  */
 
-char short_options[]="-ABCDEFGIQhVXYWZ:vqbc:i:l:p:m:n:x:u:c:d:z:U:N:sarfRSow1tye:";
+char short_options[]="-ABCDEFGIQhVXYWZ:vqbc:i:l:p:m:n:x:u:c:d:z:U:N:sarfRSow1tye:k:";
+char short_monitor_options[]="-ABCDEFGIQhVXYWZ:vqbc:i:l:p:m:r:n:x:u:c:d:z:U:N:safRSow1tye:k:";
 char short_bitmap_options[]=
-               "-ABCDEFGIQhVXYWZ:vqb:c:i:l:p:m:n:x:u:c:d:z:U:N:sarfRSow1tye:";
+               "-ABCDEFGIQhVXYWZ:vqb:c:i:l:p:m:n:x:u:c:d:z:U:N:sarfRSow1tye:k:";
 char short_bitmap_auto_options[]=
-               "-ABCDEFGIQhVXYWZ:vqb:c:i:l:p:m:n:x:u:c:d:z:U:N:sa:rfRSow1tye:";
+               "-ABCDEFGIQhVXYWZ:vqb:c:i:l:p:m:n:x:u:c:d:z:U:N:sa:rfRSow1tye:k:";
 
 struct option long_options[] = {
     {"manage",    0, 0, ManageOpt},
@@ -131,18 +138,21 @@ struct option long_options[] = {
     {"size",     1, 0, 'z'},
     {"auto",     1, 0, Auto}, /* also for --assemble */
     {"assume-clean",0,0, AssumeClean },
+    {"write-zeroes",0,0, WriteZeroes },
     {"metadata",  1, 0, 'e'}, /* superblock format */
     {"bitmap",   1, 0, Bitmap},
     {"bitmap-chunk", 1, 0, BitmapChunk},
     {"write-behind", 2, 0, WriteBehind},
     {"write-mostly",0, 0, WriteMostly},
+    {"failfast",  0, 0,  FailFast},
+    {"nofailfast",0, 0,  NoFailFast},
     {"re-add",    0, 0,  ReAdd},
     {"homehost",  1, 0,  HomeHost},
-    {"symlinks",  1, 0,  Symlinks},
     {"data-offset",1, 0, DataOffset},
     {"nodes",1, 0, Nodes}, /* also for --assemble */
     {"home-cluster",1, 0, ClusterName},
     {"write-journal",1, 0, WriteJournal},
+    {"consistency-policy", 1, 0, 'k'},
 
     /* For assemble */
     {"uuid",      1, 0, 'u'},
@@ -175,6 +185,7 @@ struct option long_options[] = {
 
     /* For Detail/Examine */
     {"brief",    0, 0, Brief},
+    {"no-devices",0, 0, NoDevices},
     {"export",   0, 0, 'Y'},
     {"sparc2.2",  0, 0, Sparc22},
     {"test",      0, 0, 't'},
@@ -336,7 +347,7 @@ char OptionHelp[] =
 */
 
 char Help_create[] =
-"Usage:  mdadm --create device -chunk=X --level=Y --raid-devices=Z devices\n"
+"Usage:  mdadm --create device --chunk=X --level=Y --raid-devices=Z devices\n"
 "\n"
 " This usage will initialise a new md array, associate some\n"
 " devices with it, and activate the array.   In order to create an\n"
@@ -357,27 +368,30 @@ char Help_create[] =
 " other levels.\n"
 "\n"
 " Options that are valid with --create (-C) are:\n"
-"  --bitmap=          : Create a bitmap for the array with the given filename\n"
-"                     : or an internal bitmap is 'internal' is given\n"
-"  --chunk=      -c   : chunk size in kibibytes\n"
-"  --rounding=        : rounding factor for linear array (==chunk size)\n"
-"  --level=      -l   : raid level: 0,1,4,5,6,10,linear,multipath and synonyms\n"
-"  --parity=     -p   : raid5/6 parity algorithm: {left,right}-{,a}symmetric\n"
-"  --layout=          : same as --parity, for RAID10: [fno]NN \n"
-"  --raid-devices= -n : number of active devices in array\n"
-"  --spare-devices= -x: number of spare (eXtra) devices in initial array\n"
-"  --size=       -z   : Size (in K) of each drive in RAID1/4/5/6/10 - optional\n"
-"  --data-offset=     : Space to leave between start of device and start\n"
-"                     : of array data.\n"
-"  --force       -f   : Honour devices as listed on command line.  Don't\n"
-"                     : insert a missing drive for RAID5.\n"
-"  --run         -R   : insist of running the array even if not all\n"
-"                     : devices are present or some look odd.\n"
-"  --readonly    -o   : start the array readonly - not supported yet.\n"
-"  --name=       -N   : Textual name for array - max 32 characters\n"
-"  --bitmap-chunk=    : bitmap chunksize in Kilobytes.\n"
-"  --delay=      -d   : bitmap update delay in seconds.\n"
-"  --write-journal=   : Specify journal device for RAID-4/5/6 array\n"
+"  --bitmap=          -b : Create a bitmap for the array with the given filename\n"
+"                        : or an internal bitmap if 'internal' is given\n"
+"  --chunk=           -c : chunk size in kibibytes\n"
+"  --rounding=           : rounding factor for linear array (==chunk size)\n"
+"  --level=           -l : raid level: 0,1,4,5,6,10,linear,multipath and synonyms\n"
+"  --parity=          -p : raid5/6 parity algorithm: {left,right}-{,a}symmetric\n"
+"  --layout=             : same as --parity, for RAID10: [fno]NN \n"
+"  --raid-devices=    -n : number of active devices in array\n"
+"  --spare-devices=   -x : number of spare (eXtra) devices in initial array\n"
+"  --size=            -z : Size (in K) of each drive in RAID1/4/5/6/10 - optional\n"
+"  --data-offset=        : Space to leave between start of device and start\n"
+"                        : of array data.\n"
+"  --force            -f : Honour devices as listed on command line.  Don't\n"
+"                        : insert a missing drive for RAID5.\n"
+"  --run              -R : insist of running the array even if not all\n"
+"                        : devices are present or some look odd.\n"
+"  --readonly         -o : start the array readonly - not supported yet.\n"
+"  --name=            -N : Textual name for array - max 32 characters\n"
+"  --bitmap-chunk=       : bitmap chunksize in Kilobytes.\n"
+"  --delay=           -d : bitmap update delay in seconds.\n"
+"  --write-journal=      : Specify journal device for RAID-4/5/6 array\n"
+"  --consistency-policy= : Specify the policy that determines how the array\n"
+"                     -k : maintains consistency in case of unexpected shutdown.\n"
+"  --write-zeroes        : Write zeroes to the disks before creating. This will bypass initial sync.\n"
 "\n"
 ;
 
@@ -465,7 +479,7 @@ char Help_assemble[] =
 ;
 
 char Help_manage[] =
-"Usage: mdadm arraydevice options component devices...\n"
+"Usage: mdadm [mode] arraydevice [options] <component devices...>\n"
 "\n"
 "This usage is for managing the component devices within an array.\n"
 "The --manage option is not needed and is assumed if the first argument\n"
@@ -551,28 +565,30 @@ char Help_grow[] =
 "reconfiguration.\n"
 "\n"
 "Options that are valid with the grow (-G --grow) mode are:\n"
-"  --level=       -l   : Tell mdadm what level to convert the array to.\n"
-"  --layout=      -p   : For a FAULTY array, set/change the error mode.\n"
-"                      : for other arrays, update the layout\n"
-"  --size=        -z   : Change the active size of devices in an array.\n"
-"                      : This is useful if all devices have been replaced\n"
-"                      : with larger devices.   Value is in Kilobytes, or\n"
-"                      : the special word 'max' meaning 'as large as possible'.\n"
-"  --assume-clean      : When increasing the --size, this flag will avoid\n"
-"                      : a resync of the new space\n"
-"  --chunk=       -c   : Change the chunksize of the array\n"
-"  --raid-devices= -n  : Change the number of active devices in an array.\n"
-"  --add=         -a   : Add listed devices as part of reshape.  This is\n"
-"                      : needed for resizing a RAID0 which cannot have\n"
-"                      : spares already present.\n"
-"  --bitmap=      -b   : Add or remove a write-intent bitmap.\n"
-"  --backup-file= file : A file on a different device to store data for a\n"
-"                      : short time while increasing raid-devices on a\n"
-"                      : RAID4/5/6 array. Also needed throughout a reshape\n"
-"                      : when changing parameters other than raid-devices\n"
-"  --array-size=  -Z   : Change visible size of array.  This does not change\n"
-"                      : any data on the device, and is not stable across restarts.\n"
-"  --data-offset=      : Location on device to move start of data to.\n"
+"  --level=           -l : Tell mdadm what level to convert the array to.\n"
+"  --layout=          -p : For a FAULTY array, set/change the error mode.\n"
+"                        : for other arrays, update the layout\n"
+"  --size=            -z : Change the active size of devices in an array.\n"
+"                        : This is useful if all devices have been replaced\n"
+"                        : with larger devices.   Value is in Kilobytes, or\n"
+"                        : the special word 'max' meaning 'as large as possible'.\n"
+"  --assume-clean        : When increasing the --size, this flag will avoid\n"
+"                        : a resync of the new space\n"
+"  --chunk=           -c : Change the chunksize of the array\n"
+"  --raid-devices=    -n : Change the number of active devices in an array.\n"
+"  --add=             -a : Add listed devices as part of reshape.  This is\n"
+"                        : needed for resizing a RAID0 which cannot have\n"
+"                        : spares already present.\n"
+"  --bitmap=          -b : Add or remove a write-intent bitmap.\n"
+"  --backup-file= file   : A file on a different device to store data for a\n"
+"                        : short time while increasing raid-devices on a\n"
+"                        : RAID4/5/6 array. Also needed throughout a reshape\n"
+"                        : when changing parameters other than raid-devices\n"
+"  --array-size=      -Z : Change visible size of array. This does not change any\n"
+"                        : data on the device, and is not stable across restarts.\n"
+"  --data-offset=        : Location on device to move start of data to.\n"
+"  --consistency-policy= : Change the consistency policy of an active array.\n"
+"                     -k : Currently works only for PPL with RAID5.\n"
 ;
 
 char Help_incr[] =
@@ -599,7 +615,6 @@ char Help_incr[] =
 ;
 
 char Help_config[] =
-"The /etc/mdadm.conf config file:\n\n"
 " The config file contains, apart from blank lines and comment lines that\n"
 " start with a hash(#), array lines, device lines, and various\n"
 " configuration lines.\n"
@@ -622,10 +637,12 @@ char Help_config[] =
 " than a device must match all of them to be considered.\n"
 "\n"
 " Other configuration lines include:\n"
-"  mailaddr, mailfrom, program     used for --monitor mode\n"
-"  create, auto                    used when creating device names in /dev\n"
-"  homehost, policy, part-policy   used to guide policy in various\n"
-"                                  situations\n"
+"  mailaddr, mailfrom, program, monitordelay    used for --monitor mode\n"
+"  create, auto                                 used when creating device names in /dev\n"
+"  homehost, homecluster, policy, part-policy   used to guide policy in various\n"
+"                                               situations\n"
+"\n"
+"For more details see mdadm.conf(5).\n"
 "\n"
 ;
 
@@ -640,3 +657,34 @@ char *mode_help[mode_count] = {
        [GROW]          = Help_grow,
        [INCREMENTAL]   = Help_incr,
 };
+
+/**
+ * fprint_update_options() - Print valid update options depending on the mode.
+ * @outf: File (output stream)
+ * @update_mode: Used to distinguish update and update_subarray
+ */
+void fprint_update_options(FILE *outf, enum update_opt update_mode)
+{
+       int counter = UOPT_NAME, breakpoint = UOPT_HELP;
+       mapping_t *map = update_options;
+
+       if (!outf)
+               return;
+       if (update_mode == UOPT_SUBARRAY_ONLY) {
+               breakpoint = UOPT_SUBARRAY_ONLY;
+               fprintf(outf, "Valid --update options for update-subarray are:\n\t");
+       } else
+               fprintf(outf, "Valid --update options are:\n\t");
+       while (map->num) {
+               if (map->num >= breakpoint)
+                       break;
+               fprintf(outf, "'%s', ", map->name);
+               if (counter % 5 == 0)
+                       fprintf(outf, "\n\t");
+               counter++;
+               map++;
+       }
+       if ((counter - 1) % 5)
+               fprintf(outf, "\n");
+       fprintf(outf, "\r");
+}