Increase mdadm raid rebuild speed

Increase mdadm raid rebuild speed

Category : How-to

Get Social!

Linux penguinmdadm can take quite a while when rebuilding arrays and the more disks there are, the longer it will take. As an example, it took 5 x 2TB WD green disks 3 days to complete.

There are two main ways to increase the rebuild speed of a mdadm array which are detailed below. Remember that it doesn’t matter what options you use here – you can still be limited by your CPU, memory and hard disk channel bandwidth.

Remove the mdadm rebuild speed restriction

mdadm has a parameter which restricts the speed of the rebuild process on each array. The idea behind this is to stop mdadm from making the rest of your system unusable by guaranteeing that it doesn’t consume all the available resource and IO bandwidth. The attributes can be increased to raise the speed limit on mdadm and reduce the time it takes to complete the rebuild process.

You will be editing your sysctl.conf file which holds many attributes for the Linux system. As always, and before editing any configuration file, you should take a backup.

Open the sysctl.conf file with a text editor.

Find or add the below parameter and set the value to the speed in KB/s which you would like to use. The below example sets the speed limit to 50 MB/s.

You will then need to load the settings using the sysctl command.

Add bitmap indexes to mdadm

Adding a bitmap index to a mdadm before rebuilding the array can dramatically speed up the rebuild process.

Use the below command to add a bitmap index to an array. The example assumes your array is found at /dev/md0.

Once the process has completed, use the below command to remove the mdadm bitmap index. Again, this example assumes your array is found at /dev/md0.

 


Related posts:


Leave a Reply

Visit our advertisers

Search

Quick Poll

How often do you change the password for the computer(s) you use?

Visit our advertisers