From 26e0fa8c916c1fe9bfded000ef797ca71cac9449 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 15 Jun 2022 09:50:06 -0400 Subject: [PATCH] Add swraid example to misc --- misc/swraid | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 misc/swraid diff --git a/misc/swraid b/misc/swraid new file mode 100644 index 00000000..3e234dc8 --- /dev/null +++ b/misc/swraid @@ -0,0 +1,18 @@ +DEVICES="/dev/sda /dev/sdb" +RAIDLEVEL=1 +mdadm --detail /dev/md*|grep 'Version : 1.0' >& /dev/null && exit 0 +lvm vgchange -a n +mdadm -S -s +NUMDEVS=$(for dev in $DEVICES; do + echo wipefs -a $dev +done|wc -l) +for dev in $DEVICES; do + wipefs -a $dev +done +# must use older metadata format to leave disks looking normal for uefi +mdadm -C /dev/md/raid $DEVICES -n $NUMDEVS -e 1.0 -l $RAIDLEVEL +# shut and restart array to prime things for anaconda +mdadm -S -s +mdadm --assemble --scan +readlink /dev/md/raid|sed -e 's/.*\///' > /tmp/installdisk +