Software Raid
Create raid:
Raid levels can be changed with: --level=1 // --level=0 // --level=5
Raid 1
mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sdX /dev/sdX
Raid 5
mdadm --create --verbose /dev/md0 --level=5 --raid-devices=3 /dev/sdX /dev/sdX /dev/sdX
Raid 6
mdadm --create --verbose /dev/md0 --level=6 --raid-devices=4 /dev/sda /dev/sdX /dev/sdX /dev/sdX
Raid 10
mdadm --create --verbose /dev/md0 --level=10 --layout=o3 --raid-devices=4 /dev/sdX /dev/sdX /dev/sdX /dev/sdX
Stop raid:
mdadm --stop /dev/md0
Assemble raid:
mdadm -A /dev/mdX /dev/sdaX --run
Adding a drive in a failed raid:
mdadm --manage /dev/md0 --add /dev/sdb1
Cloning a partition table
MBR:
X = Source (old drive), Y = Destination (new drive)
sfdisk -d /dev/sdX | sfdisk /dev/sdY --force
GPT:
Install gdisk
sgdisk /dev/sdX -R /dev/sdY