The mdadm command is a tool used to manage software-based RAID arrays. A redundant array of independent disks (RAID) is a set of vendor-independent specifications that support redundancy and fault tolerance for configurations on multiple-device storage systems. In a RAID array, data is stored across multiple physical storage devices, and those devices are combined into a single virtual storage device. This type of software-based RAID configuration is an alternative to using device mapper and DM-Multipath. The mdadm tool enables you to create, manage, and monitor RAID arrays.

mdadm has several modes of operation: Create, Build, Assemble, and Monitor. Each of these modes has its own command-line switch. In addition to these modes, there are many management features that operate independently.

Example usage

Let’s assume you added three disks to your virtual machine. Let’s create a RAID 0 device called /dev/md127 (just a random number that is not yet in use):

 

Verify the configuration:

Make the configuration persistent:

Now you can use this device and format it with a filesystem. For instance:

mdadm Command Examples

1. Create array:

2. Stop array:

3. Mark disk as failed:

4. Remove disk:

5. Add disk to array:

6. Show RAID info:

7. Reset disk by deleting RAID metadata:

By vuat8b

Leave a Reply

Your email address will not be published. Required fields are marked *