= md (software RAID) and lvm (logical volume management) = [[TableOfContents()]] == md == Building a RAID array using mdadm - two primary steps: 1. mdadm --create to build the array using available resources 2. mdadm --detail --scan to build config string for /etc/mdadm/mdadm.conf Simple examples: === RAID6 array === * Set up partitions to be used (in this case the whole disk): {{{ # for x in /dev/sd{b,c,d,e,f}1 ; do fdisk $x ; done }}} * Create the array (in this case, with one hot-spare): {{{ # mdadm --create /dev/md0 --level=6 --raid-devices=4 --spare-devices=1 /dev/sd{b,c,d,e,f}1 }}} * Configure the array for reboot (append to the end of /etc/mdadm/mdadm.conf): {{{ # mdadm --detail --scan ARRAY /dev/md/0 metadata=1.2 spares=1 name=debian6-vm:0 UUID=9b42abcd:309fabcd:6bfbabcd:298dabcd }}} Considerations when setting up the partitions might be that any replacement disks will need to support that same size partition. Unconfirmed but it sounds like it might be a reasonable concern: "Enter a value smaller than the free space value minus 2% or the disk size to make sure that when you will later install a new disk in replacement of a failed one, you will have at least the same capacity even if the number of cylinders is different." (http://www.jerryweb.org/settings/raid/) === RAID1 array === Pretty much the same process - but for reference here's the simpler RAID1 config without any spare: {{{ # mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/sd{g,h}1 }}} And here's how the config looks: {{{ ARRAY /dev/md1 metadata=1.2 name=debian6-vm:1 UUID=fa94abcd:317fabcd:3a61abcd:4932abcd }}} == lvm == TODO