Mdadm
From Sigmon
quick howto
apt-get install -y mdadm
Assemble an array
mdadm --assemble /dev/md0 /dev/sd[bcdef] mdadm --detail --scan >> /etc/mdadm/mdadm.conf
mkdir -pv /data mount /dev/md0 /data grep /data /etc/mtab >> /etc/fstab
$ dmesg |grep kick
[ 547.114433] md: kicking non-fresh sdf from array! [ 547.141308] md: kicking non-fresh sdb from array!
re-add failed drives
/sbin/mdadm /dev/md0 --fail /dev/sda5 --remove /dev/sda5 /sbin/mdadm /dev/md0 --add /dev/sda5
beware order of reassembly
<nevyn> sigmonsay: more precicely if you had an array with disk A B C D <nevyn> sigmonsay: the trick is. <nevyn> if the array ejects B continues degraded (but one failure is non-fatal) <nevyn> and then ejects D <nevyn> if you reassemble the array with ABC then D then much badness happens <nevyn> if you reassemble with ACD then B then it's fine
Initiate self check
/usr/share/mdadm/checkarray --idle md0
random
rescan scsi bus
echo "- - -" > /sys/class/scsi_host/host0/scan