#!/bin/sh
FSUUID=`tune2fs -l /dev/md0 |grep UUID | sed -n -e 's/^.*UUID: //p'`
umount /dev/md0 
UUID=`mdadm --misc -Q --detail /dev/md0 | grep UUID | sed -n -e 's/^.*UUID : //p'` 
mdadm -S /dev/md0
echo mdadm --create --level=1 -f --raid-devices=4 -b internal --uuid $UUID /dev/md0 /dev/sda1 /dev/sdb1 /dev/nvme0n1p1 /dev/nvme1n1p1 >/tmp/md.txt
echo y| mdadm --create --level=1 -f --raid-devices=4 -b internal --uuid $UUID /dev/md0 /dev/sda1 /dev/sdb1 /dev/nvme0n1p1 /dev/nvme1n1p1
mkfs.ext4 -L /boot -U $FSUUID -F /dev/md0;
mount /dev/md0 /target/boot
