{"id":1647,"date":"2019-11-30T09:57:44","date_gmt":"2019-11-30T08:57:44","guid":{"rendered":"http:\/\/clark.tipistrani.it\/?p=1647"},"modified":"2019-11-30T09:59:07","modified_gmt":"2019-11-30T08:59:07","slug":"raid1-via-software-degradato","status":"publish","type":"post","link":"http:\/\/clark.tipistrani.it\/?p=1647","title":{"rendered":"RAID1 via software degradato"},"content":{"rendered":"<p>Una mattina mi trovo nelle mail di sistema una cosa del genere:<\/p>\n<pre>This is an automatically generated mail message from mdadm\r\nrunning on libeccio\r\n\r\nA DegradedArray event had been detected on md device \/dev\/md\/4.\r\n\r\nFaithfully yours, etc.\r\n\r\nP.S. The \/proc\/mdstat file currently contains the following:\r\n\r\nPersonalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10] \r\nmd0 : active raid1 sda1[0]\r\n      487104 blocks super 1.2 [2\/1] [U_]\r\n      \r\nmd5 : active raid1 sda7[0]\r\n      283077632 blocks super 1.2 [2\/1] [U_]\r\n      bitmap: 2\/3 pages [8KB], 65536KB chunk\r\n\r\nmd4 : active raid1 sda6[0]\r\n      4975616 blocks super 1.2 [2\/1] [U_]\r\n      \r\nmd2 : active raid1 sda3[0]\r\n      97590272 blocks super 1.2 [2\/1] [U_]\r\n      \r\nmd1 : active raid1 sda2[0] sdb2[1]\r\n      4390912 blocks super 1.2 [2\/2] [UU]\r\n      \r\nmd3 : active raid1 sda5[0]\r\n      97589248 blocks super 1.2 [2\/1] [U_]\r\n      \r\nunused devices: &lt;none&gt;\r\n\r\nOh cacchio...\r\nuna ricerca in dmssg mi dice:\r\n md: bind&lt;sda2&gt;\r\n[    1.778287] hub 2-10:1.0: 2 ports detected\r\n[    1.779816] md: raid1 personality registered for level 1\r\n[    1.780237] md\/raid1:md1: active with 2 out of 2 mirrors\r\n[    1.780265] md1: detected capacity change from 0 to 4496293888\r\n[    1.790760] md: bind&lt;sda3&gt;\r\n[    1.792595] md\/raid1:md2: active with 1 out of 2 mirrors\r\n[    1.792630] md2: detected capacity change from 0 to 99932438528\r\n[    1.829295] md: bind&lt;sda6&gt;\r\n[    1.830683] md: bind&lt;sdb7&gt;\r\n[    1.831317] md\/raid1:md4: active with 1 out of 2 mirrors\r\n[    1.831348] md4: detected capacity change from 0 to 5095030784\r\n[    1.832241] md: bind&lt;sdb1&gt;\r\n[    1.858850] md: bind&lt;sda7&gt;\r\n[    1.859793] md: kicking non-fresh sdb7 from array!\r\n[    1.859797] md: unbind&lt;sdb7&gt;\r\n[    1.879169] md: export_rdev(sdb7)\r\n[    1.880522] md\/raid1:md5: active with 1 out of 2 mirrors\r\n[    1.982202] md: bind&lt;sda1&gt;\r\n[    2.065159] md: kicking non-fresh sdb1 from array!\r\n[    2.065165] md: unbind&lt;sdb1&gt;\r\n[    2.073287] md: bind&lt;sda5&gt;\r\n[    2.073889] md: kicking non-fresh sdb5 from array!\r\n[    2.073893] md: unbind&lt;sdb5&gt;\r\n[    2.079430] md: export_rdev(sdb1)\r\n[    2.080728] md\/raid1:md0: active with 1 out of 2 mirrors\r\n[    2.080755] md0: detected capacity change from 0 to 498794496\r\n[    2.084402] created bitmap (3 pages) for device md5\r\n[    2.084601] md5: bitmap initialized from disk: read 1 pages, set 3 of 4320 bits\r\n[    2.091447] md: export_rdev(sdb5)\r\nbla bla bla\r\n\u00c8 la prima volta che mi succede e non so come comportarmi, smartctl mi dice che i dischi sono a posto quindi almeno da quel lato va bene.\r\nGuardo brevemente in Internet e scopro che la cosa succede se per esempio la macchina va gi\u00f9 male per mancanza di corrente, e la soluzione\r\n\u00e8 relativamente semplice, cacci fuori dall'array le partizioni degradate e ce le rimetti che da solo si fa il rebuild.\r\nQuindi procedo in questo modo:\r\nroot@libeccio:\/var\/log# \/sbin\/mdadm  \/dev\/md0 --fail \/dev\/sdb1 --remove \/dev\/sdb1\r\nmdadm: set device faulty failed for \/dev\/sdb1:  No such device\r\nroot@libeccio:\/var\/log# \/sbin\/mdadm  \/dev\/md0 --add \/dev\/sdb1\r\nmdadm: added \/dev\/sdb1<\/pre>\n<p>e lo stesso per per gli altri md con relative partizioni.<\/p>\n<p>Facendo un cat di \/proc\/mdstat mi trovo in questa situazione:<\/p>\n<p>root@libeccio:\/var\/log# cat \/proc\/mdstat<br \/>\nPersonalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10]<br \/>\nmd0 : active raid1 sdb1[2] sda1[0]<br \/>\n487104 blocks super 1.2 [2\/2] [UU]<\/p>\n<p>md5 : active raid1 sdb7[2] sda7[0]<br \/>\n283077632 blocks super 1.2 [2\/1] [U_]<br \/>\n[==&gt;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;] recovery = 14.1% (40111104\/283077632) finish=34.4min speed=117694K\/sec<br \/>\nbitmap: 1\/3 pages [4KB], 65536KB chunk<\/p>\n<p>md4 : active raid1 sdb6[2] sda6[0]<br \/>\n4975616 blocks super 1.2 [2\/1] [U_]<br \/>\nresync=DELAYED<\/p>\n<p>md2 : active raid1 sdb3[2] sda3[0]<br \/>\n97590272 blocks super 1.2 [2\/1] [U_]<br \/>\nresync=DELAYED<\/p>\n<p>md1 : active raid1 sda2[0] sdb2[1]<br \/>\n4390912 blocks super 1.2 [2\/2] [UU]<\/p>\n<p>md3 : active raid1 sdb5[2] sda5[0]<br \/>\n97589248 blocks super 1.2 [2\/1] [U_]<br \/>\nresync=DELAYED<\/p>\n<p>unused devices: &lt;none&gt;<\/p>\n<p>Quindi tutto sta tornando a posto, e anche per oggi ho imparato una cosa nuova.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Una mattina mi trovo nelle mail di sistema una cosa del genere: This is an automatically generated mail message from mdadm running on libeccio A DegradedArray event had been detected on md device \/dev\/md\/4. Faithfully yours, etc. P.S. The \/proc\/mdstat file currently contains the following: Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10] [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,6],"tags":[163,161,160,162],"class_list":["post-1647","post","type-post","status-publish","format-standard","hentry","category-linux","category-work","tag-degradedarray-event","tag-md","tag-raid","tag-rebuilding"],"_links":{"self":[{"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=\/wp\/v2\/posts\/1647","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1647"}],"version-history":[{"count":3,"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=\/wp\/v2\/posts\/1647\/revisions"}],"predecessor-version":[{"id":1650,"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=\/wp\/v2\/posts\/1647\/revisions\/1650"}],"wp:attachment":[{"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1647"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1647"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1647"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}