From LQWiki
(Redirected from SoftWare RAID)
mdadm is a tool to manage software RAID on linux. It allows you to
- create a (new) software raid array. Think of two USB hard drives that you just bought and that you want to use in a RAID 1 configuration.
- assemble an (existing) array. Think of two USB hard drives that you have in your shelve and that you have already made to a RAID array using the create command. When you re-attach them to your computer, you need to tell the computer how the disks belong together (RAID 0 or RAID 1 for example). That is what the assemble command is for.
Create an array
To create a RAID-0 array at /dev/md0 consisting of /dev/sda1 and /dev/sdb1:
# mdadm --create --verbose /dev/md0 --level=0 --raid-devices=2 /dev/sda1 /dev/sdb1 mdadm: chunk size defaults to 64K mdadm: array /dev/md0 started.
The /etc/mdadm.conf file will be maintained by the the kernel's autodetecting facility.
It is possible to combine software raid and Logical Volume Manager for maximum flexibility and reliability.
Assemble an array
Here we have a RAID array out of one disk. The configuration is stored in
/tmp/mdadm.conf:
DEVICE /dev/disk/by-id/scsi-360a98000486e5337524a4f6a4e43542d-part2 ARRAY /dev/md0 level=raid0 num-devices=1 UUID=357d721b:86058e8c:8d746cf9:a620ae3c
Use this config file in conjunction with mdadm's assemble command:
mdadm --assemble --config /tmp/mdadm.conf /dev/md0

This page is available under a