Last active
June 28, 2016 18:48
-
-
Save irisli/ec1494b179a52ac3f980fdba270b5e08 to your computer and use it in GitHub Desktop.
RAID setup for EC2 instances with ephemeral instance storage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 8 disk raid 0 | |
# sudo mdadm --create --verbose /dev/md0 --level=0 --name=EPHEMERAL_RAID --raid-devices=8 /dev/xvdb /dev/xvdc /dev/xvdd /dev/xvde /dev/xvdf /dev/xvdg /dev/xvdh /dev/xvdi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create file system | |
sudo mkfs.ext4 -L EPHEMERAL_RAID /dev/md0 | |
# Create mount point | |
sudo mkdir -p /mnt/ephraid | |
# Create mount disks | |
sudo mount LABEL=EPHEMERAL_RAID /mnt/ephraid | |
sudo chown ubuntu /mnt/ephraid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo mdadm --detail /dev/md0 | |
sudo umount /dev/md0 # umount -l for lazy | |
sudo mdadm --stop /dev/md0 | |
sudo mdadm --remove /dev/md0 | |
sudo mdadm --zero-superblock /dev/xvdb | |
sudo mdadm --zero-superblock /dev/xvdc | |
sudo mdadm --zero-superblock /dev/xvdd | |
sudo mdadm --zero-superblock /dev/xvde | |
sudo mdadm --zero-superblock /dev/xvdf | |
sudo mdadm --zero-superblock /dev/xvdg | |
sudo mdadm --zero-superblock /dev/xvdh | |
sudo mdadm --zero-superblock /dev/xvdi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment