{"id":1557,"date":"2013-07-19T20:33:46","date_gmt":"2013-07-20T00:33:46","guid":{"rendered":"http:\/\/cd34.com\/blog\/?p=1557"},"modified":"2013-07-19T20:33:46","modified_gmt":"2013-07-20T00:33:46","slug":"raid-1-or-maybe-not","status":"publish","type":"post","link":"https:\/\/cd34.com\/blog\/infrastructure\/raid-1-or-maybe-not\/","title":{"rendered":"Raid 1&#8230; or maybe not"},"content":{"rendered":"<p>We received a client machine a while back. At some point they needed more disk space and sent us a pair of drives with instructions for mirroring data from the existing machine to the new drives.<\/p>\n<p>When I looked at the drive I noticed something odd:<\/p>\n<pre>\r\nmd4 : active raid1 sdb8[1](S) sda8[0]\r\n      1942145856 blocks super 1.2 [1\/1] [U]\r\n<\/pre>\n<p>While this was a Raid 1 set, notice that the indicator shows that sdb8 is a Spare (S) and that the Raid 1 set has 1 of 1 drive and isn&#8217;t broken. This usually occurs when someone is doing an in-place migration to a larger drive and creates a Raid 1 partition with a single device and forces it online with the intention of later adding the second drive. Had the primary drive failed, they would have experienced data loss.<\/p>\n<p>To fix it:<\/p>\n<pre>\r\nmdadm --remove \/dev\/md4 \/dev\/sdb8\r\nmdadm --grow \/dev\/md4 --raid-devices=2 --force\r\nmdadm --add \/dev\/md4 \/dev\/sdb8\r\n<\/pre>\n<p>and we see the resulting md status:<\/p>\n<pre>\r\nmd4 : active raid1 sda8[0]\r\n      1942145856 blocks super 1.2 [2\/1] [U_]\r\n<\/pre>\n<p>After the reconstruction we now have a properly configured Raid 1 set.<\/p>\n<div style=\"float:left;\">\n<div id=\"fb-root\"><\/div>\n<fb:like href=\"https:\/\/cd34.com\/blog\/infrastructure\/raid-1-or-maybe-not\/\" width=\"250\" send=\"false\" show_faces=\"false\" layout=\"button_count\" action=\"recommend\"><\/fb:like>\n<\/div><div style=\"clear:both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>We received a client machine a while back. At some point they needed more disk space and sent us a pair of drives with instructions for mirroring data from the existing machine to the new drives. When I looked at the drive I noticed something odd: md4 : active raid1 sdb8[1](S) sda8[0] 1942145856 blocks super [&hellip;]<\/p>\n<div style=\"float:left;\">\n<div id=\"fb-root\"><\/div>\n<fb:like href=\"https:\/\/cd34.com\/blog\/infrastructure\/raid-1-or-maybe-not\/\" width=\"250\" send=\"false\" show_faces=\"false\" layout=\"button_count\" action=\"recommend\"><\/fb:like>\n<\/div><div style=\"clear:both;\"><\/div>","protected":false},"author":15,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[125,126],"class_list":["post-1557","post","type-post","status-publish","format-standard","hentry","category-infrastructure","tag-mdadm","tag-raid"],"_links":{"self":[{"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/posts\/1557","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/comments?post=1557"}],"version-history":[{"count":1,"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/posts\/1557\/revisions"}],"predecessor-version":[{"id":1558,"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/posts\/1557\/revisions\/1558"}],"wp:attachment":[{"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/media?parent=1557"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/categories?post=1557"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/tags?post=1557"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}