---
name: "mdadd"
section: "8"
platform: "linux"
package: "raidtools"
version: "0.42-33"
release: "Debian 3.0 (Woody)"
platforms: ["linux"]
url: "https://new.carta.tech/mdadd"
---

# mdadd(8)

command set to manage md devices.

## NAME

mdadd, mdrun, mdstop - command set to manage md devices.

## SYNOPSIS

**mdadd** \[options\] \[md\_device\] \[block\_device\_1 block\_device\_2 ...\]

**mdrun** \[options\] md\_device

**mdstop** \[options\] md\_device

## DESCRIPTION

Md devices are virtual devices used to group real block devices. This way, two 100MB disks can be used as a single 200MB disk, whatever their interface type.

If you're using the **/proc** filesystem, **/proc/mdstat** gives you informations about md devices status.

Avaible commands are :\
 **mdadd** : groups several real devices into a virtual one.\
 **mdrun** : set a virtual device as usable, with a given mode.\
 **mdstop** : free real devices belonging to a virtual one, and flush buffers.

## OPTIONS

- *-a*

  Apply the command to the set of devices described in **/etc/mdtab**.

- *-r*

  Starts the virtual device after the real devices are being added. Only applicable to **mdadd**.

- *-px*

  where x is :\
   *l* : starts the device in linear mode,\
   **0** : starts the device in raid-0 mode,\
   **1** : starts the device in raid-1 mode.\
   assuming that the mode is either compiled into the kernel or loaded using the **insmod** program. Only applicable to **mdrun**.

- *-cn*

  (raid-0 and raid-1 only)\
   Set the chunk size as **PAGE\_SIZE \<\< n**. You can also set the chunk size in kilobytes with **-cxk** where x is a power of 2. Only applicable to **mdrun**.

- *-fn*

  (raid-1 only)\
   Set the maximum fault number as **n**. Only applicable to **mdrun**.

- *-i*

  (raid1 only)\
   Show version number as well as driver version the command is compiled for.

## EXAMPLES

To configure the device :

**/sbin/mdadd /dev/md0 /dev/sdb1 /dev/sdc2**

Warning, **/sbin/mdadd /dev/md0 /dev/sdb1 /dev/sdc2** is different from **/sbin/mdadd /dev/md0 /dev/sdc2 /dev/sdb1** because there's no internal ordering.

To make it usable in linear mode :

**/sbin/mdrun -pl /dev/md0**

To make it usable in striped mode, with 8kb chunks :

**/sbin/mdrun -p0 -c8k /dev/md0**

To stop it :

**/sbin/mdstop /dev/md0**

If you have described you md-devices in **/etc/mdtab** , you can replace the two first steps with

**/sbin/mdadd  -ar**

## FILES

**/sbin/mdadd** : main command. Other commands are symlinks to this file.\
 **/etc/mdtab** : configuration file.\
 **/proc/mdstat** : driver and devices status

## AUTHOR

**mdadd** was written as a kernel interface to md driver by Marc ZYNGIER \<zyngier@amertume.ufr-info-p7.ibp.fr\>.

## BUGS

Options that are not applicable to a command are silently ignored and/or may lead to unxepected behaviour. This man page (and the whole documentation) is really brain-dead and should be rewritten. Any volunteer ?

## SEE ALSO

[**mdtab**(5)](/mdtab/5.md)\
 **modules** package.\
 More informations in the README file included in the package.
