2
2
* mdadm - manage Linux "md" devices aka RAID arrays.
4
* Copyright (C) 2001-2006 Neil Brown <neilb@suse.de>
4
* Copyright (C) 2001-2007 Neil Brown <neilb@suse.de>
7
7
* This program is free software; you can redistribute it and/or modify
19
19
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
21
* Author: Neil Brown
22
* Email: <neilb@cse.unsw.edu.au>
24
* School of Computer Science and Engineering
25
* The University of New South Wales
22
* Email: <neilb@suse.de>
32
char Version[] = Name " - v2.5.6 - 9 November 2006\n";
27
char Version[] = Name " - v2.6.2 - 21st May 2007\n";
91
86
* At the time if writing, there is only minimal support.
94
char short_options[]="-ABCDEFGQhVXvqbc:i:l:p:m:n:x:u:c:d:z:U:sarfRSow1tye:";
95
char short_bitmap_auto_options[]="-ABCDEFGQhVXvqb:c:i:l:p:m:n:x:u:c:d:z:U:sa:rfRSow1tye:";
89
char short_options[]="-ABCDEFGIQhVXWvqbc:i:l:p:m:n:x:u:c:d:z:U:sarfRSow1tye:";
90
char short_bitmap_auto_options[]=
91
"-ABCDEFGIQhVXWvqb:c:i:l:p:m:n:x:u:c:d:z:U:sa:rfRSow1tye:";
97
93
struct option long_options[] = {
98
94
{"manage", 0, 0, '@'},
104
100
{"examine", 0, 0, 'E'},
105
101
{"follow", 0, 0, 'F'},
106
102
{"grow", 0, 0, 'G'},
103
{"incremental",0,0, 'I'},
107
104
{"zero-superblock", 0, 0, 'K'}, /* deliberately no a short_option */
108
105
{"query", 0, 0, 'Q'},
109
106
{"examine-bitmap", 0, 0, 'X'},
107
{"auto-detect", 0, 0, AutoDetect},
112
110
{"monitor", 0, 0, 'F'},
160
158
{"readonly", 0, 0, 'o'},
161
159
{"readwrite", 0, 0, 'w'},
162
160
{"no-degraded",0,0, NoDegraded },
164
163
/* For Detail/Examine */
165
164
{"brief", 0, 0, 'b'},
165
{"export", 0, 0, 'Y'},
166
166
{"sparc2.2", 0, 0, Sparc22},
167
167
{"test", 0, 0, 't'},
175
175
{"daemonize", 0, 0, 'f'},
176
176
{"oneshot", 0, 0, '1'},
177
177
{"pid-file", 1, 0, 'i'},
178
{"syslog", 0, 0, 'y'},
179
180
{"backup-file", 1,0, BackupFile},
182
/* For Incremental */
183
{"rebuild-map", 0, 0, 'r'},
199
202
" make changes to an existing array.\n"
200
203
" mdadm --misc options... devices\n"
201
204
" report on or modify various md related devices.\n"
205
" mdadm --grow options device\n"
206
" resize/reshape an active array\n"
207
" mdadm --incremental device\n"
208
" add a device to an array as appropriate\n"
202
209
" mdadm --monitor options...\n"
203
210
" Monitor one or more array for significant changes.\n"
204
211
" mdadm device options...\n"
229
236
" --verbose -v : Be more verbose about what is happening\n"
230
237
" --quiet -q : Don't print un-necessary messages\n"
231
238
" --brief -b : Be less verbose, more brief\n"
239
" --export -Y : With --detail, use key=value format for easy\n"
240
" import into environment\n"
232
241
" --force -f : Override normal checks and be more forceful\n"
234
243
" --assemble -A : Assemble an array\n"
238
247
" --examine -E : Examine superblock on an array component\n"
239
248
" --examine-bitmap -X: Display the detail of a bitmap file\n"
240
249
" --monitor -F : monitor (follow) some arrays\n"
250
" --grow -G : resize/ reshape and array\n"
251
" --incremental -I : add a single device to an array as appropriate\n"
241
252
" --query -Q : Display general information about how a\n"
242
253
" device relates to the md driver\n"
254
" --auto-detect : Start arrays auto-detected by the kernel\n"
295
307
" --readonly -o : mark array as readonly\n"
296
308
" --readwrite -w : mark array as readwrite\n"
297
309
" --zero-superblock : erase the MD superblock from a device.\n"
310
" --wait -W : wait for recovery/resync/reshape to finish.\n"
458
471
" --readonly -o : mark array as readonly\n"
459
472
" --readwrite -w : mark array as readwrite\n"
460
473
" --test -t : exit status 0 if ok, 1 if degrade, 2 if dead, 4 if missing\n"
474
" --wait -W : wait for resync/rebuild/recovery to finish\n"
463
477
char Help_monitor[] =
491
505
"This usage causes mdadm to attempt to reconfigure a running array.\n"
492
506
"This is only possibly if the kernel being used supports a particular\n"
493
"reconfiguration. This version only supports changing the number of\n"
494
"devices in a RAID1, and changing the active size of all devices in\n"
507
"reconfiguration. This version supports changing the number of\n"
508
"devices in a RAID1/5/6, changing the active size of all devices in\n"
509
"a RAID1/4/5/6, adding or removing a write-intent bitmap, and changing\n"
510
"the error mode for a 'FAULTY' array.\n"
497
512
"Options that are valid with the grow (-G --grow) mode are:\n"
513
" --level= -l : Tell mdadm what level the array is so that it can\n"
514
" : interpret '--layout' properly.\n"
515
" --layout= -p : For a FAULTY array, set/change the error mode.\n"
498
516
" --size= -z : Change the active size of devices in an array.\n"
499
517
" : This is useful if all devices have been replaced\n"
500
518
" : with larger devices.\n"
501
" --raid-disks= -n : Change the number of active devices in a RAID1\n"
519
" --raid-disks= -n : Change the number of active devices in an array.\n"
521
" --bitmap= -b : Add or remove a write-intent bitmap.\n"
525
"Usage: mdadm --incremental [-Rqrs] device\n"
527
"This usage allows for incremental assembly of md arrays. Devices can be\n"
528
"added one at a time as they are discovered. Once an array has all expected\n"
529
"devices, it will be started.\n"
531
"Options that are valid with incremental assembly (-I --incremental) more are:\n"
532
" --run -R : run arrays as soon as a minimal number of devices are\n"
533
" : present rather than waiting for all expected.\n"
534
" --quiet -q : Don't print any information messages, just errors.\n"
535
" --rebuild -r : Rebuild the 'map' file that mdadm uses for tracking\n"
536
" : partial arrays.\n"
537
" --scan -s : Use with -R to start any arrays that have the minimal\n"
538
" : required number of devices, but are not yet started.\n"
507
541
char Help_config[] =
508
542
"The /etc/mdadm.conf config file:\n\n"
587
621
{ "monitor", MONITOR},
623
{ "incremental", INCREMENTAL},
624
{ "auto-detect", AUTODETECT},
591
627
mapping_t faultylayout[] = {