86
86
* At the time if writing, there is only minimal support.
89
char short_options[]="-ABCDEFGIQhVXWvqbc:i:l:p:m:n:x:u:c:d:z:U:sarfRSow1tye:";
89
char short_options[]="-ABCDEFGIQhVXWZ:vqbc:i:l:p:m:n:x:u:c:d:z:U:N:sarfRSow1tye:";
90
90
char short_bitmap_options[]=
91
"-ABCDEFGIQhVXWvqb:c:i:l:p:m:n:x:u:c:d:z:U:sarfRSow1tye:";
91
"-ABCDEFGIQhVXWZ:vqb:c:i:l:p:m:n:x:u:c:d:z:U:N:sarfRSow1tye:";
92
92
char short_bitmap_auto_options[]=
93
"-ABCDEFGIQhVXWvqb:c:i:l:p:m:n:x:u:c:d:z:U:sa:rfRSow1tye:";
93
"-ABCDEFGIQhVXWZ:vqb:c:i:l:p:m:n:x:u:c:d:z:U:N:sa:rfRSow1tye:";
95
95
struct option long_options[] = {
96
96
{"manage", 0, 0, '@'},
107
107
{"query", 0, 0, 'Q'},
108
108
{"examine-bitmap", 0, 0, 'X'},
109
109
{"auto-detect", 0, 0, AutoDetect},
110
{"detail-platform", 0, 0, DetailPlatform},
111
{"kill-subarray", 1, 0, KillSubarray},
112
{"update-subarray", 1, 0, UpdateSubarray},
112
115
{"monitor", 0, 0, 'F'},
138
141
{"write-mostly",0, 0, 'W'},
139
142
{"re-add", 0, 0, ReAdd},
140
143
{"homehost", 1, 0, HomeHost},
141
145
{"auto-update-homehost", 0, 0, AutoHomeHost},
142
147
{"symlinks", 1, 0, Symlinks},
144
149
/* For assemble */
517
525
" --layout= -p : For a FAULTY array, set/change the error mode.\n"
518
526
" --size= -z : Change the active size of devices in an array.\n"
519
527
" : This is useful if all devices have been replaced\n"
520
" : with larger devices.\n"
521
" --raid-disks= -n : Change the number of active devices in an array.\n"
528
" : with larger devices. Value is in Kilobytes, or\n"
529
" : the special word 'max' meaning 'as large as possible'.\n"
530
" --raid-devices= -n : Change the number of active devices in an array.\n"
523
531
" --bitmap= -b : Add or remove a write-intent bitmap.\n"
532
" --backup-file= file : A file on a differt device to store data for a\n"
533
" : short time while increasing raid-devices on a\n"
534
" : RAID4/5/6 array. Not needed when a spare is present.\n"
535
" --array-size= -Z : Change visible size of array. This does not change\n"
536
" : any data on the device, and is not stable across restarts.\n"
526
539
char Help_incr[] =
527
"Usage: mdadm --incremental [-Rqrs] device\n"
540
"Usage: mdadm --incremental [-Rqrsf] device\n"
529
542
"This usage allows for incremental assembly of md arrays. Devices can be\n"
530
543
"added one at a time as they are discovered. Once an array has all expected\n"
531
544
"devices, it will be started.\n"
533
"Options that are valid with incremental assembly (-I --incremental) more are:\n"
534
" --run -R : run arrays as soon as a minimal number of devices are\n"
535
" : present rather than waiting for all expected.\n"
536
" --quiet -q : Don't print any information messages, just errors.\n"
537
" --rebuild -r : Rebuild the 'map' file that mdadm uses for tracking\n"
538
" : partial arrays.\n"
539
" --scan -s : Use with -R to start any arrays that have the minimal\n"
540
" : required number of devices, but are not yet started.\n"
546
"Optionally, the process can be reversed by using the fail option.\n"
547
"When fail mode is invoked, mdadm will see if the device belongs to an array\n"
548
"and then both fail (if needed) and remove the device from that array.\n"
550
"Options that are valid with incremental assembly (-I --incremental) are:\n"
551
" --run -R : Run arrays as soon as a minimal number of devices are\n"
552
" : present rather than waiting for all expected.\n"
553
" --quiet -q : Don't print any information messages, just errors.\n"
554
" --rebuild-map -r : Rebuild the 'map' file that mdadm uses for tracking\n"
555
" : partial arrays.\n"
556
" --scan -s : Use with -R to start any arrays that have the minimal\n"
557
" : required number of devices, but are not yet started.\n"
558
" --fail -f : First fail (if needed) and then remove device from\n"
559
" : any array that it is a member of.\n"
543
562
char Help_config[] =
578
597
/* name/number mappings */
580
599
mapping_t r5layout[] = {
581
{ "left-asymmetric", 0},
582
{ "right-asymmetric", 1},
583
{ "left-symmetric", 2},
584
{ "right-symmetric", 3},
600
{ "left-asymmetric", ALGORITHM_LEFT_ASYMMETRIC},
601
{ "right-asymmetric", ALGORITHM_RIGHT_ASYMMETRIC},
602
{ "left-symmetric", ALGORITHM_LEFT_SYMMETRIC},
603
{ "right-symmetric", ALGORITHM_RIGHT_SYMMETRIC},
605
{ "default", ALGORITHM_LEFT_SYMMETRIC},
606
{ "la", ALGORITHM_LEFT_ASYMMETRIC},
607
{ "ra", ALGORITHM_RIGHT_ASYMMETRIC},
608
{ "ls", ALGORITHM_LEFT_SYMMETRIC},
609
{ "rs", ALGORITHM_RIGHT_SYMMETRIC},
611
{ "parity-first", ALGORITHM_PARITY_0},
612
{ "parity-last", ALGORITHM_PARITY_N},
613
{ "ddf-zero-restart", ALGORITHM_RIGHT_ASYMMETRIC},
614
{ "ddf-N-restart", ALGORITHM_LEFT_ASYMMETRIC},
615
{ "ddf-N-continue", ALGORITHM_LEFT_SYMMETRIC},
619
mapping_t r6layout[] = {
620
{ "left-asymmetric", ALGORITHM_LEFT_ASYMMETRIC},
621
{ "right-asymmetric", ALGORITHM_RIGHT_ASYMMETRIC},
622
{ "left-symmetric", ALGORITHM_LEFT_SYMMETRIC},
623
{ "right-symmetric", ALGORITHM_RIGHT_SYMMETRIC},
625
{ "default", ALGORITHM_LEFT_SYMMETRIC},
626
{ "la", ALGORITHM_LEFT_ASYMMETRIC},
627
{ "ra", ALGORITHM_RIGHT_ASYMMETRIC},
628
{ "ls", ALGORITHM_LEFT_SYMMETRIC},
629
{ "rs", ALGORITHM_RIGHT_SYMMETRIC},
631
{ "parity-first", ALGORITHM_PARITY_0},
632
{ "parity-last", ALGORITHM_PARITY_N},
633
{ "ddf-zero-restart", ALGORITHM_ROTATING_ZERO_RESTART},
634
{ "ddf-N-restart", ALGORITHM_ROTATING_N_RESTART},
635
{ "ddf-N-continue", ALGORITHM_ROTATING_N_CONTINUE},
637
{ "left-asymmetric-6", ALGORITHM_LEFT_ASYMMETRIC_6},
638
{ "right-asymmetric-6", ALGORITHM_RIGHT_ASYMMETRIC_6},
639
{ "left-symmetric-6", ALGORITHM_LEFT_SYMMETRIC_6},
640
{ "right-symmetric-6", ALGORITHM_RIGHT_SYMMETRIC_6},
641
{ "parity-first-6", ALGORITHM_PARITY_0_6},