This is my mdadm raid command chet-sheet in linux.
Mdadm is a Linux utility to manage and monitor RAID software handled by linux kernel if you do not have or do not use any raid card.

Check mdadm raid status from your device

 cat /proc/mdstat 

Check mdam raid status details per md’s

 mdadm --detail /dev/md0 

Create Raid 1 from 2 device

 mdadm --create --verbose /dev/md0 --level=1  --raid-devices=2 /dev/sda1 /dev/sdb1 

Update mdadm config in /etc/mdadm.conf after raid creation

mdadm --detail --scan >> /etc/mdadm.conf

Set array member to fail

 mdadm --fail /dev/md0 /dev/sdX1 

Add/Grow disk member to replace failed drive

 mdadm --grow /dev/md0 -n3 

Add member to raid array

mdadm --add /dev/md0 /dev/sdc1 

Detailed status of your raid device

mdadm --detail /dev/md0

More reference for MDADM
https://raid.wiki.kernel.org/index.php/A_guide_to_mdadm

Previous ArticleNext Article

Leave a Reply

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