2011-11-15 - some mdadm command examples
Tags: linux toolbox

Watch the array status

watch -d -n10 mdadm --detail /dev/md127

Recovery from livecd

mdadm --examine --scan >> /etc/mdadm.conf
mdadm --assemble --scan /dev/md/root
mount /dev/md127 /mnt  # or vgscan...

If auto detection does not work, you can still assemble an array manually :

mdadm --assemble /dev/md0 /dev/sda1 /dev/sdb1 

Resync an array

First rigorously check the output of cat /proc/mdstat

mdadm --manage --re-add /dev/md0 /dev/sdb1

Destroy an array

mdadm --stop /dev/md0
mdadm --zero-superblock /dev/sda
mdadm --zero-superblock /dev/sdb