> For the complete documentation index, see [llms.txt](https://doc.engenius.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.engenius.ai/intel-r-vroc-for-linux-guide/appendix/mdadm-quick-start-guide.md).

# mdadm Quick Start Guide

Usage:

```
# mdadm [mode] <raiddevice> [options] <component-devices>
```

**Assemble – Assemble previously created array into an active array**

<table data-header-hidden><thead><tr><th width="354" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top"># mdadm -A -s</td><td valign="top">Scan and assembly all the RAID volume based on config file.</td></tr><tr><td valign="top"> # mdadm -A /dev/md/imsm0 -e imsm /dev/ &#x3C;member drives></td><td valign="top">Assemble <em>imsm0</em> container manually if without config file.</td></tr><tr><td valign="top"> # mdadm -A /dev/md/md0 /dev/md/imsm0</td><td valign="top"><p>Assemble <em>md0</em> array</p><p>manually if without config file.</p></td></tr></tbody></table>

**Create/Grow/Misc – Create new array with metadata/change active size or number of active devices**

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top"># mdadm -C /dev/md/imsm0 /dev/nvme[0-3]n1 -n 4 -e imsm</td><td valign="top">Create <em>imsm0</em> container with 4 <em>nvme0-3</em> drives.</td></tr><tr><td valign="top"># mdadm -C /dev/md/md0 /dev/md/imsm0 -n 4 -l 5</td><td valign="top"><p>Create <em>md0</em> as 4DR5 in</p><p><em>imsm0</em> container.</p></td></tr><tr><td valign="top"># mdadm -C /dev/md/md0 /dev/md/imsm0 - n 4 -l 5 --consistency- policy=ppl</td><td valign="top">Create <em>md0</em> as 4DR5 in <em>imsm0</em> container with RWH enabled.</td></tr><tr><td valign="top"><p> </p><p># mdadm -C /dev/md/md0 /dev/md/imsm0 -n 4 -l 5 -z</p><p>$((100*1024*1024))</p></td><td valign="top">Create 4DR5 with 100GB size for each drive. 300GB size created with this example command.</td></tr><tr><td valign="top"># mkfs.ext4 /dev/md/md0</td><td valign="top"><p>Create ext4 filesystem in</p><p><em>md0</em> RAID volume.</p></td></tr><tr><td valign="top"># mount /dev/md/md0 /mnt/&#x3C;mountpoint></td><td valign="top">Mount <em>md0</em> RAID volume in the file system.</td></tr><tr><td valign="top"># mdadm -a /dev/md/imsm0 /dev/&#x3C;nvmeXn1></td><td valign="top"><p>Add hot-spare drive to</p><p><em>imsm0</em> container.</p></td></tr><tr><td valign="top"># mdadm -Ebs > /etc/mdadm.conf</td><td valign="top"><p>Export device metadata to</p><p><em>mdadm.conf</em> file.</p></td></tr><tr><td valign="top"># mdadm -S /dev/md/md0</td><td valign="top"><p>Stop and deactivate <em>md0</em></p><p>array.</p></td></tr><tr><td valign="top"># mdadm -S /dev/md/imsm0</td><td valign="top"><p>Stop and deactivate <em>imsm0</em></p><p>container.</p></td></tr><tr><td valign="top"># mdadm -S -s</td><td valign="top">Stop and deactivate all.</td></tr><tr><td valign="top"># mdadm -f /dev/md/md0 /dev/nvme0n1</td><td valign="top"><p>Fail <em>nvme0n1</em> drive in <em>md0</em></p><p>array.</p></td></tr><tr><td valign="top"># mdadm -r /dev/md/imsm0 /dev/nvme0n1</td><td valign="top">Detached <em>nvme0n1</em> drive in imsm0 container.</td></tr><tr><td valign="top"><p> </p><p># mdadm --zero-superblock /dev/nvme0n1</p></td><td valign="top">Clear and zero the superblock in <em>nvme0n1</em> drive.</td></tr><tr><td valign="top"># mdadm -G /dev/md/md0 -l 0</td><td valign="top">Grow existing 2DR1 to 1DR0.</td></tr><tr><td valign="top"># mdadm -G /dev/md/imsm0 -n 2</td><td valign="top">Grow 2DR0 to container.</td></tr><tr><td valign="top"># mdadm -a /dev/md/imsm0 /dev/nvme2n1</td><td valign="top">Add one more drive into container.</td></tr><tr><td valign="top"># mdadm -G /dev/md/md0 -l 5 --layout=left-asymmetric</td><td valign="top">Grow 2DR0 to 3DR5.</td></tr><tr><td valign="top"># mdadm -G /dev/md/md0 --size=128G</td><td valign="top"><p>Grow component size <em>md0</em></p><p>to the 128GB.</p></td></tr><tr><td valign="top"><p> </p><p># mdadm -G /dev/md/md0 --consistency-policy=resync</p></td><td valign="top">Switch RWH closure policy to resync on the running md0.</td></tr><tr><td valign="top"><p> </p><p># mdadm -G /dev/md/md0 --consistency-policy=ppl</p></td><td valign="top"><p>Enable RWH closure mechanism on the running</p><p><em>md0</em>.</p></td></tr></tbody></table>

&#x20;**Volume, Member, Hardware Information**

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top"># mdadm --detail-platform</td><td valign="top">Print detail of platform’s RAID capabilities.</td></tr><tr><td valign="top"># mdadm -D /dev/md/md0</td><td valign="top">Print detail of <em>md0</em> device.</td></tr><tr><td valign="top"># mdadm -E /dev/nvme0n1</td><td valign="top">Print contents of metadata store in <em>nvme0n1</em>.</td></tr><tr><td valign="top"># cat /proc/mdstat</td><td valign="top">List all active <em>md</em> devices with information.</td></tr></tbody></table>

**Follow/Monitor/Misc – Monitor one or more devices on state changes**

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top"># systemctl status mdmonitor.service</td><td valign="top">Check <em>mdmonitor</em> service.</td></tr><tr><td valign="top"># systemctl start mdmonitor.service</td><td valign="top">Start <em>mdmonitor</em> service.</td></tr><tr><td valign="top"># systemctl stop mdmonitor.service</td><td valign="top">Stop <em>mdmonitor</em> service.</td></tr><tr><td valign="top"># systemctl enable mdmonitor.service</td><td valign="top">Enable <em>mdmonitor</em> service for next boot auto start.</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://doc.engenius.ai/intel-r-vroc-for-linux-guide/appendix/mdadm-quick-start-guide.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
