Wikipedia has a quick reference with all the important stuff, oddly enough:
http://en.wikipedia.org/wiki/Mdadm
Create the raid: (if your raid drives are sdb and sdc, and you've partitioned them)
mdadm --create /dev/md0 --level=mirror --raid-devices=2 /dev/sdb1 /dev/sdc1
Append array details to mdadm.conf:
mdadm -Es | grep md0 >> /etc/mdadm/mdadm.conf
After which the boot ramdisk should be updated:
update-initramfs -u
Create the filesystem:
mkfs.ext4 /dev/md0
Add it to /etc/fstab:
/dev/md0 /store ext4 defaults,nobootwait 0 2
"/store", or whatever you use, must already exist as a directory. The nobootwait is to prevent startup from halting if it can't mount it for some reason. I also add "barrier=1,nodelalloc" to reduce risk of loss in a crash at the cost of performance, and "noatime" to gain a small bit back.
Mount with "mount -a"
Another option is to use LVM, which has some mirroring support on its own, and it makes growing and moving volumes much easier, or you can use it in combination with mdadm.
Bookmarks