I had a problem with my NAS on my Raspberry Pi, for some reason it was running very slow and causing the Pi to crash randomly. It was just a single usb hard drive using Samba. So I decided to replace it with a RAID, in order to actaully get the Pi back in working order I had to reimage it. (I think this actually fixed my issue.) Then I got started making the RAID drive
mdadm using apt
sudo apt updatesudo apt install mdadmsudo umount /dev/sdXsudo mkfs -t ext4 /dev/sdXsudo mdadm --create --verbose /dev/md0 --level=6 --raid-devices=X /dev/sdX Fill in the X with the drive names that you have, and you can change the name /dev/md0 to something else if you like.sudo mdadm --detail --scan | sudo tee -a /etc/mdadm/mdadm.conf This adds the drive information to the configuration file. tee -a will add the output to the end of the file.sudo update-initramfs -u This updates the initial file system for the Raspberry Pi.echo '/dev/md0 /mnt/md0 ext4 defaults,nofail,discard 0 0' | sudo tee -a /etc/fstab This adds it to the fstab file, which is what the computer using to mount the file systems on start up. IMPORTANT! nofail is important! your system can fail to boot if it doesn't detect the file system with out it.I'm still at the last step here and building it, I hope this can be a good way to keep my files safe and find a use for old usb drives that I have laying around. I used this guide a lot Digital Ocean Guide