Linux soft raid

Published: Sunday, 27 December 2015

mdadm

mdadm is the software used for building, managing and monitoring md devices (or RAID arrays).

Monitoring

Use cat /proc/mdstat.

# cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath]
md1 : active raid5 sda3[2] sdc3[1] sdd3[0]
      7794126848 blocks super 1.0 level 5, 512k chunk, algorithm 2 [3/3] [UUU]
      [>....................]  resync =  2.5% (100223808/3897063424) finish=744.1min speed=85037K/sec

md256 : active raid1 sdb2[2](S) sdf2[4](S) sda2[3](S) sdc2[1] sdd2[0]
      530112 blocks super 1.0 [2/2] [UU]
      bitmap: 0/1 pages [0KB], 65536KB chunk

md13 : active raid1 sdb4[24] sdf4[25] sdd4[0] sda4[2] sdc4[1]
      458880 blocks super 1.0 [24/5] [UUUUU___________________]
      bitmap: 1/1 pages [4KB], 65536KB chunk

md9 : active raid1 sdb1[24] sdf1[25] sdd1[0] sda1[2] sdc1[1]
      530048 blocks super 1.0 [24/5] [UUUUU___________________]
      bitmap: 1/1 pages [4KB], 65536KB chunk

unused devices: <none>

Speed settings

speed_limit_min

# cat /proc/sys/dev/raid/speed_limit_min
5000

This is the min speed in kb/s for rebuilding the array.

speed_limit_max

# cat /proc/sys/dev/raid/speed_limit_max
200000

This is the max speed in kb/s for rebuilding the array when there is idle I/O time.