Skip to content

Instantly share code, notes, and snippets.

@acidprime
Created January 9, 2012 01:15
Show Gist options
  • Save acidprime/1580401 to your computer and use it in GitHub Desktop.
Save acidprime/1580401 to your computer and use it in GitHub Desktop.
Create Software RAID
#!/bin/bash
declare -x MIRROR_VOL="Server HD"
declare -x RAID_VOL="/Volumes/Server HD"
declare -x RAID_VOL2="/Volumes/Server HD 2"
declare -x diskutil="/usr/sbin/diskutil"
# Name as MirroredVolume for Novice users in disk utility
$diskutil createRAID mirror "ServerRAID" JHFS+ "$RAID_VOL" "$RAID_VOL2"
# Rename to HD Name
$diskutil renameVolume /Volumes/ServerRAID "$MIRROR_VOL"
# Set AutoRebuild
$diskutil appleRAID update AutoRebuild 1 "/Volumes/$MIRROR_VOL"
$diskutil enableJournal "/Volumes/$MIRROR_VOL"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment