===Project 5 - RAID Arrays=== RAID stands for Redudant Array of Inexpensive Disks, it can be incredibly useful for backing up your data, increaseing your disk speed and size, or both! There are different types of RAID arrays, for more information consult [[http://en.wikipedia.org/wiki/RAID|this wiki]] There are more types of raid than these, but these are the different types I used. * RAID0 - Two or more disks with stripped data. * RAID1 - Two or more disks with mirrored data. * RAID5 - Three or more disks with parity. * RAID6 - Four or more disks with parity. * RAID10 - Four or more disks mirrored then stripped. * RAID01 - Four or more disks stripped then mirrored. - To setup your virtual disks on your VM, you'll need to be on your VM server (the VM server I used was named vmserver02). - CD into /xen/conf and open up you're virtual machines .cfg file (my VM was named vm11) - In your .cfg file you'll want to add disks. To do this; Under the "disk devices" section add.. * '''file:/xen/domains/vm11/disk_1.img,xvda3,w','' * '''file:/xen/domains/vm11/disk_2.img,xvda4,w','' * '''file:/xen/domains/vm11/disk_3.img,xvda5,w','' * '''file:/xen/domains/vm11/disk_4.img,xvda6,w','' * '''file:/xen/domains/vm11/disk_5.img,xvda7,w','' * '''file:/xen/domains/vm11/disk_6.img,xvda8,w','' * '''file:/xen/domains/vm11/disk_7.img,xvda9,w','' * '''file:/xen/domains/vm11/disk_8.img,xvda10,w','' - While still on your server.. - cd ''/xen/domains/vm11'' * dd ''if=/dev/zero of=disk_1.img bs=1M count=1024'' * Do this for all disks, 1 through 8. * dd is the data dump command, which will dump the data from the input file (if=/dev/zero) to the output file (of=disk_x.img). The /dev/zero file is a file full of infinate zeros. * bs=1M is bit size equals 1 megabyte count=1024, do it 1024 times. - At this point you'll need to install mdadm, mdadm will configure and allow the RAID array to functnuh. - Next, run the following * ''modprobe raid0'' * ''modprobe raid1'' * ''modprobe raid5'' * ''modprobe raid6'' * ''modprobe raid01'' * ''modprobe raid10'' - Modprobing all the raid types will allow the system to reconize what raids you are going to run. -To create the virtual raid do the following.. ==Raid0== * mdadm --create /dev/md0 --level=0 --raid-disks=2 /dev/xvda3 /dev/xvda4 * This uses mdadm to create a new raid. It will uses disks 1 and 2 (xvda3 and xvda4) and set it to level 0. * mkfs.ext3 /dev/md0 * mount /dev/md0 /mnt ==Raid1== * mdadm --create /dev/md0 --level=1 --raid-disks=2 /dev/xvda3 /dev/xvda4 * This will do the same thing as raid0, only setting up a raid1 instead of a raid0, obvisouly. * mkfs.ext3 /dev/md0 * mount /dev/md0 /mnt ==Raid5== * mdadm --create /dev/md0 --leve=5 --raid-disks=3 /dev/xvda3 /dev/xvda4 /dev/xvda5 * Like raid0 and raid1 this will set up a raid 5, only it uses three disks instead of two, too account for parity. * mkfs.ext3 /dev/md0 * mount /dev/md0 /mnt * ==Raid6== * mdadm --crate /dev/md0 --level=6 --raid-disks=4 /dev/xvda3 /dev/xvda4 /dev/xvda5 /dev/xvda6 * Again, like the previous raids this will set up raid6 using 4 disks. * mkfs.ext3 /dev/md0 * mount /dev/md0 /mnt ==Raid01== * For raid 01, we have to do a little bit more, but really, we're only using the same thing we've all ready done. - mdadm --create /dev/md0 --level=0 --raid-disk=2 /dev/xvda3 /dev/xvda4 - mdadm --create /dev/md1 --level=0 --raid-disk=2 /dev/xvda5/xvda6 * Here, we are creating 2 raid0 arrays, that we will then use together, as one, in our raid01 - mdadm --create /dev/md2 --level=1 --raid-disks=2 /dev/md0 /dev/md1 * You can see that rather than using the virtual disks, we use the two lower level raid's we set up, to act as the disks in the higher level raid. * mkfs.ext3 /dev/md0 * mount /dev/md0 /mnt ==Raid10== * For raid 10, we are going to do the same thing as RAID01. - mdadm --create /dev/md0 --level=0 --raid-disks=2 /dev/xvda3 /dev/xvda4 - mdadm --create /dev/md1 --level=0 --raid-disks=2 /dev/xvda5 /dev/xvda6 * Here, we are creating 2 raid0 arrays again, that we will once again use as our raid10. - mdadm --create /dev/md2 --level=1 --raid-disks=2 /dev/md0 /dev/md1 * You can see that rather than using the virtual disks, we use the two lower level raid's we set up, to act as the disks in the higher level raid. * mkfs.ext3 /dev/md0 * mount /dev/md0 /mnt