Deleting a software RAID array will result in all data stored in the devices being lost. So be careful when you remove a RAID array, take backups in case needed.
Before you can remove the software RAID array, you need to unmount it.
umount /dev/mdX
Where /dev/mdX is the device name for the RAID device you need to remove.
Find the disk used to create the RAID with the command
mdadm --detail /dev/mdX
Stop the RAID device with the command
mdadm --stop /dev/mdX
Now you need to run the following commands for each storage device that are part of the RAID device.
mdadm --zero-superblock /dev/sdXY
IMPORTANT: you need to run this for each member of the RAID device.
Finally, edit /etc/mdadm/mdadm.conf, and remove the entry for the RAID array.
RAID 0 allows you to combine multiple disks into one large disk. Only use RAID 0 if the data is not important to you, for example, a backup server. If one disk fails in a RAID 0 array, all the data will be lost.
To create a software RAID 0 with 2 or more disks, first, we need to prepare the disks to be used as RAID members. Run the following commands on each of the disks we will be adding to the RAID 0 array.
parted /dev/sdX mklabel gpt
parted /dev/sdX mkpart primary ext4 0% 100%
parted /dev/sdX set 1 raid on
Replace /dev/sdX with actual device names and run the commands for all devices you will be adding to the RAID 0.
RAID 5 Requires 3 or more physical disks. It provides the redundancy of RAID 1 combined with the speed and size benefits of RAID 0. RAID 5 uses striping, like RAID 0, but also stores parity blocks distributed across each member disk. In the event of a failed disk, these parity blocks are used to reconstruct the data on a replacement disk. RAID 5 can withstand the loss of one member disk.
I have a server with 4 * 4 TB Disks. Here is parted -l result on the server.
On this server /dev/sda, /dev/sdb, /dev/sdc and /dev/sdd are 4 TB disks and are not in use. Lets format these disk to be used as RAID 5.
Following commands need to be executed for each of the disks.
parted -a optimal /dev/sda
mklabel gpt
mkpart primary ext4 0% 100%
set 1 raid on
align-check optimal 1
print
quit
This will partition the disks, set file system as raid.
Repeat the steps for /dev/sdb, /dev/sdc and /dev/sdd.
Now you have all disks formatted, ready to be used in raid array.