Skip to content

Instantly share code, notes, and snippets.

@joleeee
Last active May 18, 2021 00:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joleeee/96e014529b7591edf490e9db7586f76f to your computer and use it in GitHub Desktop.
Save joleeee/96e014529b7591edf490e9db7586f76f to your computer and use it in GitHub Desktop.
apk add mdadm
echo path to disk A?
read a
echo path to disk B?
read b
mdadm --create --verbose /dev/md0 --level=raid0 --raid-devices=2 $a $b
cp /etc/mdadm.conf /tmp/mdadm.conf
mdadm --detail --scan /dev/md0 >> /tmp/mdadm.conf
cat /tmp/mdadm.conf | uniq > /etc/mdadm.conf
rm /tmp/mdadm.conf
mkinitfs
apk add xfsprogs
mkfs.xfs /dev/md0
mkdir -p /array
u=`blkid | grep /dev/md0 | awk '{print $2}' | sed 's/"//g'`
cp /etc/fstab /tmp/fstab
echo "$u /array xfs defaults 0 0" >> /tmp/fstab
cat /tmp/fstab | uniq > /etc/fstab
rm /tmp/fstab
@joleeee
Copy link
Author

joleeee commented May 18, 2021

wget https://jole.xyz/src/raid0-xfs.sh -O install && chmod +x install && ./install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment