Skip to content

Instantly share code, notes, and snippets.

@mnebuerquo
Created April 4, 2018 12:12
Show Gist options
  • Save mnebuerquo/9b16e56d8b0d7fe1e5fd355dcb325944 to your computer and use it in GitHub Desktop.
Save mnebuerquo/9b16e56d8b0d7fe1e5fd355dcb325944 to your computer and use it in GitHub Desktop.
#!/bin/sh
# find out if we're sudo
if [ $(id -u) -ne 0 ]; then
echo "Nope. Simon didn't say so.";
exit 1;
fi
target="/dev/md0"
mountpoint="/data"
dev1="/dev/xvdb"
dev2="/dev/xvdc"
mdadm --create "${target}" --level=0 --raid-devices=2 "${dev1}" "${dev2}"
mkfs.ext4 /dev/md0
mkdir -p "${mountpoint}"
mount "${target}" "${mountpoint}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment