Raid 5 with mdadm

2013/07/09

Create the raid

mdadm –zero-superblock /dev/sd[b-h]

mdadm –zero-superblock /dev/sd[b-h]1

mdadm –create /dev/md0 –level=5 –raid-devices=7 /dev/sd[b-g]1 missing

mdadm –readwrite /dev/md0

pvcreate –dataalignment 512K /dev/md0 (match the chunk size)

vgcreate -s 128M lvm-raid /dev/md0

vgdisplay (get the extents)

lvcreate -l 44706 lvm-raid -n lvm0

mkfs.ext4 /dev/lvm-raid/lvm0

 

Speed up the resync

echo 50000 > /proc/sys/dev/raid/speed_limit_min
echo 200000 > /proc/sys/dev/raid/speed_limit_max

echo 8192 > /sys/block/md0/md/stripe_cache_size