{"id":91,"date":"2015-08-27T14:51:46","date_gmt":"2015-08-27T13:51:46","guid":{"rendered":"https:\/\/tollana.d-tor.org\/notes-to-self\/?p=91"},"modified":"2016-11-27T01:00:48","modified_gmt":"2016-11-27T00:00:48","slug":"disk-change-hetzner","status":"publish","type":"post","link":"https:\/\/tollana.d-tor.org\/notes-to-self\/?p=91","title":{"rendered":"Disk Change @ Hetzner"},"content":{"rendered":"<h3>1. Get serial of defective disk<\/h3>\n<pre># for i in a b; \\\r\n do echo $i ; smartctl -i \/dev\/sd$i | grep -i serial ;\\\r\ndone<\/pre>\n<p>The disk\u00a0<strong>not\u00a0<\/strong>returning a serial is most likely the defective one.<\/p>\n<h3>2. Create a Ticket @ Hetzner Robot<\/h3>\n<p>Log in to the <a href=\"https:\/\/robot.your-server.de\">Hetzner Robot<\/a>\u00a0and create a Ticket: Left menu:<\/p>\n<p>Anfragen -&gt; Serverprobleme ausklappen -&gt; Festplatte defekt<\/p>\n<p>If the serial of the defective drive can&#8217;t be obtained, enter the serial of the working one and\u00a0<strong>stress<\/strong> that the said serial is the <strong>working\u00a0<\/strong>drive. Otherwise they&#8217;ll swap the wrong one and you end up with nothing!<\/p>\n<h3>3.\u00a0Copy partition table<\/h3>\n<p>Once the drive is replaced, copy the partition table from the working drive to the new one. sgdisk comes to rescue (<b>THINK BEFORE YOU COPY &amp; PASTE, WON&#8217;T WORK ANYWAY):<\/b><\/p>\n<pre># sgdisk -R=\/dev\/sd[new] \/dev\/sd[old]<\/pre>\n<p>In doubt, RTFM twice: man sgdisk<\/p>\n<h3>4. Resync the RAID<\/h3>\n<p>mdadm comes to rescue:<\/p>\n<pre># mdadm --manage \/dev\/md0 --add \/dev\/sd[new][part]<\/pre>\n<p>If you can&#8217;t get the former command to work, again: RTFM! It&#8217;s your data!<\/p>\n<h3>5. Stare at the progress<\/h3>\n<pre># watch cat \/proc\/mdstat<\/pre>\n<h3>6. Be delighted!<\/h3>\n","protected":false},"excerpt":{"rendered":"<p>1. Get serial of defective disk # for i in a b; \\ do echo $i ; smartctl -i \/dev\/sd$i | grep -i serial ;\\ done The disk\u00a0not\u00a0returning a serial is most likely the defective one. 2. Create a Ticket @ Hetzner Robot Log in to the Hetzner Robot\u00a0and create a Ticket: Left menu: Anfragen &hellip; <a href=\"https:\/\/tollana.d-tor.org\/notes-to-self\/?p=91\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Disk Change @ Hetzner<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[79,36],"tags":[11],"class_list":["post-91","post","type-post","status-publish","format-standard","hentry","category-hardware","category-hetzner","tag-raid"],"_links":{"self":[{"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=\/wp\/v2\/posts\/91","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=91"}],"version-history":[{"count":2,"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=\/wp\/v2\/posts\/91\/revisions"}],"predecessor-version":[{"id":95,"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=\/wp\/v2\/posts\/91\/revisions\/95"}],"wp:attachment":[{"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=91"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=91"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=91"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}