Ubuntu Raid 10 Script

cat /proc/mdstat
lsblk -o NAME,SIZE,FSTYPE,TYPE,MOUNTPOINT
sudo mdadm –create –verbose /dev/md0 –level=10 –raid-devices=4 /dev/sda1 /dev/sdb1 /dev/sdd1 /dev/sde1
sudo mkfs.ext4 -F /dev/md0
sudo mkdir -p /mnt/md0
sudo mount /dev/md0 /mnt/md0
df -h -x devtmpfs -x tmpfs
sudo mdadm –detail –scan | sudo tee -a /etc/mdadm/mdadm.conf
sudo update-initramfs -u
echo ‘/dev/md0 /mnt/md0 ext4 defaults,nofail,discard 0 0’ | sudo tee -a /etc/fstab
reboot