Last active
December 6, 2018 06:28
-
-
Save edwardtheharris/3740a949fd803fece9d59e7f92553942 to your computer and use it in GitHub Desktop.
ArchLinux RAID Creation
This file contains hidden or 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 | |
arrayname='media' | |
# 150G partitions, fd00 filesystem type | |
gdisk /dev/sdb | |
gdisk /dev/sdc | |
gdisk /dev/sdd | |
mdadm --verbose -C /dev/md0 -l6 -Nmedia -n12 \ | |
/dev/sdb1 /dev/sdb2 /dev/sdb3 /dev/sdb4 /dev/sdb5 /dev/sdc1 \ | |
/dev/sdc2 /dev/sdc3 /dev/sdc4 /dev/sdc5 /dev/sdd1 /dev/sdd2 \ | |
-x3 /dev/sdb6 /dev/sdc6 /dev/sdd3 | |
mdadm --detail --scan >> /etc/mdadm.conf | |
mdadm --assemble --scan | |
stride=`expr 512 / 4` | |
stripe=$(echo "${stride}*11" | bc -l) | |
mkfs.ext4 -v -L ${arrayname} -m 0.01 -b 4096 -E stride=${stride},stripe-width=${stripe} /dev/md0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment