2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-06-02 00:08:35 +00:00
Files
confluent/misc/swraid
T
Markus Hilger 94eee92d36 Fix software RAID creation with newer mdadm versions
Recent mdadm versions introduced an interactive prompt when creating RAID arrays
without an explicit bitmap configuration:

  "To optimize recovery speed, it is recommended to enable write-intent bitmap,
   do you want to enable it now? [y/N]?"

This behavior was introduced by upstream change:
https://github.com/md-raid-utilities/mdadm/commit/e97c4e18c847803016aa60066cb6e57c528d83a6

In non-interactive environments such as Anaconda, this prompt blocks installation
and causes RAID creation to hang.

Fix this by explicitly enabling the internal bitmap when creating RAID arrays.
2026-05-21 23:44:53 +02:00

24 lines
650 B
Plaintext

DEVICES="/dev/sda /dev/sdb"
RAIDLEVEL=1
mdadm --detail /dev/md*|grep 'Version : 1.0' >& /dev/null || (
lvm vgchange -a n
mdadm -S -s
NUMDEVS=$(for dev in $DEVICES; do
echo wipefs -a -f $dev
done|wc -l)
for dev in $DEVICES; do
wipefs -a -f $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 -b internal
# shut and restart array to prime things for anaconda
mdadm -S -s
mdadm --assemble --scan
)
while [ ! -e /dev/md/raid ]; do
echo 'Waiting on array to be linked...'
sleep 0.5
done
readlink /dev/md/raid|sed -e 's/.*\///' > /tmp/installdisk