2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-23 01:53:28 +00:00
confluent/misc/swraid

20 lines
537 B
Plaintext
Raw Normal View History

2022-06-15 13:50:06 +00:00
DEVICES="/dev/sda /dev/sdb"
RAIDLEVEL=1
2023-10-11 14:15:24 +00:00
mdadm --detail /dev/md*|grep 'Version : 1.0' >& /dev/null || (
2022-06-15 13:50:06 +00:00
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
2023-10-11 14:15:24 +00:00
)
2022-06-15 13:50:06 +00:00
readlink /dev/md/raid|sed -e 's/.*\///' > /tmp/installdisk