-
-
Save millerjp/e846afb107f2ba061ba4 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# DANGER: ALL DATA WILL BE DELETED | |
# assumes disk order is consistent | |
# [email protected] 2015-05-09 | |
export PATH=/bin:/sbin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin | |
die () { echo "FATAL: $*"; exit 1; } | |
set -x | |
# wipe all existing partitions | |
for l in c d e f g h i j k l m n | |
do | |
for part in /dev/sd$l[0-9] | |
do | |
umount $part 2>/dev/null | |
done | |
sgdisk -Z /dev/sd$l | |
dd if=/dev/zero of=/dev/sd$l bs=1M count=50 | |
sgdisk -og /dev/sd$l | |
done | |
# create a single large partition on each device | |
count=0 | |
for l in c d e f g h i j k l m n | |
do | |
count=$((count+1)) | |
sgdisk -n 1:0:0 -t 1:8300 -c 1:"Data drive $count" /dev/sd$l | |
done | |
# create two RAID0 volumes, each with half of the available drives | |
mdadm --create /dev/md0 --chunk=256 --metadata=1.2 --raid-devices=6 --level=0 /dev/sd[cdefgh]1 | |
mdadm --create /dev/md1 --chunk=256 --metadata=1.2 --raid-devices=6 --level=0 /dev/sd[ijklmn]1 | |
mdadm --examine --scan > /etc/mdadm.conf | |
mkfs.xfs -b size=4096 -d su=262144 -d sw=6 /dev/md0 | |
mkfs.xfs -b size=4096 -d su=262144 -d sw=6 /dev/md1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment