Created
May 23, 2012 13:00
-
-
Save muhqu/2775134 to your computer and use it in GitHub Desktop.
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
| sudo apt-get update && | |
| sudo apt-get install -y mdadm xfsprogs | |
| volumes=4 | |
| raiddevice=/dev/md1 | |
| mountpoint=/mnt/db-raid0-xfs | |
| devices=$(perl -e 'for$i("h"){for$j("",1..15){print"/dev/sd$i$j\n"}}'| head -$volumes) | |
| devicearray=($devices) | |
| echo $devices | |
| sudo mdadm --create --verbose $raiddevice \ | |
| --level=raid0 \ | |
| --metadata=1.2 \ | |
| --chunk=256 \ | |
| --raid-devices=$volumes $devices | |
| echo DEVICE $devices | sudo tee -a /etc/mdadm/mdadm.conf | |
| sudo blockdev --setra 65536 $raiddevice | |
| sudo mkfs.xfs -d su=256k,sw=4 $raiddevice | |
| echo "$raiddevice $mountpoint xfs noatime,nobootwait 0 0" | sudo tee -a /etc/fstab | |
| sudo mkdir -p $mountpoint | |
| sudo mount $mountpoint | |
| sudo chown ubuntu:ubuntu $mountpoint | |
| ls -la $mountpoint | |
| volumes=4 | |
| raiddevice=/dev/md2 | |
| mountpoint=/mnt/view-raid0-xfs | |
| devices=$(perl -e 'for$i("i"){for$j("",1..15){print"/dev/sd$i$j\n"}}'| head -$volumes) | |
| devicearray=($devices) | |
| echo $devices | |
| sudo mdadm --create --verbose $raiddevice \ | |
| --level=raid0 \ | |
| --metadata=1.2 \ | |
| --chunk=256 \ | |
| --raid-devices=$volumes $devices | |
| echo DEVICE $devices | sudo tee -a /etc/mdadm/mdadm.conf | |
| sudo mdadm --detail --scan | sudo tee -a /etc/mdadm/mdadm.conf | |
| sudo blockdev --setra 65536 $raiddevice | |
| sudo mkfs.xfs -d su=256k,sw=4 $raiddevice | |
| echo "$raiddevice $mountpoint xfs noatime,nobootwait 0 0" | sudo tee -a /etc/fstab | |
| sudo mkdir -p $mountpoint | |
| sudo mount $mountpoint | |
| sudo chown ubuntu:ubuntu $mountpoint | |
| ls -la $mountpoint |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment