Skip to content

Instantly share code, notes, and snippets.

@Alex-Ikanow
Created April 11, 2012 13:06
Show Gist options
  • Save Alex-Ikanow/2359188 to your computer and use it in GitHub Desktop.
Save Alex-Ikanow/2359188 to your computer and use it in GitHub Desktop.
Script to install RAID on a blank m1.xlarge instance
umount /mnt
mdadm --create /dev/md0 --run --level=0 --chunk=256 --raid-devices=4 /dev/sdb /dev/sdc /dev/sdd /dev/sde
pvcreate /dev/md0
vgcreate data_vg /dev/md0
lvcreate -l 100%vg -n data_vol data_vg
mkfs.ext3 -m 0 /dev/data_vg/data_vol
mount -t ext3 /dev/data_vg/data_vol /mnt/
touch /etc/mdadm.conf
grep -F "/dev/md0" /etc/mdadm.conf || mdadm -Es | grep md0 >> /etc/mdadm.conf
sed -i s/"^\/dev\/sdb"/"\#\/dev\/sdb"/ /etc/fstab
grep -F "/dev/data_vg/data_vol" /etc/fstab || echo "/dev/data_vg/data_vol /mnt ext3 defaults
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment