{"id":596,"date":"2019-01-07T13:09:34","date_gmt":"2019-01-07T12:09:34","guid":{"rendered":"https:\/\/www.gluecksgriff-taschen.de\/?p=596"},"modified":"2022-07-02T17:45:27","modified_gmt":"2022-07-02T15:45:27","slug":"software-raid-festplatte-ersetzen","status":"publish","type":"post","link":"https:\/\/www.gluecksgriff-taschen.de\/?p=596","title":{"rendered":"Software Raid &#8211; Festplatte ersetzen"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Ich habe <a href=\"https:\/\/www.gluecksgriff-taschen.de\/?p=455\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"hie (\u00f6ffnet in neuem Tab)\">hie<\/a>r beschrieben wie unter Ubuntu ein Software Raid installiert wird. Das funktioniert soweit auch ganz prima, allerdings schickten mir die Smarttools heute morgen diese Mail:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nThis message was generated by the smartd daemon running on:\n\n   host name:  kameraserver\n   DNS domain: &#x5B;Empty]\n\nThe following warning\/error was logged by the smartd daemon:\n\nDevice: \/dev\/sde &#x5B;SAT], 8 Offline uncorrectable sectors\n\nDevice info:\nST2000VX008-2E3164, S\/N:W5232Z6R, WWN:5-000c50-09b8c9bf7, FW:CV12, 2.00 TB\n\nFor details see host&#039;s SYSLOG.\n\nYou can also use the smartctl utility for further investigation.\nAnother message will be sent in 24 hours if the problem persists.\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">So wie aussieht, scheint \/dev\/sde also so langsam den Geist aufzugeben. Besser ich ersetze sie jetzt gegen eine neue Festplatte. Aber wie mache ich das?<\/p>\n\n\n\n<!--more-->\n\n\n\n<p class=\"wp-block-paragraph\">Zun\u00e4chst schaue ich mir mal den Status des RAID an:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; gutter: false; highlight: [1]; title: ; notranslate\" title=\"\">\nedv@kameraserver:~$ sudo cat \/proc\/mdstat\nPersonalities : &#x5B;raid6] &#x5B;raid5] &#x5B;raid4] &#x5B;linear] &#x5B;multipath] &#x5B;raid0] &#x5B;raid1] &#x5B;raid10]\nmd0 : active raid6 sdd1&#x5B;2] sdf1&#x5B;4] sde1&#x5B;3] sdc1&#x5B;1] sdb1&#x5B;0]\n      5860134912 blocks super 1.2 level 6, 512k chunk, algorithm 2 &#x5B;5\/5] &#x5B;UUUUU]\n      bitmap: 8\/15 pages &#x5B;32KB], 65536KB chunk\n\nunused devices: &amp;lt;none&gt;\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Das sieht soweit ganz gut aus, das RAID ist also noch in Ordnung.  Ich tausche die Platte trotzdem aus. Zun\u00e4chst schreibe ich alle eventuell vorhandenen Caches mittels sync-Befehl auf die Festplatten.  <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; gutter: false; highlight: [1]; title: ; notranslate\" title=\"\">\nedv@kameraserver:~$ sudo sync\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Zun\u00e4chst setze ich die betroffene Festplatte manuell auf den Status &#8222;Failed&#8220;.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; gutter: false; highlight: [1]; title: ; notranslate\" title=\"\">\nedv@kameraserver:~$ sudo mdadm --manage \/dev\/md0 --fail \/dev\/sde1\nmdadm: set \/dev\/sde1 faulty in \/dev\/md0\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Sicherheitshalber nochmal \u00fcberpr\u00fcfen ob die Disk nun wirklich den Status &#8222;Failed&#8220; hat.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; gutter: false; highlight: [1]; title: ; notranslate\" title=\"\">\nedv@kameraserver:~$ sudo cat \/proc\/mdstat\nPersonalities : &#x5B;raid6] &#x5B;raid5] &#x5B;raid4] &#x5B;linear] &#x5B;multipath] &#x5B;raid0] &#x5B;raid1] &#x5B;raid10]\nmd0 : active raid6 sdd1&#x5B;2] sdf1&#x5B;4] sde1&#x5B;3](F) sdc1&#x5B;1] sdb1&#x5B;0]\n      5860134912 blocks super 1.2 level 6, 512k chunk, algorithm 2 &#x5B;5\/4] &#x5B;UUU_U]\n      bitmap: 13\/15 pages &#x5B;52KB], 65536KB chunk\n\nunused devices: &amp;lt;none&gt;\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Das hat funktioniert (das &#8222;F&#8220; hinter sde1 steht f\u00fcr failed), nun kann ich die Festplatte aus dem Raid-Verbund entfernen. Das geht ebenfalls mittels mdadm.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; gutter: false; highlight: [1]; title: ; notranslate\" title=\"\">\nedv@kameraserver:~$ sudo mdadm --manage \/dev\/md0 --remove \/dev\/sde1\nmdadm: hot removed \/dev\/sde1 from \/dev\/md0\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Jetzt nehme ich die alte Festplatte aus der Backplane und baue die neue Festplatte ein. Die Seriennummer des Festplatte schreibe ich auf den entsprechenden Slot der Backplane, damit ich sie im Fehlerfall leicht identifizieren kann.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Eigentlich sollte das Device gleich bleiben, aber auch dieses schaue ich sicherheitshalber mittels lsblk nach.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; gutter: false; highlight: [1,16]; title: ; notranslate\" title=\"\">\nedv@kameraserver:~$ sudo lsblk\nNAME    MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINT\nsda       8:0    0  1,8T  0 disk\n\u251c\u2500sda1    8:1    0  1,8T  0 part  \/\n\u251c\u2500sda2    8:2    0    1K  0 part\n\u2514\u2500sda5    8:5    0  976M  0 part  &#x5B;SWAP]\nsdb       8:16   0  1,8T  0 disk\n\u2514\u2500sdb1    8:17   0  1,8T  0 part\n  \u2514\u2500md0   9:0    0  5,5T  0 raid6 \/mnt\/aufzeichnung\nsdc       8:32   0  1,8T  0 disk\n\u2514\u2500sdc1    8:33   0  1,8T  0 part\n  \u2514\u2500md0   9:0    0  5,5T  0 raid6 \/mnt\/aufzeichnung\nsdd       8:48   0  1,8T  0 disk\n\u2514\u2500sdd1    8:49   0  1,8T  0 part\n  \u2514\u2500md0   9:0    0  5,5T  0 raid6 \/mnt\/aufzeichnung\nsde       8:64   0  1,8T  0 disk\nsdf       8:80   0  1,8T  0 disk\n\u2514\u2500sdf1    8:81   0  1,8T  0 part\n  \u2514\u2500md0   9:0    0  5,5T  0 raid6 \/mnt\/aufzeichnung\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Gut, \/dev\/sde ist also \/dev\/sde geblieben. Jetzt kann ich mittels sfdisk die Partitionierung von einer beliebigen anderen Festplatte des Raid-Verbunds \u00fcbernehmen. Ich entscheide mich f\u00fcr \/dev\/sdb als Quelle, spielt aber wie gesagt keine Rolle.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; gutter: false; highlight: [1]; title: ; notranslate\" title=\"\">\nedv@kameraserver:~$ sudo sfdisk -d \/dev\/sdb | sudo sfdisk \/dev\/sde\nChecking that no-one is using this disk right now ... OK\n\nDisk \/dev\/sde: 1,8 TiB, 2000398934016 bytes, 3907029168 sectors\nUnits: sectors of 1 * 512 = 512 bytes\nSector size (logical\/physical): 512 bytes \/ 4096 bytes\nI\/O size (minimum\/optimal): 4096 bytes \/ 4096 bytes\n\n&gt;&gt;&gt; Script header accepted.\n&gt;&gt;&gt; Script header accepted.\n&gt;&gt;&gt; Script header accepted.\n&gt;&gt;&gt; Script header accepted.\n&gt;&gt;&gt; Script header accepted.\n&gt;&gt;&gt; Script header accepted.\n&gt;&gt;&gt; Created a new GPT disklabel (GUID: D5D5DEB6-1A05-4434-A2AF-0CF3EDC5EF7A).\nCreated a new partition 1 of type &#039;Linux RAID&#039; and of size 1,8 TiB.\n\/dev\/sde2:\nNew situation:\n\nDevice     Start        End    Sectors  Size Type\n\/dev\/sde1   2048 3907020976 3907018929  1,8T Linux RAID\n\nThe partition table has been altered.\nCalling ioctl() to re-read partition table.\nSyncing disks.\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Jetzt f\u00fcge ich die neue Festplatte wieder zum Raid hinzu.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; gutter: false; highlight: [1]; title: ; notranslate\" title=\"\">\nedv@kameraserver:~$ sudo mdadm --manage \/dev\/md0 --add \/dev\/sde1\nmdadm: added \/dev\/sde1\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Ob das alles geklappt hat, verr\u00e4t mir ebenfalls mdadm<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; gutter: false; highlight: [1,34]; title: ; notranslate\" title=\"\">\nedv@kameraserver:~$ sudo mdadm --detail \/dev\/md0\n\/dev\/md0:\n        Version : 1.2\n  Creation Time : Fri Sep 28 15:46:21 2018\n     Raid Level : raid6\n     Array Size : 5860134912 (5588.66 GiB 6000.78 GB)\n  Used Dev Size : 1953378304 (1862.89 GiB 2000.26 GB)\n   Raid Devices : 5\n  Total Devices : 5\n    Persistence : Superblock is persistent\n\n  Intent Bitmap : Internal\n\n    Update Time : Mon Jan  7 13:02:26 2019\n          State : active, degraded, recovering\n Active Devices : 4\nWorking Devices : 5\n Failed Devices : 0\n  Spare Devices : 1\n\n         Layout : left-symmetric\n     Chunk Size : 512K\n\n Rebuild Status : 0% complete\n\n           Name : kameraserver:0  (local to host kameraserver)\n           UUID : 21ae1412:e3b4dd92:2c42cdaa:09862571\n         Events : 25518\n\n    Number   Major   Minor   RaidDevice State\n       0       8       17        0      active sync   \/dev\/sdb1\n       1       8       33        1      active sync   \/dev\/sdc1\n       2       8       49        2      active sync   \/dev\/sdd1\n       5       8       65        3      spare rebuilding   \/dev\/sde1\n       4       8       81        4      active sync   \/dev\/sdf1\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Der Rebuild l\u00e4uft also, den jeweils aktuellen Status kann ich mir jederzeit ausgeben lassen:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; gutter: false; highlight: [1]; title: ; notranslate\" title=\"\">\nedv@kameraserver:~$ sudo cat \/proc\/mdstat\nPersonalities : &#x5B;raid6] &#x5B;raid5] &#x5B;raid4] &#x5B;linear] &#x5B;multipath] &#x5B;raid0] &#x5B;raid1] &#x5B;raid10]\nmd0 : active raid6 sde1&#x5B;5] sdd1&#x5B;2] sdf1&#x5B;4] sdc1&#x5B;1] sdb1&#x5B;0]\n      5860134912 blocks super 1.2 level 6, 512k chunk, algorithm 2 &#x5B;5\/4] &#x5B;UUU_U]\n      &#x5B;&gt;....................]  recovery =  0.9% (17925956\/1953378304) finish=324.5min speed=99402K\/sec\n      bitmap: 13\/15 pages &#x5B;52KB], 65536KB chunk\n\nunused devices: &amp;lt;none&gt;\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Nach ein paar Stunden sollte also alles wieder okay sein.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Bitte beachtet, dass es hier um einen Daten-Raid geht von dem NICHT gebooted wird. Bei einem bootable-Array ist die Sache etwas komplizierter, da dort auch noch der MBR\/GPT kopiert werden muss (auch nicht weiter schwierig, aber eben anders als hier beschrieben.)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ich habe hier beschrieben wie unter Ubuntu ein Software Raid installiert wird. Das funktioniert soweit auch ganz prima, allerdings schickten mir die Smarttools heute morgen diese Mail: So wie aussieht, scheint \/dev\/sde also so langsam den Geist aufzugeben. Besser ich ersetze sie jetzt gegen eine neue Festplatte. Aber wie mache ich das?<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","footnotes":""},"categories":[3],"tags":[93,92,86,94,85],"class_list":["post-596","post","type-post","status-publish","format-standard","hentry","category-linux","tag-ersetzen","tag-festplatte","tag-mdadm","tag-sfdisk","tag-software-raid"],"_links":{"self":[{"href":"https:\/\/www.gluecksgriff-taschen.de\/index.php?rest_route=\/wp\/v2\/posts\/596","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gluecksgriff-taschen.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gluecksgriff-taschen.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gluecksgriff-taschen.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gluecksgriff-taschen.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=596"}],"version-history":[{"count":7,"href":"https:\/\/www.gluecksgriff-taschen.de\/index.php?rest_route=\/wp\/v2\/posts\/596\/revisions"}],"predecessor-version":[{"id":785,"href":"https:\/\/www.gluecksgriff-taschen.de\/index.php?rest_route=\/wp\/v2\/posts\/596\/revisions\/785"}],"wp:attachment":[{"href":"https:\/\/www.gluecksgriff-taschen.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=596"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gluecksgriff-taschen.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=596"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gluecksgriff-taschen.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=596"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}