{"id":54,"date":"2015-04-28T17:56:03","date_gmt":"2015-04-28T15:56:03","guid":{"rendered":"https:\/\/rizzus.tech\/?p=54"},"modified":"2016-04-13T14:33:06","modified_gmt":"2016-04-13T12:33:06","slug":"raid-qnap","status":"publish","type":"post","link":"https:\/\/rizzus.tech\/?p=54","title":{"rendered":"raid qnap"},"content":{"rendered":"<p>Increase the speed of Linux Software RAID reconstruction<\/p>\n<p>If you are in a situation where you sit in front of the console (or on a remote ssh connection) waiting for a Linux software RAID to finish rebuilding (either you added a new drive, or you replaced a failed one, etc.) then you might be frustrated by how slow this process is running. You are running cat on \/proc\/mdstat repeatedly (you should really use watch in this case <img decoding=\"async\" title=\"Wink\" src=\"http:\/\/forum.qnap.com\/images\/smilies\/icon_wink.gif\" alt=\";)\" \/>), and this seems to never finish\u2026 Obviously that there is a logical reason for this \u2018slowness\u2018 and on a production system you should leave it running with the defaults. But in case you want to speed up this process here is how you can do it. This will place a much higher load on the system so you should use it with care.<\/p>\n<p>To see your Linux kernel speed limits imposed on the RAID reconstruction use:<\/p>\n<dl class=\"codebox\">\n<dt>CODE: <a href=\"http:\/\/forum.qnap.com\/viewtopic.php?t=10268#\">SELECT ALL<\/a><\/dt>\n<dd><code>cat \/proc\/sys\/dev\/raid\/speed_limit_max<br \/>\n200000<br \/>\ncat \/proc\/sys\/dev\/raid\/speed_limit_min<br \/>\n1000<\/code><\/dd>\n<\/dl>\n<p>In the system logs you can see something similar to:<\/p>\n<dl class=\"codebox\">\n<dt>CODE: <a href=\"http:\/\/forum.qnap.com\/viewtopic.php?t=10268#\">SELECT ALL<\/a><\/dt>\n<dd><code>md: minimum _guaranteed_ reconstruction speed: 1000 KB\/sec\/disc.<br \/>\nmd: using maximum available idle IO bandwidth (but not more than 200000 KB\/sec) for reconstruction.<\/code><\/dd>\n<\/dl>\n<p>This means that the minimum guaranteed speed of the rebuild of the array is approx 1MB\/s. The actual speed will be higher and will depend on the system load and what other processes are running at that time.<br \/>\nIn case you want to increase this minimum speed you need to enter a higher value in speed_limit_min. For example to set this to approx 50 megabytes per second as minimum use:<\/p>\n<dl class=\"codebox\">\n<dt>CODE: <a href=\"http:\/\/forum.qnap.com\/viewtopic.php?t=10268#\">SELECT ALL<\/a><\/dt>\n<dd><code>echo 50000 &gt;\/proc\/sys\/dev\/raid\/speed_limit_min<\/code><\/dd>\n<\/dl>\n<p>The results are instant\u2026 you can return to the watch window to see it running, and hope that this will finish a little faster (this will really depend on the system you are running, the HDDs, controllers, etc.):<\/p>\n<dl class=\"codebox\">\n<dt>CODE: <a href=\"http:\/\/forum.qnap.com\/viewtopic.php?t=10268#\">SELECT ALL<\/a><\/dt>\n<dd><code>watch cat \/proc\/mdstat<\/code><\/dd>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>Increase the speed of Linux Software RAID reconstruction If you are in a situation where&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/rizzus.tech\/?p=54\">Read the post<span class=\"screen-reader-text\">raid qnap<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":91,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-54","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-qnap","excerpt","zoom","full-without-featured","even","excerpt-0"],"_links":{"self":[{"href":"https:\/\/rizzus.tech\/index.php?rest_route=\/wp\/v2\/posts\/54","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rizzus.tech\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rizzus.tech\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rizzus.tech\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rizzus.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=54"}],"version-history":[{"count":2,"href":"https:\/\/rizzus.tech\/index.php?rest_route=\/wp\/v2\/posts\/54\/revisions"}],"predecessor-version":[{"id":92,"href":"https:\/\/rizzus.tech\/index.php?rest_route=\/wp\/v2\/posts\/54\/revisions\/92"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rizzus.tech\/index.php?rest_route=\/wp\/v2\/media\/91"}],"wp:attachment":[{"href":"https:\/\/rizzus.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=54"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rizzus.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=54"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rizzus.tech\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=54"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}