User Tools

Site Tools


Software Raid with mdadm

Creating the array

mdadm --create --level=1 --raid-devices=2 /dev/md_d0 /dev/sda missing
mdadm --add /dev/md0 /dev/sdb1

Verifying the status of the RAID arrays

cat /proc/mdstat

or as an alternative:

mdadm --detail /dev/md0

Remove a disk from an array

We can’t remove a disk directly from the array, unless it is failed, so we first have to fail it (if the drive it is failed this is normally already in failed state and this step is not needed):

mdadm --fail /dev/md0 /dev/sda1

and now we can remove it:

mdadm --remove /dev/md0 /dev/sda1

Or as a one liner:

mdadm /dev/md0 --fail /dev/sda1 --remove /dev/sda1

Source: MDAM Cheatsheet

linux/sw_raid.txt · Last modified: 2012/02/25 18:00 by