Software RAID in Linux
Impelement and Running RAID on Linux
# Check Kernel Support RAID
cat /boot/confg-$(uname -r) | grep -i raid
# Create fd partition lable on all disk
for i in /dev/sd{b..d}
do
fdisk $i << EOF
n
p
t
fd
w
EOF
done
# Using mdadm tool to create RAID on linux
mdadm -C /dev/md0 -l raid5 -n 3 /dev/sdb1 /dev/sdc1 /dev/sdd1
# Verification of RAID creation
cat /proc/mdstat
mdadm --detail /dev/md0
# Create file system on RAID partition
mke2fs -T ext4 /dev/md0
# Fail a disk of RAID array
mdadm -f /dev/md0 /dev/sdb1
# Remove a disk from RAID array
mdadm -r /dev/md0 /dev/sdb1
# Add a disk to RAID array
mdadm -a /dev/md0 /dev/sdc1
# Configuring hot spare on creation time
mdadm -C /dev/md0 -l raid5 -n 3 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1
Last updated on 26 Oct 2019
Published on 23 Nov 2018