In order to set up software raid we need to install mdadm tools (Ubuntu/Debian)
apt-get install mdadm
Now for setting up raid one using two drives for example /dev/sdd and /dev/sdc we are issuing the following command
mdadm --create /dev/md2 --level=1 --raid-devices=2 /dev/sdc /dev/sdd
mkfs.ext4 /dev/md2
mdadm --detail --scan
From the last command you will see UUID of the /dev/md2 which you have to add to /etc/mdadm/mdadm.conf for example:
echo "ARRAY /dev/md2 metadata=1.2 UUID=11fb58d4:6a2b5d32:480c88df:6ebafb16">>/etc/mdadm/mdadm.conf