{"id":755,"date":"2012-09-09T23:59:25","date_gmt":"2012-09-10T05:59:25","guid":{"rendered":"http:\/\/blog.supportpro.com\/?p=755"},"modified":"2019-10-30T05:43:37","modified_gmt":"2019-10-30T11:43:37","slug":"how-to-replace-a-faulty-drive-in-a-software-raid-under-linux","status":"publish","type":"post","link":"https:\/\/www.supportpro.com\/blog\/how-to-replace-a-faulty-drive-in-a-software-raid-under-linux\/","title":{"rendered":"How to replace a faulty drive in a Software RAID under Linux?"},"content":{"rendered":"<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\">First we need to identify failed RAID Arrays. we can gather information from the following command&#8217;s output.<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\"># cat \/proc\/mdstat<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\">Removing the failed partition and disk<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\"># mdadm &#8211;manage \/dev\/md0 &#8211;remove \/dev\/sdb1<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\">=&gt; Power down<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\"># shutdown -h now<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\">Then replace the drive and power up<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\">In order to use the new drive we should have to create the same partition table structure that was on the old One.<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\"># sfdisk -d \/dev\/sda | sfdisk \/dev\/sdb<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\">After that we can add the partitions to the RAID Array.<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\"># mdadm &#8211;manage \/dev\/md0 &#8211;add \/dev\/sdb1<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\">Now, we can check the status of the partitions by issuing<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\"># cat \/proc\/mdstat<\/div>\n<p>First we need to identify failed RAID Arrays. we can gather information from the following command&#8217;s output.<\/p>\n<blockquote><p># cat \/proc\/mdstat<\/p><\/blockquote>\n<p>Removing the failed partition and disk<\/p>\n<blockquote><p># mdadm &#8211;manage \/dev\/md0 &#8211;remove \/dev\/sdb1<\/p><\/blockquote>\n<p>Power down<\/p>\n<blockquote><p># shutdown -h now<\/p><\/blockquote>\n<p>Then replace the drive and power up<\/p>\n<p>In order to use the new drive we should have to create the same partition table structure that was on the old One.<\/p>\n<blockquote><p># sfdisk -d \/dev\/sda | sfdisk \/dev\/sdb<\/p><\/blockquote>\n<p>After that we can add the partitions to the RAID Array.<\/p>\n<blockquote><p># mdadm &#8211;manage \/dev\/md0 &#8211;add \/dev\/sdb1<\/p><\/blockquote>\n<p>Now, we can check the status of the partitions by issuing<\/p>\n<blockquote><p># cat \/proc\/mdstat<\/p><\/blockquote>\n<p>If you require help, c<a href=\"https:\/\/www.supportpro.com\/requestquote.php\">ontact SupportPRO Server Admin<\/a><\/p>\n<p style=\"text-align: center;\"><!--HubSpot Call-to-Action Code --><span id=\"hs-cta-wrapper-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-wrapper\"><span id=\"hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-node hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\"><!-- [if lte IE 8]><\/p>\n\n\n\n\n\n<div id=\"hs-cta-ie-element\"><\/div>\n\n\n<![endif]--><a href=\"https:\/\/www.supportpro.com\/freecheckup.php\"><img decoding=\"async\" id=\"hs-cta-img-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-img\" style=\"border-width: 0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/2725694\/9d590242-d641-4383-94b4-8cfd62f0af6b.png\" alt=\"Server not running properly? Get A FREE Server Checkup By Expert Server Admins - $125 Value\" \/><\/a><\/span><script charset=\"utf-8\" src=\"https:\/\/js.hscta.net\/cta\/current.js\"><\/script><script type=\"text\/javascript\"> hbspt.cta.load(2725694, '9d590242-d641-4383-94b4-8cfd62f0af6b', {}); <\/script><\/span><!-- end HubSpot Call-to-Action Code --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>First we need to identify failed RAID Arrays. we can gather information from the following command&#8217;s output. # cat \/proc\/mdstat Removing the failed partition and disk # mdadm &#8211;manage \/dev\/md0&hellip;<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-755","post","type-post","status-publish","format-standard","hentry","category-miscellaneous"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/755","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/comments?post=755"}],"version-history":[{"count":5,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/755\/revisions"}],"predecessor-version":[{"id":4446,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/755\/revisions\/4446"}],"wp:attachment":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/media?parent=755"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/categories?post=755"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/tags?post=755"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}