{"id":2803,"date":"2022-08-30T15:27:54","date_gmt":"2022-08-30T15:27:54","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/02\/17\/mdadm-failed-to-write-superblock-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:27:54","modified_gmt":"2022-08-30T15:27:54","slug":"mdadm-failed-to-write-superblock-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/mdadm-failed-to-write-superblock-collection-of-common-programming-errors\/","title":{"rendered":"mdadm: failed to write superblock-Collection of common programming errors"},"content":{"rendered":"<p>I&#8217;m quite new to RAID, and I&#8217;m having a problem. My server warned me that some drive is faulty, so I investigated:<\/p>\n<pre><code>root@server:~# cat \/proc\/mdstat\nPersonalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath] [faulty]\nmd1 : active raid1 sda1[2](F) sdb1[1]\n      10485696 blocks [2\/1] [_U]\n\nmd2 : active raid1 sda2[2](F) sdb2[1]\n      965746624 blocks [2\/1] [_U]\n\nunused devices: \n<\/code><\/pre>\n<p>It looks like that sda1 and sda2 are faulty. So I tried to remove sda1<\/p>\n<pre><code>root@server:~# mdadm \/dev\/md1 -r \/dev\/sda1\nmdadm: hot removed \/dev\/sda1 from \/dev\/md1\n<\/code><\/pre>\n<p>I&#8217;m trying to understand what should I do now: if I try to add the device again I get this message:<\/p>\n<pre><code>root@server:~# mdadm \/dev\/md1 -a \/dev\/sda1\nmdadm: failed to write superblock to \/dev\/sda1\n<\/code><\/pre>\n<p>I suppose I&#8217;m missing some rebuilding\/restore step. How can I restore the RAID system again?<\/p>\n<p><strong>UPDATE:<\/strong><\/p>\n<p>dmesg output shows a lot of these, so there&#8217;s some evidence of hardware failure:<\/p>\n<pre><code>sd 0:0:0:0: [sda] Unhandled error code\nsd 0:0:0:0: [sda]  Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK\nsd 0:0:0:0: [sda] CDB: Read(10): 28 00 00 00 10 07 00 00 01 00\nend_request: I\/O error, dev sda, sector 4103\n<\/code><\/pre>\n<ol>\n<li>\n<p>mdadm has marked the drive as faulty and your log is showing errors on the drive.<\/p>\n<p>This means the drive is broken and has to be replaced. There&#8217;s no point in readding it to the RAID.<\/p>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2014-02-17 00:22:42. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I&#8217;m quite new to RAID, and I&#8217;m having a problem. My server warned me that some drive is faulty, so I investigated: root@server:~# cat \/proc\/mdstat Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath] [faulty] md1 : active raid1 sda1[2](F) sdb1[1] 10485696 blocks [2\/1] [_U] md2 : active raid1 sda2[2](F) sdb2[1] 965746624 blocks [2\/1] [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2803","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2803","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=2803"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2803\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=2803"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=2803"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=2803"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}