<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Md on BAFM</title><link>https://christian.blog.pakiheim.de/tags/md/</link><description>Recent content in Md on BAFM</description><generator>Hugo -- 0.160.1</generator><language>en</language><lastBuildDate>Sun, 27 Jul 2014 21:46:33 +0000</lastBuildDate><atom:link href="https://christian.blog.pakiheim.de/tags/md/index.xml" rel="self" type="application/rss+xml"/><item><title>mdadm: Add a hot-spare after failing a disk</title><link>https://christian.blog.pakiheim.de/posts/2014-07-27_mdadm-add-a-hot-spare-after-failing-a-disk/</link><pubDate>Sun, 27 Jul 2014 21:46:33 +0000</pubDate><guid isPermaLink="false">http://christian.weblog.heimdaheim.de/?p=5190</guid><description>&lt;p&gt;Once the disk is failed (or is &lt;em&gt;actually&lt;/em&gt; defective), mdadm will automatically remove it from the RAID. After that, you&amp;rsquo;ll either have to add the disk back as a data disk or as a hot-spare (which was in my case). Now, here&amp;rsquo;s after the rebuild for the failed disk started:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt" id="hl-0-1"&gt;&lt;a class="lnlinks" href="#hl-0-1"&gt;1&lt;/a&gt;
&lt;/span&gt;&lt;span class="lnt" id="hl-0-2"&gt;&lt;a class="lnlinks" href="#hl-0-2"&gt;2&lt;/a&gt;
&lt;/span&gt;&lt;span class="lnt" id="hl-0-3"&gt;&lt;a class="lnlinks" href="#hl-0-3"&gt;3&lt;/a&gt;
&lt;/span&gt;&lt;span class="lnt" id="hl-0-4"&gt;&lt;a class="lnlinks" href="#hl-0-4"&gt;4&lt;/a&gt;
&lt;/span&gt;&lt;span class="lnt" id="hl-0-5"&gt;&lt;a class="lnlinks" href="#hl-0-5"&gt;5&lt;/a&gt;
&lt;/span&gt;&lt;span class="lnt" id="hl-0-6"&gt;&lt;a class="lnlinks" href="#hl-0-6"&gt;6&lt;/a&gt;
&lt;/span&gt;&lt;span class="lnt" id="hl-0-7"&gt;&lt;a class="lnlinks" href="#hl-0-7"&gt;7&lt;/a&gt;
&lt;/span&gt;&lt;span class="lnt" id="hl-0-8"&gt;&lt;a class="lnlinks" href="#hl-0-8"&gt;8&lt;/a&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;root:(charon.ka.heimdaheim.de) PWD:~
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Sun Jul 27, 23:40:35 [0] &amp;gt; cat /proc/mdstat
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Personalities : [raid6] [raid5] [raid4]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;md127 : active raid5 sdi1[0] sdh1[6] sdj1[7] sdk1[8] sdf1[9] sdb1[5] sde1[4] sdd1[2] sdc1[1]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 15626121216 blocks super 1.2 level 5, 512k chunk, algorithm 2 [9/8] [UUUUU_UUU]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; [===================&amp;gt;.] recovery = 97.9% (1913176308/1953265152) finish=12.3min speed=53936K/sec
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;unused devices: &amp;lt;none&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;In order to add the replaced disk back to the RAID, you&amp;rsquo;ll have to prepare a partition for it (see &lt;a href="https://christian.blog.pakiheim.de/posts/2014-07-09_sfdisk-partition-table-for-2tb-raid-disks" title="SFdisk – Partition table for 2TB RAID-Disks"&gt;this post for more details&lt;/a&gt;). After that, it&amp;rsquo;s a simple call with mdadm to re-add the hot-spare:&lt;/p&gt;</description></item><item><title>mdstat</title><link>https://christian.blog.pakiheim.de/posts/2014-07-27_mdstat/</link><pubDate>Sun, 27 Jul 2014 16:31:26 +0000</pubDate><guid isPermaLink="false">http://christian.weblog.heimdaheim.de/?p=5191</guid><description>&lt;p&gt;Well, I needed a way to watch the mdstat progress (because a disk just failed &amp;hellip;).&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt" id="hl-0-1"&gt;&lt;a class="lnlinks" href="#hl-0-1"&gt;1&lt;/a&gt;
&lt;/span&gt;&lt;span class="lnt" id="hl-0-2"&gt;&lt;a class="lnlinks" href="#hl-0-2"&gt;2&lt;/a&gt;
&lt;/span&gt;&lt;span class="lnt" id="hl-0-3"&gt;&lt;a class="lnlinks" href="#hl-0-3"&gt;3&lt;/a&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#!/bin/bash
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;watch -n1 cat /proc/mdstat
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;</description></item><item><title>Linux NAS optimizations</title><link>https://christian.blog.pakiheim.de/posts/2014-07-09_linux-nas-optimizations/</link><pubDate>Wed, 09 Jul 2014 20:04:40 +0000</pubDate><guid isPermaLink="false">http://christian.weblog.heimdaheim.de/?p=5174</guid><description>&lt;p&gt;Well, I recently had to flatten my archive NAS (well only the OS part &amp;hellip; &lt;em&gt;wheeeh&lt;/em&gt;). Since I didn&amp;rsquo;t have the chance to backup the old settings I had to do everything from scratch &amp;hellip; And this time I decided, I wasn&amp;rsquo;t doing a script but rather the proper way.&lt;/p&gt;
&lt;p&gt;I spent a while reading through the Internetz about the various settings until I stumbled upon a &lt;a href="http://www.fhgfs.com/wiki/StorageServerTuning"&gt;Frauenhofer Wiki entry&lt;/a&gt;. From there I ended up writing those udev-rules and the sysctl configs&amp;hellip;&lt;/p&gt;</description></item><item><title>SFdisk - Partition table for 2TB RAID-Disks</title><link>https://christian.blog.pakiheim.de/posts/2014-07-09_sfdisk-partition-table-for-2tb-raid-disks/</link><pubDate>Wed, 09 Jul 2014 13:18:09 +0000</pubDate><guid isPermaLink="false">http://christian.weblog.heimdaheim.de/?p=5176</guid><description>&lt;p&gt;So, when I create (or add RAID disks) I have this handy sfdisk template (I created once when I first added the 2TB disks):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt" id="hl-0-1"&gt;&lt;a class="lnlinks" href="#hl-0-1"&gt;1&lt;/a&gt;
&lt;/span&gt;&lt;span class="lnt" id="hl-0-2"&gt;&lt;a class="lnlinks" href="#hl-0-2"&gt;2&lt;/a&gt;
&lt;/span&gt;&lt;span class="lnt" id="hl-0-3"&gt;&lt;a class="lnlinks" href="#hl-0-3"&gt;3&lt;/a&gt;
&lt;/span&gt;&lt;span class="lnt" id="hl-0-4"&gt;&lt;a class="lnlinks" href="#hl-0-4"&gt;4&lt;/a&gt;
&lt;/span&gt;&lt;span class="lnt" id="hl-0-5"&gt;&lt;a class="lnlinks" href="#hl-0-5"&gt;5&lt;/a&gt;
&lt;/span&gt;&lt;span class="lnt" id="hl-0-6"&gt;&lt;a class="lnlinks" href="#hl-0-6"&gt;6&lt;/a&gt;
&lt;/span&gt;&lt;span class="lnt" id="hl-0-7"&gt;&lt;a class="lnlinks" href="#hl-0-7"&gt;7&lt;/a&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;root:(charon.ka.heimdaheim.de) PWD:~
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Wed Jul 09, 15:13:04 [0] &amp;gt; sfdisk -d /dev/sdj &amp;gt; ~/raid-disk-template.sf
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;root:(charon.ka.heimdaheim.de) PWD:~
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Wed Jul 09, 15:13:04 [0] &amp;gt; cat ~/raid-disk-template.sf
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# partition table of /dev/sdj
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;unit: sectors
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;/dev/sdj1 : start= 2048, size=3906793472, Id=da
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;So, if I wanted to add more disks, I&amp;rsquo;d just have to run the following:&lt;/p&gt;</description></item><item><title>More MD weirdness</title><link>https://christian.blog.pakiheim.de/posts/2008-12-29_more-md-weirdness/</link><pubDate>Mon, 29 Dec 2008 17:55:17 +0000</pubDate><guid isPermaLink="false">http://blog.barfoo.org/?p=1337</guid><description>&lt;p&gt;Well, at last I&amp;rsquo;m getting somewhere with my troubles. This only seems to be happening when creating an RAID5 multiple device with four disks, this doesn&amp;rsquo;t happen with three.&lt;/p&gt;
&lt;p&gt;Now, the next thing I tried was to create a three disk array, and then adding the fourth disk as spare and then extending the array with that fourth disk. After that, all these errors seem to appear again &lt;em&gt;&lt;strong&gt;yuck&lt;/strong&gt;&lt;/em&gt; So I either possess rather faulty disks, or something else is fishy, since I&amp;rsquo;m having another four disk RAID5 array with the old disks &amp;hellip;&lt;/p&gt;</description></item></channel></rss>