<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Mark&#039;s Weblog</title>
	<atom:link href="http://mark.nellemann.nu/feed/" rel="self" type="application/rss+xml" />
	<link>http://mark.nellemann.nu</link>
	<description>Open Source, Linux/UNIX &#38; Technology</description>
	<lastBuildDate>Thu, 09 Feb 2012 10:34:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>SATA vs. SSD</title>
		<link>http://mark.nellemann.nu/2011/10/31/sata-vs-ssd/</link>
		<comments>http://mark.nellemann.nu/2011/10/31/sata-vs-ssd/#comments</comments>
		<pubDate>Mon, 31 Oct 2011 21:26:48 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Linux & Unix]]></category>

		<guid isPermaLink="false">http://mark.nellemann.nu/?p=1086</guid>
		<description><![CDATA[MySQL server with SATA disk vs. SSD disk.]]></description>
			<content:encoded><![CDATA[<p>MySQL server with SATA disk vs. SSD disk.</p>
<p><a href="http://mark.nellemann.nu/2011/10/31/sata-vs-ssd/io-time-ssd/" rel="attachment wp-att-1088"><img src="http://mark.nellemann.nu/wp-content/uploads/2011/10/io-time-ssd-300x112.png" alt="" title="io-time-ssd" width="300" height="112" class="alignleft size-medium wp-image-1088" /></a><br />
<br/><br/><br />
<a href="http://mark.nellemann.nu/2011/10/31/sata-vs-ssd/io-time-sata/" rel="attachment wp-att-1087"><img src="http://mark.nellemann.nu/wp-content/uploads/2011/10/io-time-sata-300x112.png" alt="" title="io-time-sata" width="300" height="112" class="alignleft size-medium wp-image-1087" /></a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fmark.nellemann.nu%2F2011%2F10%2F31%2Fsata-vs-ssd%2F&amp;title=SATA%20vs.%20SSD" id="wpa2a_2"><img src="http://mark.nellemann.nu/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://mark.nellemann.nu/2011/10/31/sata-vs-ssd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Note: access Honda sat-nav diag. menu</title>
		<link>http://mark.nellemann.nu/2011/10/12/note-access-honda-sat-nav-diag-menu/</link>
		<comments>http://mark.nellemann.nu/2011/10/12/note-access-honda-sat-nav-diag-menu/#comments</comments>
		<pubDate>Wed, 12 Oct 2011 16:28:08 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Automobile]]></category>

		<guid isPermaLink="false">http://mark.nellemann.nu/?p=1080</guid>
		<description><![CDATA[Honda Dealer wrote: So, you arrogant beggars who know so much better than the Honda dealerships and who are so quick to rubbish them, don&#8217;t know everything after all? OK, the official Honda method for forcing sat-nav to reset to older disc is as follows: 1. Start the engine. 2. error message appears on screen [...]]]></description>
			<content:encoded><![CDATA[
<p>Honda Dealer wrote:</p>
<blockquote><p>
So, you arrogant beggars who know so much better than the Honda dealerships and who are so quick to rubbish them, don&#8217;t know everything after all?<br />
OK, the official Honda method for forcing sat-nav to reset to older disc is as follows:<br />
1. Start the engine.<br />
2. error message appears on screen with old disc inserted.<br />
3. Push &#8216;MENU&#8217; and &#8216;ZOOM DOWN&#8217; switches simultaneously for 2 seconds.<br />
4. Screen turns to SYSTEM LINK page with a fanfare.<br />
5. Press &#8216;NEXT&#8217; switch (opens car staus page).<br />
6. Press &#8216;NEXT&#8217; switch (opens yaw rate page).<br />
7. Press &#8216;NEXT&#8217; switch (opens diagnosis menu page).<br />
8. Select &#8216;UNIT CHECK&#8217;.<br />
9. Select &#8216;FORCE DOWN LOAD&#8217;.<br />
System will now start to download the old operating system firmware from the old disc, showing progress on a green bar gauge.<br />
When finished the unit should be able to be started normally.
</p></blockquote>
<p>Now say &#8216;Thank You, to a Honda Dealer!&#8217;</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fmark.nellemann.nu%2F2011%2F10%2F12%2Fnote-access-honda-sat-nav-diag-menu%2F&amp;title=Note%3A%20access%20Honda%20sat-nav%20diag.%20menu" id="wpa2a_4"><img src="http://mark.nellemann.nu/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://mark.nellemann.nu/2011/10/12/note-access-honda-sat-nav-diag-menu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Handbrake 0.9.5 for OSX PowerPC</title>
		<link>http://mark.nellemann.nu/2011/04/11/handbrake-0-9-5-for-osx-powerpc/</link>
		<comments>http://mark.nellemann.nu/2011/04/11/handbrake-0-9-5-for-osx-powerpc/#comments</comments>
		<pubDate>Mon, 11 Apr 2011 18:12:07 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[OSX]]></category>

		<guid isPermaLink="false">http://mark.nellemann.nu/?p=1074</guid>
		<description><![CDATA[There is no official ppc build of Handbrake 0.9.5. Following the wiki compile guide, it is possible for compile it on your own ppc box. Or if you are to lazy, you are welcome to download the ppc binaries I compiled. It works, but it&#8217;s not getting faster.]]></description>
			<content:encoded><![CDATA[<p>There is no official ppc build of Handbrake 0.9.5. Following the <a href="https://trac.handbrake.fr/wiki/CompileGuide">wiki compile guide</a>, it is possible for compile it on your own ppc box.</p>
<p>Or if you are to lazy, you are welcome to <a href="http://mark.nellemann.nu/wp-content/uploads/2011/04/Handbrake-0.9.5-OSX-ppc.zip">download the ppc binaries</a> I compiled.</p>
<p>It works, but it&#8217;s not getting faster. </p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fmark.nellemann.nu%2F2011%2F04%2F11%2Fhandbrake-0-9-5-for-osx-powerpc%2F&amp;title=Handbrake%200.9.5%20for%20OSX%20PowerPC" id="wpa2a_6"><img src="http://mark.nellemann.nu/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://mark.nellemann.nu/2011/04/11/handbrake-0-9-5-for-osx-powerpc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gameboy (classic?)</title>
		<link>http://mark.nellemann.nu/2011/02/04/gameboy-classic/</link>
		<comments>http://mark.nellemann.nu/2011/02/04/gameboy-classic/#comments</comments>
		<pubDate>Fri, 04 Feb 2011 11:45:33 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Teknik]]></category>
		<category><![CDATA[gameboy]]></category>
		<category><![CDATA[konsol]]></category>

		<guid isPermaLink="false">http://mark.nellemann.nu/?p=1062</guid>
		<description><![CDATA[Vi fandt Maria&#8217;s Gameboy den anden dag. Den havde været pakket ned og gemt væk i vel nok 15 år. Et sæt nye batterier var alt der skulle til for at få liv i den. Den er måske klodset og grafikken er primitiv, men Lisa har da fået lidt glæde af den nu. Det største [...]]]></description>
			<content:encoded><![CDATA[<p>Vi fandt Maria&#8217;s Gameboy den anden dag. Den havde været pakket ned og gemt væk i vel nok 15 år. Et sæt nye batterier var alt der skulle til for at få liv i den. Den er måske klodset og grafikken er primitiv, men Lisa har da fået lidt glæde af den nu. Det største problem er egenligt skærmen, som er meget utydelig (og sort/grøn) efter dagens standard.<br />
<a href="http://mark.nellemann.nu/2011/02/04/gameboy-classic/original-gameboy/" rel="attachment wp-att-1063"><img src="http://mark.nellemann.nu/wp-content/uploads/2011/02/original-gameboy-266x300.jpg" alt="" title="original-gameboy" width="266" height="300" class="aligncenter size-medium wp-image-1063" /></a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fmark.nellemann.nu%2F2011%2F02%2F04%2Fgameboy-classic%2F&amp;title=Gameboy%20%28classic%3F%29" id="wpa2a_8"><img src="http://mark.nellemann.nu/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://mark.nellemann.nu/2011/02/04/gameboy-classic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My first Python script</title>
		<link>http://mark.nellemann.nu/2011/01/20/my-first-python-script/</link>
		<comments>http://mark.nellemann.nu/2011/01/20/my-first-python-script/#comments</comments>
		<pubDate>Thu, 20 Jan 2011 14:08:58 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[gps]]></category>
		<category><![CDATA[maps]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://mark.nellemann.nu/?p=1058</guid>
		<description><![CDATA[I have always avoided Python. I am not sure why, but I think it is mostly because of the syntax, with the needed indention. Well, today I wrote my first script, and I actually like the language a little. I needed to lookup GPS coordinates for a long list of addresses, and didn&#8217;t like doing [...]]]></description>
			<content:encoded><![CDATA[<p>I have always avoided Python. I am not sure why, but I think it is mostly because of the syntax, with the needed indention. Well, today I wrote my first script, and I actually like the language a little.</p>
<p>I needed to lookup GPS coordinates for a long list of addresses, and didn&#8217;t like doing it manually. Using Google&#8217;s maps API, I solved the problem with this little script. It reads the addresses from stdin and writes addresss;latitude;longtitude to stdout.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/env python</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Importing modules</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">urllib</span>
<span style="color: #ff7700;font-weight:bold;">import</span> json
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Configuration of main URL</span>
URL = <span style="color: #483d8b;">'http://maps.googleapis.com/maps/api/geocode/json?sensor=false&amp;address='</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Read addresses from stdin</span>
<span style="color: #ff7700;font-weight:bold;">for</span> address <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #dc143c;">sys</span>.<span style="color: black;">stdin</span>:
    <span style="color: #808080; font-style: italic;">#print &quot;Looking up: &quot; + str(address)</span>
&nbsp;
    <span style="color: #808080; font-style: italic;"># URL Encode the address</span>
    encoded_address = <span style="color: #dc143c;">urllib</span>.<span style="color: black;">quote</span><span style="color: black;">&#40;</span>address.<span style="color: black;">strip</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
    real_url = URL + encoded_address
&nbsp;
    <span style="color: #808080; font-style: italic;"># Reset buffer</span>
    buffer = <span style="color: #483d8b;">''</span>
&nbsp;
    <span style="color: #808080; font-style: italic;"># Fetch the json result</span>
    <span style="color: #ff7700;font-weight:bold;">try</span>:
        fh = <span style="color: #dc143c;">urllib</span>.<span style="color: black;">urlopen</span><span style="color: black;">&#40;</span>real_url<span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">for</span> line <span style="color: #ff7700;font-weight:bold;">in</span> fh:
            buffer += line
        fh.<span style="color: black;">close</span>
    <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">Exception</span>:
        <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;Ops, caught an exception.&quot;</span>
        <span style="color: #dc143c;">sys</span>.<span style="color: black;">exit</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #808080; font-style: italic;"># Try to de-serialize the json string</span>
    result = json.<span style="color: black;">loads</span><span style="color: black;">&#40;</span>buffer<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #808080; font-style: italic;"># Check status of result</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> result<span style="color: black;">&#91;</span><span style="color: #483d8b;">'status'</span><span style="color: black;">&#93;</span> == <span style="color: #483d8b;">&quot;OK&quot;</span>:
        <span style="color: #808080; font-style: italic;">#print &quot;Results looks good, continue&quot;</span>
        <span style="color: #ff7700;font-weight:bold;">for</span> r <span style="color: #ff7700;font-weight:bold;">in</span> result<span style="color: black;">&#91;</span><span style="color: #483d8b;">'results'</span><span style="color: black;">&#93;</span>:
            lat = <span style="color: #008000;">str</span><span style="color: black;">&#40;</span>r<span style="color: black;">&#91;</span><span style="color: #483d8b;">'geometry'</span><span style="color: black;">&#93;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'location'</span><span style="color: black;">&#93;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'lat'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
            lng = <span style="color: #008000;">str</span><span style="color: black;">&#40;</span>r<span style="color: black;">&#91;</span><span style="color: #483d8b;">'geometry'</span><span style="color: black;">&#93;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'location'</span><span style="color: black;">&#93;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'lng'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
            <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'%s; lat=%s; lng=%s'</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>address.<span style="color: black;">strip</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>, lat, lng<span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Finish</span></pre></td></tr></table></div>

<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fmark.nellemann.nu%2F2011%2F01%2F20%2Fmy-first-python-script%2F&amp;title=My%20first%20Python%20script" id="wpa2a_10"><img src="http://mark.nellemann.nu/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://mark.nellemann.nu/2011/01/20/my-first-python-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Top 50 Programming quotes of all time</title>
		<link>http://mark.nellemann.nu/2010/12/17/top-50-programming-quotes-of-all-time/</link>
		<comments>http://mark.nellemann.nu/2010/12/17/top-50-programming-quotes-of-all-time/#comments</comments>
		<pubDate>Fri, 17 Dec 2010 14:49:53 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[quote]]></category>

		<guid isPermaLink="false">http://mark.nellemann.nu/?p=1039</guid>
		<description><![CDATA[Hah, there are some funny quotes here, I especially like this one &#8220;Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.&#8221; - Brian W. Kernighan.]]></description>
			<content:encoded><![CDATA[<p>Hah, there are some <a href="http://www.junauza.com/2010/12/top-50-programming-quotes-of-all-time.html">funny quotes here</a>, I especially like this one</p>
<blockquote><p>&#8220;Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.&#8221;<br />
- Brian W. Kernighan.</p></blockquote>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fmark.nellemann.nu%2F2010%2F12%2F17%2Ftop-50-programming-quotes-of-all-time%2F&amp;title=Top%2050%20Programming%20quotes%20of%20all%20time" id="wpa2a_12"><img src="http://mark.nellemann.nu/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://mark.nellemann.nu/2010/12/17/top-50-programming-quotes-of-all-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Postfix reject_unknown_helo_hostname woes</title>
		<link>http://mark.nellemann.nu/2010/12/15/postfix-reject_unknown_helo_hostname-woes/</link>
		<comments>http://mark.nellemann.nu/2010/12/15/postfix-reject_unknown_helo_hostname-woes/#comments</comments>
		<pubDate>Wed, 15 Dec 2010 12:32:35 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Linux & Unix]]></category>
		<category><![CDATA[exchange]]></category>
		<category><![CDATA[helo]]></category>
		<category><![CDATA[postfix]]></category>

		<guid isPermaLink="false">http://mark.nellemann.nu/?p=1036</guid>
		<description><![CDATA[Googling for some answers regarding why some mail-servers fail to identify themselves correctly, I found this amusing forum reply; Unfortunately, &#8220;reject_unknown_helo_hostname&#8221; is not acceptable to use, because too many Exchange Servers are configured to identify themselves with something that only appears in their local DNS. Apparently either Microsoft&#8217;s certification programs only produce people who can [...]]]></description>
			<content:encoded><![CDATA[<p>Googling for some answers regarding why some mail-servers fail to identify themselves correctly, I found<a href="http://www.zimbra.com/forums/administrators/37438-solved-noqueue-helo-command-rejected-host-not-found.html#post202501"> this amusing</a> forum reply;</p>
<blockquote><p>Unfortunately, &#8220;reject_unknown_helo_hostname&#8221; is not acceptable to use, because too many Exchange Servers are configured to identify themselves with something that only appears in their local DNS.</p>
<p>Apparently either Microsoft&#8217;s certification programs only produce people who can point and click and don&#8217;t know how anything about RFC standards, or their programs don&#8217;t allow a proper internet routable hostname to be set on the server for some reason, possibly having to do with clustering or other advanced things used in larger networks.</p>
<p>I&#8217;m not sure what it is, but I heard that a few of the issues preventing this sort of thing were removed in Exchange 2007 and 2010, but most Exchange admins will most likely not be aware of them.</p>
<p>It would be nice if this wasn&#8217;t an issue, because then we could all reject messages that don&#8217;t pass this test. For our tiny network, this would be at least 500 messages a day, which is a good chunk of all the spam we receive. Instead, these messages end up making it to Amavis+SpamAssassin where they waste our CPU time.</p>
<p>Oh well, I suppose it could be much worse&#8230;and it usually is with Microsoft Server OSes.</p></blockquote>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fmark.nellemann.nu%2F2010%2F12%2F15%2Fpostfix-reject_unknown_helo_hostname-woes%2F&amp;title=Postfix%20reject_unknown_helo_hostname%20woes" id="wpa2a_14"><img src="http://mark.nellemann.nu/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://mark.nellemann.nu/2010/12/15/postfix-reject_unknown_helo_hostname-woes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bootable Software RAID-1 on running system</title>
		<link>http://mark.nellemann.nu/2010/12/06/bootable-software-raid-1-on-running-system/</link>
		<comments>http://mark.nellemann.nu/2010/12/06/bootable-software-raid-1-on-running-system/#comments</comments>
		<pubDate>Mon, 06 Dec 2010 19:37:29 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Linux & Unix]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mdadm]]></category>
		<category><![CDATA[raid]]></category>

		<guid isPermaLink="false">http://mark.nellemann.nu/?p=1031</guid>
		<description><![CDATA[This is tested on Debian Squeeze, but should work on most Debian derived distributions and on other Linux distributions with small changes. I have written almost the same guide some years ago, but I wanted to add an extra disk to my QNAP NAS and decided to write it down again. Requirements; 2 identical disks [...]]]></description>
			<content:encoded><![CDATA[<p>This is tested on Debian Squeeze, but should work on most Debian derived distributions and on other Linux distributions with small changes. I have written almost the same guide some years ago, but I wanted to add an extra disk to my QNAP NAS and decided to write it down again.</p>
<p><em>Requirements</em>; 2 identical disks</p>
<h2>Installation</h2>
<p>Partition and install Debian GNU/Linux onto first disk (sda in my case) if you don&#8217;t have a running system already.</p>
<p>Configure the system and make sure everything works.<br />
Install the software raid administration tool &#8216;mdadm&#8217;<br />
<code># apt-get install mdadm</code></p>
<p>Partition second unused disk (sdb) with same layout as first disk (sda)<br />
<code>sfdisk --dump /dev/sda | sfdisk --force /dev/sdb</code></p>
<p>Reboot into single-user mode to make sure partition table is re-read and to avoid having running services when copying data.</p>
<h2>Plan your RAID devices</h2>
<p>We will create a RAID device for each partition.<br />
I have the following layout on my first disk:<br />
<code><br />
Device Boot      Start         End      Blocks   Id  System<br />
/dev/sda1   *           1          43      340992   83  Linux<br />
/dev/sda2              43      182402  1464795137    5  Extended<br />
/dev/sda5              43         773     5858304   83  Linux<br />
/dev/sda6             773        1137     2928640   83  Linux<br />
/dev/sda7            1137        1514     3022848   82  Linux swap / Solaris<br />
/dev/sda8            1514        1562      389120   83  Linux<br />
/dev/sda9            1562      182402  1452592128   83  Linux<br />
</code></p>
<p>This means that I will end up with 6 different RAID devices:<br />
<code><br />
/dev/md0  (sda1 + sdb1)  mounted on /<br />
/dev/md1  (sda5 + sdb5)  mounted on /usr<br />
/dev/md2  (sda6 + sdb6)  mounted on /var<br />
/dev/md3  (sda7 + sdb7)  used for swap<br />
/dev/md4  (sda8 + sdb8)  mounted on /tmp<br />
/dev/md5  (sda9 + sdb9)  mounted on /home<br />
</code></p>
<h2>Create RAID devices</h2>
<p>Before we create any RAID devices, we should change the parition type from Linux/SWAP to &#8216;<strong>fd  Linux raid auto</strong>&#8216;. Do this with the <strong>fdisk</strong> command.</p>
<p>My /dev/sdb partition table looks like this now:<br />
<code><br />
Device Boot      Start         End      Blocks   Id  System<br />
/dev/sdb1   *           1          43      340992   fd  Linux raid autodetect<br />
/dev/sdb2              43      182402  1464795137    5  Extended<br />
/dev/sdb5              43         773     5858304   fd  Linux raid autodetect<br />
/dev/sdb6             773        1137     2928640   fd  Linux raid autodetect<br />
/dev/sdb7            1137        1514     3022848   fd  Linux raid autodetect<br />
/dev/sdb8            1514        1562      389120   fd  Linux raid autodetect<br />
/dev/sdb9            1562      182402  1452592128   fd  Linux raid autodetect<br />
</code><br />
It would not work if we created the RAID devices with both involved disk drives, but we have the possibility to create a failed RAID device with only the partition from the new unused disk. We use the word &#8216;missing&#8217; in place of the partition on sda.</p>
<p>We create the first RAID device with:<br />
<code># mdadm --create /dev/md0 --chunk=64 --level=1 --raid-devices=2 missing /dev/sdb1</code></p>
<p>And we create the rest of the RAID devices:<br />
<code><br />
# mdadm --create /dev/md1 --chunk=64 --level=1 --raid-devices=2 missing /dev/sdb5<br />
# mdadm --create /dev/md2 --chunk=64 --level=1 --raid-devices=2 missing /dev/sdb6<br />
# mdadm --create /dev/md3 --chunk=64 --level=1 --raid-devices=2 missing /dev/sdb7<br />
# mdadm --create /dev/md4 --chunk=64 --level=1 --raid-devices=2 missing /dev/sdb8<br />
# mdadm --create /dev/md5 --chunk=64 --level=1 --raid-devices=2 missing /dev/sdb9<br />
</code><br />
Type &#8216;<strong>cat /proc/mdstat</strong>&#8216; to see the 5 failed RAID devices:<br />
<code><br />
# cat /proc/mdstat<br />
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]<br />
md5 : active (auto-read-only) raid1 sdb9[1]<br />
1452590968 blocks super 1.2 [2/1] [_U]</p>
<p>md4 : active (auto-read-only) raid1 sdb8[1]<br />
389108 blocks super 1.2 [2/1] [_U]</p>
<p>md3 : active (auto-read-only) raid1 sdb7[1]<br />
3021812 blocks super 1.2 [2/1] [_U]</p>
<p>md2 : active (auto-read-only) raid1 sdb6[1]<br />
2927604 blocks super 1.2 [2/1] [_U]</p>
<p>md1 : active (auto-read-only) raid1 sdb5[1]<br />
5857268 blocks super 1.2 [2/1] [_U]</p>
<p>md0 : active (auto-read-only) raid1 sdb1[1]<br />
340980 blocks super 1.2 [2/1] [_U]</p>
<p>unused devices:<br />
</code></p>
<h2>Format, Mount and copy RAID devices</h2>
<p>Prepare and copy the root partition (md0 mounted on /mnt)<br />
<code><br />
# mkfs.ext3 /dev/md0<br />
# mount /dev/md0 /mnt<br />
# cd / &#038;&#038; find . -xdev | cpio -pm /mnt<br />
</code></p>
<p>Prepare and copy /usr partition (md1 mounted on /mnt/usr)<br />
<code><br />
# mkfs.ext3 /dev/md1<br />
# mount /dev/md1 /mnt/usr<br />
# cd /usr &#038;&#038; find . -xdev | cpio -pm /mnt/usr<br />
</code></p>
<p>Prepare and copy /var partition (md2 mounted on /mnt/var)<br />
<code><br />
# mkfs.ext3 /dev/md2<br />
# mount /dev/md2 /mnt/var<br />
# cd /var &#038;&#038; find . -xdev | cpio -pm /mnt/var<br />
</code></p>
<p>Prepare swap partition (md3)<br />
<code><br />
# mkswap /dev/md3<br />
</code></p>
<p>Prepare /tmp partition (md4 mounted on /mnt/tmp)<br />
<code><br />
# mkfs.ext3 /dev/md4<br />
# mount /dev/md4 /mnt/tmp<br />
# chmod 777 /mnt/tmp<br />
</code></p>
<p>Prepare /home partition (md5 mounted on /mnt/home)<br />
<code><br />
# mkfs.ext4 /dev/md5<br />
# mount /dev/md5 /mnt/home<br />
# cd /home &#038;&#038; find . -xdev | cpio -pm /mnt/home<br />
</code></p>
<h2>Change fstab</h2>
<p>Edit /mnt/etc/fstab and change all devices according to the new RAID devices<br />
My /mnt/etc/fstab looks like this now<br />
<code><br />
# <file system> <mount point>   <type><br />
<options>       <dump>
<pass>
proc            /proc           proc    defaults        0       0<br />
# / was on /dev/sda1 during installation<br />
/dev/md0 /               ext3    errors=remount-ro 0       1<br />
# /home was on /dev/sda9 during installation<br />
/dev/md5 /home           ext4    defaults        0       2<br />
# /tmp was on /dev/sda8 during installation<br />
/dev/md4 /tmp            ext3    defaults        0       2<br />
# /usr was on /dev/sda5 during installation<br />
/dev/md1 /usr            ext3    defaults        0       2<br />
# /var was on /dev/sda6 during installation<br />
/dev/md2 /var            ext3    defaults        0       2<br />
# swap was on /dev/sda7 during installation<br />
/dev/md3 none            swap    sw              0       0<br />
/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto     0       0<br />
</code></p>
<p>Edit /boot/grub/grub.cfg and change <strong>root=</strong> so it points  to /dev/md0.</p>
<h2>Reboot on RAID devices</h2>
<p>This worked the first time for me, without any console access :)<br />
Run update-grub when you are logged in again.</p>
<h2>Fix paritions types on sda</h2>
<p>Now that we don&#8217;t use the partitions on our original system disk (sda) we can edit the partition table and set the partitions to type &#8216;<strong>fd raid autodetect</strong>&#8216;. My sda partition table looks like this now:<br />
<code><br />
Device Boot      Start         End      Blocks   Id  System<br />
/dev/sda1   *           1          43      340992   fd  Linux raid autodetect<br />
/dev/sda2              43      182402  1464795137    5  Extended<br />
/dev/sda5              43         773     5858304   fd  Linux raid autodetect<br />
/dev/sda6             773        1137     2928640   fd  Linux raid autodetect<br />
/dev/sda7            1137        1514     3022848   fd  Linux raid autodetect<br />
/dev/sda8            1514        1562      389120   fd  Linux raid autodetect<br />
/dev/sda9            1562      182402  1452592128   fd  Linux raid autodetect<br />
</code></p>
<h2>Add sda partitions to RAID devices</h2>
<p>Now it&#8217;s time to add the unused partitions from sda to our failed raid devices.</p>
<p><code># mdadm --add /dev/md0 /dev/sda1</code></p>
<p>We can see the RAID device (md0) rebuilding onto the new disk with &#8216;<strong>cat /proc/mdstat</strong>&#8216;</p>
<p>Add the other partitions:<br />
<code><br />
# mdadm --add /dev/md1 /dev/sda5<br />
# mdadm --add /dev/md2 /dev/sda6<br />
# mdadm --add /dev/md3 /dev/sda7<br />
# mdadm --add /dev/md4 /dev/sda8<br />
# madam --add /dev/md5 /dev/sda9<br />
</code></p>
<p>To watch the rebuild, run<br />
<code># watch cat /proc/mdstat</p>
<p>Every 2,0s: cat /proc/mdstat                                                     Mon Dec  6 19:55:04 2010</p>
<p>Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]<br />
md0 : active raid1 sda1[2] sdb1[1]<br />
340980 blocks super 1.2 [2/2] [UU]</p>
<p>md1 : active raid1 sda5[2] sdb5[1]<br />
5857268 blocks super 1.2 [2/2] [UU]</p>
<p>md2 : active raid1 sda6[2] sdb6[1]<br />
2927604 blocks super 1.2 [2/1] [_U]<br />
resync=DELAYED</p>
<p>md3 : active raid1 sda7[2] sdb7[1]<br />
3021812 blocks super 1.2 [2/1] [_U]<br />
resync=DELAYED</p>
<p>md4 : active raid1 sda8[2] sdb8[1]<br />
389108 blocks super 1.2 [2/1] [_U]<br />
resync=DELAYED</p>
<p>md5 : active raid1 sda9[2] sdb9[1]<br />
1452590968 blocks super 1.2 [2/1] [_U]<br />
[&gt;....................]  recovery =  0.6% (9617600/1452590968) finish=268.3min speed=89629K/sec</p>
<p>unused devices:<br />
</code></p>
<p>Don&#8217;t reboot until all devices has rebuilt.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fmark.nellemann.nu%2F2010%2F12%2F06%2Fbootable-software-raid-1-on-running-system%2F&amp;title=Bootable%20Software%20RAID-1%20on%20running%20system" id="wpa2a_16"><img src="http://mark.nellemann.nu/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://mark.nellemann.nu/2010/12/06/bootable-software-raid-1-on-running-system/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fjern en regel kampagne fra Venstre</title>
		<link>http://mark.nellemann.nu/2010/11/18/fjern-en-regel-kampagne-fra-venstre/</link>
		<comments>http://mark.nellemann.nu/2010/11/18/fjern-en-regel-kampagne-fra-venstre/#comments</comments>
		<pubDate>Thu, 18 Nov 2010 12:23:43 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Politik]]></category>
		<category><![CDATA[politik]]></category>
		<category><![CDATA[regler]]></category>
		<category><![CDATA[venstre]]></category>

		<guid isPermaLink="false">http://mark.nellemann.nu/?p=1025</guid>
		<description><![CDATA[Jeg læser idag i Ventre&#8217;s seneste nyhedsbrev om deres Fjern en regel kampagne. Det er jo et rigtig fint initiativ, men jeg har lidt svært ved at tage det alvorligt. Det skal dog ikke stoppe mig i at komme med forslag, så jeg har sendt følgende til deres fjernenregel mailbox; Kære Venstre, Hvordan kan jeg [...]]]></description>
			<content:encoded><![CDATA[<p>Jeg læser idag i Ventre&#8217;s seneste nyhedsbrev om deres Fjern en regel kampagne. Det er jo et rigtig fint initiativ, men jeg har lidt svært ved at tage det alvorligt. Det skal dog ikke stoppe mig i at komme med forslag, så jeg har sendt følgende til deres fjernenregel mailbox;<br />
<span id="more-1025"></span></p>
<p>Kære Venstre,</p>
<p>Hvordan kan jeg tage det her alvorligt?</p>
<p>Jeg læser om nye regler dagligt. Om det er multimedieskat, familiesammenføring eller partikkel filtre &#8220;i miljøets hellige navn&#8221; er ligegyldigt. I kører i den forkerte retning. Drop millimeter retfærdigheden og keep it simple. </p>
<p>Det har været nogle drøje år som medlem af Venstre. Håber I kan rette ind og igen fremstå som et borligt parti, som sætter personlig frihed og ansvarlighed øverst.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fmark.nellemann.nu%2F2010%2F11%2F18%2Ffjern-en-regel-kampagne-fra-venstre%2F&amp;title=Fjern%20en%20regel%20kampagne%20fra%20Venstre" id="wpa2a_18"><img src="http://mark.nellemann.nu/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://mark.nellemann.nu/2010/11/18/fjern-en-regel-kampagne-fra-venstre/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Plesk 9.x to 10 migration &#8211; no IMAP subfolders &#8211; workaround</title>
		<link>http://mark.nellemann.nu/2010/11/11/plesk-9-to-10-migration-no-imap-subfolders/</link>
		<comments>http://mark.nellemann.nu/2010/11/11/plesk-9-to-10-migration-no-imap-subfolders/#comments</comments>
		<pubDate>Thu, 11 Nov 2010 07:32:55 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Linux & Unix]]></category>
		<category><![CDATA[imap]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[plesk]]></category>
		<category><![CDATA[sync]]></category>

		<guid isPermaLink="false">http://mark.nellemann.nu/?p=1012</guid>
		<description><![CDATA[Had the &#8220;pleasure&#8221; of migrating a Plesk 9.5 Linux server to another running the brand new Plesk 10 panel. Apart from the new GUI interface in Plesk 10, the migration was fast and went smooth. Or so I thought. The first problem I noticed was missing .htaccess files. The other, more serious, problem was with [...]]]></description>
			<content:encoded><![CDATA[<p>Had the &#8220;pleasure&#8221; of migrating a Plesk 9.5 Linux server to another running the brand new Plesk 10 panel. Apart from the new GUI interface in Plesk 10, the migration was fast and went smooth. Or so I thought. The first problem I noticed was missing .htaccess files. The other, more serious, problem was with IMAP/Maildir subfolders not being migrated. The quick solution was a loop of mail accounts and rsync over ssh. Change the SOURCE host to the IP/hostname of the &#8220;old&#8221; server, or some other server with a copy of the complete Maildir&#8217;s. Run the script on the &#8220;new&#8221; Plesk 10 host.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #666666; font-style: italic;">### rsync app must be installed on source &amp; destination</span>
<span style="color: #666666; font-style: italic;">## apt-get install rsync</span>
&nbsp;
<span style="color: #666666; font-style: italic;">### This script should be run on the destination host (Plesk 10)</span>
&nbsp;
<span style="color: #007800;">ROOT</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>qmail<span style="color: #000000; font-weight: bold;">/</span>mailnames
<span style="color: #007800;">DEPTH</span>=<span style="color: #000000;">2</span>
<span style="color: #007800;">SOURCE</span>=old-plesk.server.tld
&nbsp;
<span style="color: #666666; font-style: italic;">### Loop folders</span>
<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #007800;">$ROOT</span> <span style="color: #660033;">-maxdepth</span> <span style="color: #000000;">2</span> <span style="color: #660033;">-type</span> d -print<span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #000000; font-weight: bold;">do</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-d</span> <span style="color: #007800;">$i</span><span style="color: #000000; font-weight: bold;">/</span>Maildir <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Syncing <span style="color: #007800;">$i</span>&quot;</span>
                rsync <span style="color: #660033;">-ar</span> <span style="color: #800000;">${SOURCE}</span>:<span style="color: #800000;">${i}</span><span style="color: #000000; font-weight: bold;">/</span>Maildir <span style="color: #800000;">${i}</span><span style="color: #000000; font-weight: bold;">/</span>
        <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">done</span></pre></div></div>

<p>A quick fix for the missing .htaccess files could be running the following on the &#8220;old&#8221; server. I have ssh keys installed and enabled agent authentication forwarding, so I won&#8217;t need to enter my password for each file.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>vhosts<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">'.htaccess'</span> \
 <span style="color: #660033;">-exec</span> rsync <span style="color: #660033;">-a</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span> root<span style="color: #000000; font-weight: bold;">@</span>new-plesk.server.tld:<span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span> \;</pre></div></div>

<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fmark.nellemann.nu%2F2010%2F11%2F11%2Fplesk-9-to-10-migration-no-imap-subfolders%2F&amp;title=Plesk%209.x%20to%2010%20migration%20%26%238211%3B%20no%20IMAP%20subfolders%20%26%238211%3B%20workaround" id="wpa2a_20"><img src="http://mark.nellemann.nu/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://mark.nellemann.nu/2010/11/11/plesk-9-to-10-migration-no-imap-subfolders/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  mark.nellemann.nu/feed/ ) in 0.58840 seconds, on Feb 9th, 2012 at 10:34 am UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 9th, 2012 at 11:34 am UTC -->
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<!-- Quick Cache Is Fully Functional :-) ... A Quick Cache file was just served for (  mark.nellemann.nu/feed/ ) in 0.00054 seconds, on Feb 9th, 2012 at 10:55 am UTC. -->
