Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tovbinm/2047800 to your computer and use it in GitHub Desktop.
Save tovbinm/2047800 to your computer and use it in GitHub Desktop.
EC2
#!/bin/bash
apt-get -y update
apt-get -y install mdadm
echo "y" | mdadm --create /dev/md0 --level 0 --raid-devices 2 /dev/xvdb /dev/xvdc
echo "DEVICE /dev/xvdb /dev/xvdc" > /etc/mdadm/mdadm.conf
mdadm --detail --scan >> /etc/mdadm/mdadm.conf
blockdev --setra 65536 /dev/md0
mkfs.ext3 -F /dev/md0
mkdir -p /mnt/dataraid && mount -t ext3 /dev/md0 /mnt/dataraid -o noatime
echo "/dev/md0 /mnt/dataraid ext3 noatime 0 0" | tee -a /etc/fstab
ec2-run-instances ami-1cbc4375 -b '/dev/sdb=ephemeral0' -b '/dev/sdc=ephemeral1' -t m1.large -g <security-group> -k <ec2-key-name> -z us-east-1d -K ./pk-***.pem -C ./cert-***.pem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment