========================= mdadm mdadm --help-options Any parameter that does not start with '-' is treated as a device name The first such name is often the name of an md device. Subsequent names are often names of component devices. Some common options are: --help -h : General help message or, after above option, mode specific help message --help-options : This help message --version -V : Print version information for mdadm --verbose -v : Be more verbose about what is happening --brief -b : Be less verbose, more brief --force -f : Override normal checks and be more forceful --assemble -A : Assemble an array --build -B : Build a legacy array --create -C : Create a new array --detail -D : Display details of an array --examine -E : Examine superblock on an array component --monitor -F : monitor (follow) some arrays --query -Q : Display general information about how a device relates to the md driver ------------------------- mdadm [mode] [options] mdadm --create --verbose /dev/md0 --level=0 --raid-devices=2 /dev/sdb1 /dev/sdc1 mdadm -Cv /dev/md0 -l5 -n5 -c128 /dev/sd{a,b,c,d,e}1 mdadm -S /dev/md0 stop array mdadm --detail --scan you may output the above command into mdadm.conf file which might look like this: DEVICE /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1 ARRAY /dev/md0 devices=/dev/sda1,/dev/sdb1 ARRAY /dev/md1 devices=/dev/sdc1,/dev/sdd1 mdadm -As /dev/md0 start an array -A option denotes assemble mode. You can also use --assemble. The -s or --scan option tells mdadm to look in /etc/mdadm.conf for information about arrays and devices. If you want to start every array listed in /etc/mdadm.conf, don't specify an md device on the command line. mdadm -A /dev/md0 /dev/sdb1 /dev/sdc1 manual asembly of and array mdadm -E /dev/sdc1 examine an array ========================= mdadm http://www.tldp.org/HOWTO/Software-RAID-HOWTO-7.html#ss7.3 * mdadm can diagnose, monitor and gather detailed information about your arrays * mdadm is a single centralized program and not a collection of disperse programs, so there's a common syntax for every RAID management command * mdadm can perform almost all of its functions without having a configuration file and does not use one by default * Also, if a configuration file is needed, mdadm will help with management of it's contents ----------------- mdadm --create --help Usage: mdadm --assemble md-device options-and-component-devices... Usage: mdadm --assemble --scan md-devices-and-options... Usage: mdadm --assemble --scan options... Usage: mdadm --build device --chunk=X --level=Y --raid-devices=Z devices mdadm /dev/md0 -f /dev/hda1 -r /dev/hda1 -a /dev/hda1 will firstly mark /dev/hda1 as faulty in /dev/md0 and will then remove it from the array and finally add it back in as a spare. However only one md array can be affected by a single command. mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/hd[ac]1 Create /dev/md0 as a RAID1 array consisting of /dev/hda1 and /dev/hdc1. echo 'DEVICE /dev/hd*[0-9] /dev/sd*[0-9]' > mdadm.conf mdadm --detail --scan >> mdadm.conf echo 'DEVICE /dev/hd[a-z] /dev/sd*[a-z]' > mdadm.conf mdadm --examine --scan --config=mdadm.conf >> mdadm.conf This will find what arrays could be assembled from existign IDE and SCSI whole drives (not partitions) and store the information is the format of a config file. This file is very likely to contain unwanted detail, par- ticularly the devices= entries. It should be reviewed and edited before being used as an actual config file.