トーク:CentOSでソフトウェアRAIDの構築
提供:maruko2 Note.
mdadm ヘルプ
# mdadm --help[表示する]
Usage: mdadm --create device options...
mdadm --assemble device options...
mdadm --build device options...
mdadm --manage device options...
mdadm --misc options... devices
mdadm --monitor options...
mdadm device options...
# 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 --create --help[表示する]
Usage: mdadm --create device -chunk=X --level=Y --raid-devices=Z devices
This usage will initialise a new md array, associate some
devices with it, and activate the array. In order to create an
array with some devices missing, use the special word 'missing' in
place of the relevant device name.
Before devices are added, they are checked to see if they already contain
raid superblocks or filesystems. They are also checked to see if
the variance in device size exceeds 1%.
If any discrepancy is found, the user will be prompted for confirmation
before the array is created. The presence of a '--run' can override this
caution.
If the --size option is given then only that many kilobytes of each
device is used, no matter how big each device is.
If no --size is given, the apparent size of the smallest drive given
is used for raid level 1 and greater, and the full device is used for
other levels.
Options that are valid with --create (-C) are:
--chunk= -c : chunk size of kibibytes
--rounding= : rounding factor for linear array (==chunk size)
--level= -l : raid level: 0,1,4,5,6,linear,multipath and synonyms
--parity= -p : raid5/6 parity algorithm: {left,right}-{,a}symmetric
--layout= : same as --parity
--raid-devices= -n : number of active devices in array
--spare-devices= -x: number of spares (eXtras) devices in initial array
--size= -z : Size (in K) of each drive in RAID1/4/5/6/10 - optional
--force -f : Honour devices as listed on command line. Don't
: insert a missing drive for RAID5.
--run -R : insist of running the array even if not all
: devices are present or some look odd.
--readonly -o : start the array readonly - not supported yet.
# mdadm --assemble --help[表示する]
Usage: mdadm --assemble device options...
mdadm --assemble --scan options...
This usage assembles one or more raid arrays from pre-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 on the command line or is found listed
in the config file. The array identity is determined either from the
--uuid or --super-minor commandline arguments, from the config file,
or from the first component device on the command line.
The different combinations of these are as follows:
If the --scan option is not given, then only devices and identities
listed on the command line are considered.
The first device will be the array device, and the remainder will be
examined when looking for components.
If an explicit identity is given with --uuid or --super-minor, then
only devices with a superblock which matches that identity is considered,
otherwise every device listed is considered.
If the --scan option is given, and no devices are listed, then
every array listed in the config file is considered for assembly.
The identity of candidate devices are determined from the config file.
If the --scan option is given as well as one or more devices, then
Those devices are md devices that are to be assembled. Their identity
and components are determined from the config file.
Options that are valid with --assemble (-A) are:
--uuid= -u : uuid of array to assemble. Devices which don't
have this uuid are excluded
--super-minor= -m : minor number to look for in super-block when
choosing devices to use.
--config= -c : config file
--scan -s : scan config file for missing information
--run -R : Try to start the array even if not enough devices
for a full array are present
--force -f : Assemble the array even if some superblocks appear
: out-of-date. This involves modifying the superblocks.
--update= -U : Update superblock: one of sparc2.2, super-minor or summaries
[表示する]# mdadm --build --help[表示する]
Usage: mdadm --build device -chunk=X --level=Y --raid-devices=Z devices This usage is similar to --create. The difference is that it creates a legacy array without a superblock. With these arrays there is no different between initially creating the array and subsequently assembling the array, except that hopefully there is useful data there in the second case. The level may only be 0, raid0, or linear. All devices must be listed and the array will be started once complete. Options that are valid with --build (-B) are: --chunk= -c : chunk size of kibibytes --rounding= : rounding factor for linear array (==chunk size) --level= -l : 0, raid0, or linear --raid-devices= -n : number of active devices in array
# mdadm --manage --help[表示する]
Usage: mdadm arraydevice options component devices... This usage is for managing the component devices within an array. The --manage option is not needed and is assumed if the first argument is a device name or a management option. The first device listed will be taken to be an md array device, and subsequent devices are (potential) components of that array. Options that are valid with management mode are: --add -a : hotadd subsequent devices to the array --remove -r : remove subsequent devices, which must not be active --fail -f : mark subsequent devices a faulty --set-faulty : same as --fail --run -R : start a partially built array --stop -S : deactivate array, releasing all resources --readonly -o : mark array as readonly --readwrite -w : mark array as readwrite
# mdadm --misc --help[表示する]
Usage: mdadm misc_option devices...
This usage is for performing some task on one or more devices, which
may be arrays or components, depending on the task.
The --misc option is not needed (though it is allowed) and is assumed
if the first argument in a misc option.
Options that are valid with the miscellaneous mode are:
--query -Q : Display general information about how a
device relates to the md driver
--detail -D : Display details of an array
--examine -E : Examine superblock on an array component
--zero-superblock : erase the MD superblock from a device.
--run -R : start a partially built array
--stop -S : deactivate array, releasing all resources
--readonly -o : mark array as readonly
--readwrite -w : mark array as readwrite
--test -t : exit status 0 if ok, 1 if degrade, 2 if dead, 4 if missing
# mdadm --monitor --help[表示する]
Usage: mdadm --monitor options devices This usage causes mdadm to monitor a number of md arrays by periodically polling their status and acting on any changes. If any devices are listed then those devices are monitored, otherwise all devices listed in the config file are monitored. The address for mailing advisories to, and the program to handle each change can be specified in the config file or on the command line. If no mail address or program are specified, then mdadm reports all state changes to stdout. Options that are valid with the monitor (-F --follow) mode are: --mail= -m : Address to mail alerts of failure to --program= -p : Program to run when an event is detected --alert= : same as --program --delay= -d : seconds of delay between polling state. default=60 --config= -c : specify a different config file --scan -s : find mail-address/program in config file --daemonise -f : Fork and continue in child, parent exits --pid-file= -i : In daemon mode write pid to specified file instead of stdout --oneshot -1 : Check for degraded arrays, then exit --test -t : Generate a TestMessage event against each array at startup