Software >> OS >> Unix >> Linux >> RHEL >> RAID >> How to manage software RAID with mdadm

 

Create a new RAID array mdadm --create --verbose /dev/md0 --level=1 /dev/sda1 /dev/sdb1
create mdadm config file mdadm --detail --scan >> /etc/mdadm.conf
Remove disk from an array

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

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

or in 1 step :-

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

Add disk to existing array mdadm --add /dev/md0 /dev/sdb1
Verify status of the array

cat /proc/mdstat

or

mdadm --detail /dev/md0

Stop and delete an array

mdadm --stop /dev/md0

mdadm --remove /dev/md0