<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>The re-entrant coder</title>
	
	<link>http://coding.stampfini.info</link>
	<description>Journals of a restarting Java coder</description>
	<lastBuildDate>Fri, 30 Dec 2011 10:33:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/TheRe-entrantCoder" /><feedburner:info uri="there-entrantcoder" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Thoughts on Google music…</title>
		<link>http://feedproxy.google.com/~r/TheRe-entrantCoder/~3/RyyFRiu3Hmo/thoughts-on-google-music</link>
		<comments>http://coding.stampfini.info/general/thoughts-on-google-music#comments</comments>
		<pubDate>Wed, 25 May 2011 15:14:31 +0000</pubDate>
		<dc:creator>Sander Alberink</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://coding.stampfini.info/?p=129</guid>
		<description><![CDATA[Google announced Google music on this years Google i/o conference, a launch that has been anticipated by the pundits for a long time. The service looks like it could be very big as it allows a maximum number of tracks instead of a maximum amount of storage to be uploaded. What was unexpected was the [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>Google announced Google music on this years Google i/o conference, a launch that has been anticipated by the pundits for a long time. The service looks like it could be very big as it allows a maximum number of tracks instead of a maximum amount of storage to be uploaded. What was unexpected was the fact that, as Amazon had done before, Google launched without having a deal in place with the record labels. Google didn&#8217;t elaborate on this, but the general consensus seems to be that they probably don&#8217;t need a deal to begin with.<br />
As the first invitations are pouring out (of course i have already applied for mine) I wondered how Google manages this. Google&#8217;s redundancy model usually protects against data-loss by mirroring your data across multiple datacentres. But even on Google scale, mirroring 20000 tracks per user (at 4-7 mb a pop) to 2 or more datacentres has got to hurt. Even if most users never come near the 20000 track limit, I cannot imagine Google engineers being happy about storing &#8220;Baby hit me one more time&#8221; 3 million times. So this got me thinking if Google maybe has some  data de-duplication going on somewhere. Even more awesome would be if they were to include matching your content on your hard-drive against fingerprints stored online so that you wouldn&#8217;t need to upload your entire music collection. Oh well, one can dream..</p>
<p>No related posts.</p>
<p><a href="http://feedads.g.doubleclick.net/~a/HMLprSNkRqRCp-HRTs0XrpJxSQk/0/da"><img src="http://feedads.g.doubleclick.net/~a/HMLprSNkRqRCp-HRTs0XrpJxSQk/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/HMLprSNkRqRCp-HRTs0XrpJxSQk/1/da"><img src="http://feedads.g.doubleclick.net/~a/HMLprSNkRqRCp-HRTs0XrpJxSQk/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/TheRe-entrantCoder/~4/RyyFRiu3Hmo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://coding.stampfini.info/general/thoughts-on-google-music/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://coding.stampfini.info/general/thoughts-on-google-music</feedburner:origLink></item>
		<item>
		<title>Android Proxy support</title>
		<link>http://feedproxy.google.com/~r/TheRe-entrantCoder/~3/wXm3h21KhXA/android-proxy-support</link>
		<comments>http://coding.stampfini.info/linux/android-proxy-support#comments</comments>
		<pubDate>Wed, 25 May 2011 14:52:43 +0000</pubDate>
		<dc:creator>Sander Alberink</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://coding.stampfini.info/?p=107</guid>
		<description><![CDATA[So, last week I found myself immersed in Android again, figuring out for a client to what extend Android can support proxies. For future posterity, I&#8217;ve written this post to document what I found. User-level proxy support Proxy support under Android is somewhat of a mixed bag. What you will find is that is it [...]
Related posts:<ol>
<li><a href='http://coding.stampfini.info/linux/git-through-proxy' rel='bookmark' title='Git through proxy&#8230;.'>Git through proxy&#8230;.</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>So, last week I found myself immersed in Android again, figuring out for a client to what extend Android can support proxies. For future posterity, I&#8217;ve written this post to document what I found.</p>
<h3>User-level proxy support</h3>
<p>Proxy support under Android is somewhat of a mixed bag. What you will find is that is it possible to setup a proxy server for your 3G connection, but that it is not possible to setup a proxy connection for your WiFi or VPN  connection. A system-wide proxy cannot be setup as well. Mind you, this is based on what is possible under the default Android settings. The Samsung Galaxy S, for example, does support the use of a system-wide proxy, but this is a Samsung-addition.</p>
<p>A 3G proxy can be set via the APN settings (Settings →Wireless Controls→Mobile Networks→Access Point Names, then select the active APN):</p>
<div id="attachment_117" class="wp-caption alignnone" style="width: 178px"><a href="http://coding.stampfini.info/wordpress/wp-content/uploads/2010/09/editapn.png" rel="lightbox[107]"><img class="size-medium wp-image-117" title="Edit APN settings" src="http://coding.stampfini.info/wordpress/wp-content/uploads/2010/09/editapn-168x300.png" alt="" width="168" height="300" /></a><p class="wp-caption-text">Edit APN settings</p></div>
<p>This does give you a proxy for the 3G connection you are currently using, but most probably you want to use a proxy for your WiFi. As  of this moment (September 2010), this is not possible without rooting your handset. I won&#8217;t go into the details of that operation, as there are many sites dealing with that issue. Instead, I&#8217;d like to point you to <a href="http://forum.xda-developers.com" target="_blank">Xda Developers</a>, whose many forums are bound to contain rooting instructions for your particular Android handset.</p>
<p>If you do have a rooted phone, you can use a tool called.<br />
It is possible to have a UI popup that handles the configuration of a proxy for wifi but the settings that it stores are harshly discarded by Android when it configures a network connection.</p>
<p>One thing is for certain: Google needs to step up to the plate to make Android proxy friendly if it wants to break into the enterprise market.</p>
<p>Related posts:<ol>
<li><a href='http://coding.stampfini.info/linux/git-through-proxy' rel='bookmark' title='Git through proxy&#8230;.'>Git through proxy&#8230;.</a></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/JPAG7Rdqp-jcG5fl5-pYhuyiMWk/0/da"><img src="http://feedads.g.doubleclick.net/~a/JPAG7Rdqp-jcG5fl5-pYhuyiMWk/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/JPAG7Rdqp-jcG5fl5-pYhuyiMWk/1/da"><img src="http://feedads.g.doubleclick.net/~a/JPAG7Rdqp-jcG5fl5-pYhuyiMWk/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/TheRe-entrantCoder/~4/wXm3h21KhXA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://coding.stampfini.info/linux/android-proxy-support/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://coding.stampfini.info/linux/android-proxy-support</feedburner:origLink></item>
		<item>
		<title>WiFi lesson…</title>
		<link>http://feedproxy.google.com/~r/TheRe-entrantCoder/~3/-1pkFhVl6ok/wifi-lesson</link>
		<comments>http://coding.stampfini.info/linux/wifi-lesson#comments</comments>
		<pubDate>Thu, 23 Sep 2010 13:45:04 +0000</pubDate>
		<dc:creator>Sander Alberink</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://coding.stampfini.info/?p=122</guid>
		<description><![CDATA[For the past few days I wondered why my laptop refused to connect to my wireless access point in my study, instead insisting to connect to the wireless router in the basement. As my study is one floor up, with hard concrete walls and floors seperating them, the resulting signal was abysmal. As both networks [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>For the past few days I wondered why my laptop refused to connect to my wireless access point in my study, instead insisting to connect to the wireless router in the basement. As my study is one floor up, with hard concrete walls and floors seperating them, the resulting signal was abysmal.</p>
<p>As both networks were configured to use the same SSID, theoretically they should both be visible to the laptop and the strongest signal should have been chosen. Indeed, an &#8216;iwconfig wlan0 scan&#8217; command showed that both access points were visible. As I had configured them with the same WPA2 passkey, I could not figure out why it refused to connect to the nearest access point.</p>
<p>After a few days, it suddenly hit me: I had one access point configured to allow for WPA/WPA2 connections and the other access point for WPA2 only. This is enough of a difference to force Ubuntu into thinking that these are different access points. What is strange though, is that they do not should up in the wireless network browser as two different networks. I know that my Android phone has no problem connecting to the nearest network, regardless of WPA settings.</p>
<p>Anyway, fixed now&#8230; <img src='http://coding.stampfini.info/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>No related posts.</p>
<p><a href="http://feedads.g.doubleclick.net/~a/CIH_6VhF0AUzlU77sPpje3o4x2g/0/da"><img src="http://feedads.g.doubleclick.net/~a/CIH_6VhF0AUzlU77sPpje3o4x2g/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/CIH_6VhF0AUzlU77sPpje3o4x2g/1/da"><img src="http://feedads.g.doubleclick.net/~a/CIH_6VhF0AUzlU77sPpje3o4x2g/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/TheRe-entrantCoder/~4/-1pkFhVl6ok" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://coding.stampfini.info/linux/wifi-lesson/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://coding.stampfini.info/linux/wifi-lesson</feedburner:origLink></item>
		<item>
		<title>Android on the HTC Diamond/Raphael/Topaz/Rhodium</title>
		<link>http://feedproxy.google.com/~r/TheRe-entrantCoder/~3/hdu4BMCmXHc/android-on-the-htc-diamondraphaeltopazrhodium</link>
		<comments>http://coding.stampfini.info/linux/android-linux/android-on-the-htc-diamondraphaeltopazrhodium#comments</comments>
		<pubDate>Tue, 25 May 2010 20:19:40 +0000</pubDate>
		<dc:creator>Sander Alberink</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[HTC]]></category>

		<guid isPermaLink="false">http://coding.stampfini.info/?p=84</guid>
		<description><![CDATA[OK, so I promised some more details on the current port of Android to the HTC Diamond. As I referred to before, there is a porting effort underway to get Android running on the HTC Diamond (both the GSM and CDMA version). Most progress is chronicled on the (ever excellent) XDA-developers.com site, but there are [...]
Related posts:<ol>
<li><a href='http://coding.stampfini.info/java/how-to-install-android-on-your-htc-touch-diamond' rel='bookmark' title='How-to install Android on your HTC Touch Diamond'>How-to install Android on your HTC Touch Diamond</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>OK, so I <a href="http://coding.stampfini.info/?p=78">promised</a> some more details on the current port of Android to the HTC Diamond. As I referred to before, there is a porting effort underway to get Android running on the HTC Diamond (both the GSM and CDMA version). Most progress is chronicled on the (ever excellent) <a href="http://www.xda-developers.com">XDA-developers.com</a> site, but there are several changes.</p>
<p>Running Android on your HTC Diamond means installing 3 different things to the internal storage of the Diamond (or an SD-card for the Topaz  and Rhodium):</p>
<ol>
<li>A Linux kernel (found <a href="http://glemsom.anapnea.net/android">here</a>)</li>
<li>A rootfs for booting the kernel and Android (found <a href="http://xdandroid.southcape.org/rootfs/">here</a>)</li>
<li>An Android distribution (found <a href="http://htcandroid.xland.cz/">here</a>).</li>
<li>Oh, and a configuration file for configuring the Android build (you are probably best off getting the first version out of the full build linked below).</li>
</ol>
<p>If you&#8217;re not familiar with booting Linux or Android, you may want to download everything in one package, which can be found in <a href="http://forum.xda-developers.com/showthread.php?t=601751">this thread on XDA</a>. After downloading, unzip everything in the root of the Internal Storage (for HTC Diamond) or in the root of your SD-card for all the other models. Copy the startup config for your device</p>
<p>A few attention points:</p>
<ul>
<li>Disable the PIN-code on your SIM-card! The current ported version does not handle SIM PIN-requests properly (it gives a pop-up but does not unlock the SIM properly) No longer applicable, with the current rootfs PIN requests are handled properly.</li>
<li>On the HTC Diamond, change the file in &lt;tbd&gt; (while running Windows Mobile) and look for the line with cc-cache=100 in it. Change this to cc-cache=20. This prevents Android from pre-loading a lot of applications upon startup, slowing down your phone</li>
<li>The clock will start drifting a bit, about half an hour a day. This is annoying, but the developers are aware of this.</li>
</ul>
<p>For me, this is the end of the line, as I have sold my HTC and instead opted to go the Android route entirely, buying myself a SonyEricsson Xperia X10</p>
<ul></ul>
<p>Related posts:<ol>
<li><a href='http://coding.stampfini.info/java/how-to-install-android-on-your-htc-touch-diamond' rel='bookmark' title='How-to install Android on your HTC Touch Diamond'>How-to install Android on your HTC Touch Diamond</a></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/of6K5XPoWHS6WD122CsDipiOhbk/0/da"><img src="http://feedads.g.doubleclick.net/~a/of6K5XPoWHS6WD122CsDipiOhbk/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/of6K5XPoWHS6WD122CsDipiOhbk/1/da"><img src="http://feedads.g.doubleclick.net/~a/of6K5XPoWHS6WD122CsDipiOhbk/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/TheRe-entrantCoder/~4/hdu4BMCmXHc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://coding.stampfini.info/linux/android-linux/android-on-the-htc-diamondraphaeltopazrhodium/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://coding.stampfini.info/linux/android-linux/android-on-the-htc-diamondraphaeltopazrhodium</feedburner:origLink></item>
		<item>
		<title>Unscheduled blog downtime</title>
		<link>http://feedproxy.google.com/~r/TheRe-entrantCoder/~3/3nJw97Nl4dQ/unscheduled-blog-downtime</link>
		<comments>http://coding.stampfini.info/general/unscheduled-blog-downtime#comments</comments>
		<pubDate>Fri, 12 Mar 2010 22:39:57 +0000</pubDate>
		<dc:creator>Sander Alberink</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://coding.stampfini.info/?p=101</guid>
		<description><![CDATA[We&#8217;re back up and running again, at least on this blog. I asked my hoster to upgrade my account with SSH, which seems to entail a server-move. During that move, the databases get migrated as well and during the migration they managed to lose all database contents. Of course, this left the blog in tatters. [...]
Related posts:<ol>
<li><a href='http://coding.stampfini.info/general/blog-restart' rel='bookmark' title='Blog restart'>Blog restart</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re back up and running again, at least on this blog. I asked my hoster to upgrade my account with SSH, which seems to entail a server-move. During that move, the databases get migrated as well and during the migration they managed to lose all database contents. Of course, this left the blog in tatters. We&#8217;re back up and running, due to a restore of the old database-contents. Now, let&#8217;s see if I can get <a href="http://www.stampfini.org">www.stampfini.org</a> to run again&#8230;</p>
<p>Edit: and that is running again as well.</p>
<p>Related posts:<ol>
<li><a href='http://coding.stampfini.info/general/blog-restart' rel='bookmark' title='Blog restart'>Blog restart</a></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/RKJrzyRXVjT1EglHjwk2yRWb9jA/0/da"><img src="http://feedads.g.doubleclick.net/~a/RKJrzyRXVjT1EglHjwk2yRWb9jA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/RKJrzyRXVjT1EglHjwk2yRWb9jA/1/da"><img src="http://feedads.g.doubleclick.net/~a/RKJrzyRXVjT1EglHjwk2yRWb9jA/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/TheRe-entrantCoder/~4/3nJw97Nl4dQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://coding.stampfini.info/general/unscheduled-blog-downtime/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://coding.stampfini.info/general/unscheduled-blog-downtime</feedburner:origLink></item>
		<item>
		<title>Android or iPhone? Wrong Question Â« abovethecrowd.com</title>
		<link>http://feedproxy.google.com/~r/TheRe-entrantCoder/~3/IFWzYm2yx_g/android-or-iphone-wrong-question-%c2%ab-abovethecrowd-com</link>
		<comments>http://coding.stampfini.info/linux/android-linux/android-or-iphone-wrong-question-%c2%ab-abovethecrowd-com#comments</comments>
		<pubDate>Thu, 04 Mar 2010 11:50:08 +0000</pubDate>
		<dc:creator>Sander Alberink</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Competitive Analysis]]></category>

		<guid isPermaLink="false">http://coding.stampfini.info/?p=99</guid>
		<description><![CDATA[Found a great read on why Android or iPhone is the wrong question. While Apple may have opened the proverbial Walled Garden, it is Google, with its aggressive Android offering, that aims to obliterate it. Make no mistake about it; Apple was the pioneer with the amazing revolutionary product. Also, with no iPhone, there is [...]
Related posts:<ol>
<li><a href='http://coding.stampfini.info/linux/android-proxy-support' rel='bookmark' title='Android Proxy support'>Android Proxy support</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Found a great read on why Android or iPhone is the wrong question.</p>
<blockquote><p>While Apple may have opened the proverbial Walled Garden, it is Google, with its aggressive Android offering, that aims to obliterate it. Make no mistake about it; Apple was the pioneer with the amazing revolutionary product. Also, with no iPhone, there is no Android. This is not to say that Android copied iPhone, but rather the impetus to adopt and trust Googleâ€™s Android offering was driven by a market dynamic that resulted directly from the iPhoneâ€™s success.</p></blockquote>
<p>via <a href="http://abovethecrowd.com/2010/01/05/android-or-iphone-wrong-question/">Android or iPhone? Wrong Question Â« abovethecrowd.com</a>.</p>
<p>Indeed, the iPhone represents only a very small portion of the global phone market. But it is the other portion of that same phone market that is the target for Google/Android. Google does not necessarily want to compete with the iPhone head-to-head (although they can!), but is more looking towards converting people that use a heavy feature-phone these days but may make the switch to a smartphone if a compelling enough offer comes along.</p>
<p>Related posts:<ol>
<li><a href='http://coding.stampfini.info/linux/android-proxy-support' rel='bookmark' title='Android Proxy support'>Android Proxy support</a></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/rwh9-YYoUYYtLr8YiMZvONRHpi8/0/da"><img src="http://feedads.g.doubleclick.net/~a/rwh9-YYoUYYtLr8YiMZvONRHpi8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/rwh9-YYoUYYtLr8YiMZvONRHpi8/1/da"><img src="http://feedads.g.doubleclick.net/~a/rwh9-YYoUYYtLr8YiMZvONRHpi8/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/TheRe-entrantCoder/~4/IFWzYm2yx_g" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://coding.stampfini.info/linux/android-linux/android-or-iphone-wrong-question-%c2%ab-abovethecrowd-com/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://coding.stampfini.info/linux/android-linux/android-or-iphone-wrong-question-%c2%ab-abovethecrowd-com</feedburner:origLink></item>
		<item>
		<title>HD Crash…</title>
		<link>http://feedproxy.google.com/~r/TheRe-entrantCoder/~3/JFATvdghIms/hd-crash</link>
		<comments>http://coding.stampfini.info/linux/hd-crash#comments</comments>
		<pubDate>Wed, 17 Feb 2010 17:20:23 +0000</pubDate>
		<dc:creator>Sander Alberink</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Data loss]]></category>
		<category><![CDATA[Frustration]]></category>

		<guid isPermaLink="false">http://coding.stampfini.info/?p=88</guid>
		<description><![CDATA[So&#8230;. Here we go again: that all too familiar feeling of &#8216;uhoh&#8217;&#8230;. I was working on my PC the other night, doing a routine upgrade of KDE to the newly release version 4.4, when all of a sudden aptitude started spewing loads and loads of errors about not being able to save files and giving [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>So&#8230;. Here we go again: that all too familiar feeling of &#8216;uhoh&#8217;&#8230;. I was working on my PC the other night, doing a routine upgrade of<a href="http://www.kde.org"> KDE </a>to the newly release version 4.4, when all of a sudden aptitude started spewing loads and loads of errors about not being able to save files and giving read-only errors all over the place. A quick check with mount and dmesg confirms my suspicion: a hard drive is giving problems and the file system has been remounted read-only. Dmesg confirmed that it was the drive timing out on commands, giving mentions that it was unable to remap a sector.</p>
<p>Now, this puts me into a bit of a bind. This is an olderly PC that I scrapped together from a Dell Dimension 8400 and an additional HD and SATA card. As it doubles as the media-server for my XBox, it has to have some additional storage, hence the extra harddisk. The extra harddisk was a 300Gb one, the system harddisk it came with (which started failing) was a 160Gb one. I&#8217;ve routinely run LVM2 on my system exactly for this case, being able to add additional diskspace easily without fiddling with mounting additional drives, running out of space on one partition while swimming in space on another one. This time, that may have gotten the better of me though. I don&#8217;t run LVM in a RAID setup, so if one drive fails, I&#8217;m up sh*t creek. My only luck may have been that I only very recently added that disk, and I hadn&#8217;t really started using it.</p>
<p>So, now I need to recover this data somehow. My plan of attack is as follows:</p>
<ul>
<li>Put in another drive</li>
<li>Move the entire contents of the failing drive to the new drive</li>
<li>Try to reconstruct the LVM data from there.</li>
<li>Profit! <img src='http://coding.stampfini.info/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ul>
<h4>Step 1: find a new drive</h4>
<p>We need a donor drive to transfer the data too. Preferably, use a drive that is bigger than the original drive. Nothing would be worse when you try to rescue your precious data and finding out that you are a few sectors short on the new drive. Even if both drives are advertised as being 160Gb drive, that doesn&#8217;t mean they will have the exact same sector count! When we have the drive, hook it up to the system</p>
<p>In my case, I bought a 250Gb Samsung drive, only to find out after I built it into my machine that it was a) refurbished (it had a complete Vista install on it) and b) dying! I immediately got a warning from Ubuntu that the <a href="http://en.wikipedia.org/wiki/S.M.A.R.T.">SMART</a> data indicated that the drive was failing&#8230; Not good. I removed the drive and replaced it with a slightly larger 160Gb drive I had lying around. I will replace that drive when I get a replacement for the refurbed drive, but by then, I can hopefully use the &#8216;pvmove&#8217; commands.</p>
<p>When connecting the drives, make sure that you hook up the donor drive to the cable that was originally connected to the failing drive and connect the failing drive with an extra cable. This way, the device enumeration under Linux would be identical and the partitions we salvage will appear on the device files that LVM expects.</p>
<h4>Step 2: re-create the partitions you had on the drive</h4>
<p>This step, in retrospect, may not have been necessary. I booted the mediaserver into a bootable Ubuntu 9.10 CD-image and re-created the partitions using Gparted, ensuring that each partition was slightly larger than the corresponding partition on the failing disk. Note: gparted will complain that it is not capable of working with LVM2, but you can ignore that.
<a href='http://coding.stampfini.info/linux/hd-crash/attachment/gparted1' title='gparted1'><img width="150" height="150" src="http://coding.stampfini.info/wordpress/wp-content/uploads/2010/02/gparted1-150x150.png" class="attachment-thumbnail" alt="gparted1" title="gparted1" /></a>
<a href='http://coding.stampfini.info/linux/hd-crash/attachment/gparted2' title='gparted2'><img width="150" height="150" src="http://coding.stampfini.info/wordpress/wp-content/uploads/2010/02/gparted2-150x150.png" class="attachment-thumbnail" alt="gparted2" title="gparted2" /></a>
</p>
<h4>Step 3: get a copy of dd_rescue</h4>
<p>For the copying of the data to succeed, we need a copy of <a href="http://www.garloff.de/kurt/linux/ddrescue/">dd_rescue</a>. Dd_rescue is a clone of dd, that copies data from a file or device and does not abort when it encounters a read error. Instead, it will fall back to a &#8216;sector-at-the-time&#8217; reading mode, log the error and continue. Additionally, it has the option of reverse-copying, starting at the end of a device and working its way backwards, so that you can approach a problem area from both sides, maximizing the amount of a file or device that can be read.</p>
<p>Ubuntu 9.10 does not come with this by default, but the sources are tiny and luckily our live-CD includes a working gcc compiler. Compiling it is a breeze, just consisting of a &#8216;make&#8217; call. We run it is follows:</p>
<pre class="brush:bash">$ sudo ./dd_rescue /dev/sdc1 /dev/sdb1</pre>
<p>Of course, you will need to change /dev/sdc1 and /dev/sdb1 into their appropriate device files. <strong>Also, be very careful about the orderÂ  of these arguments. The first is the input file, the second argument is the output file. Mess these up and you are overwriting the data you want to recover with whatever was on the donor drive!</strong></p>
<p>I had two partitions, so I executed this command twice. In retrospect I could have just specified the device files for the entire harddisk (i.e. /dev/sdc and /dev/sdb) and dd_rescue would have duplicated everything (including the partition table).</p>
<p>I got around 40 read-errors on the first partition, and about 520 on the second partition. Now we have the drives duplicated, but don&#8217;t throw the faulty drive away just yet! If we manage to cock up the LVM restore, we can re-attempt the saving.</p>
<h4>Step 4: start salvaging using LVM</h4>
<p>Now we have a copy of our physical volumes. We will try to activate the volumegroups they belong to by executing vgscan:</p>
<pre class="brush:bash">$ sudo vgscan -v
Wiping cache of LVM-capable devices
Wiping internal VG cache
Reading all physical volumes.Â  This may take a while...
Finding all volume groups
Finding volume group "htpc-server"
Found volume group "htpc-server" using metadata type lvm2</pre>
<p>After this is done and our volumegroups have been found, we execute a vgchange:</p>
<blockquote><p>$ sudo vgchange -a y<br />
2 logical volume(s) in volume group &#8220;htpc-server&#8221; now active</p></blockquote>
<p>vgdisplay will give us the names of all volumes and volumegroups:</p>
<blockquote><p>$ sudo vgdisplay<br />
&#8212; Volume group &#8212;<br />
VG NameÂ Â Â Â Â Â Â Â Â Â Â Â Â Â  htpc-server<br />
System ID<br />
FormatÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â  lvm2<br />
Metadata AreasÂ Â Â Â Â Â Â  3<br />
Metadata Sequence NoÂ  5<br />
VG AccessÂ Â Â Â Â Â Â Â Â Â Â Â  read/write<br />
VG StatusÂ Â Â Â Â Â Â Â Â Â Â Â  resizable<br />
MAX LVÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â  0<br />
Cur LVÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â  2<br />
Open LVÂ Â Â Â Â Â Â Â Â Â Â Â Â Â  0<br />
Max PVÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â  0<br />
Cur PVÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â  3<br />
Act PVÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â  3<br />
VG SizeÂ Â Â Â Â Â Â Â Â Â Â Â Â Â  428.24 GB<br />
PE SizeÂ Â Â Â Â Â Â Â Â Â Â Â Â Â  4.00 MB<br />
Total PEÂ Â Â Â Â Â Â Â Â Â Â Â Â  109629<br />
Alloc PE / SizeÂ Â Â Â Â Â  109629 / 428.24 GB<br />
FreeÂ  PE / SizeÂ Â Â Â Â Â  0 / 0<br />
VG UUIDÂ Â Â Â Â Â Â Â Â Â Â Â Â Â  2arhGV-xkVa-MUXt-38PD-XOmE-TaYN-tpPJBT</p></blockquote>
<p>Finally, we can execute a full fsck on the volumegroups involved and if no unfixable errors are found, we can mount the filesystems and start assessing the real data-loss.</p>
<p>No related posts.</p>
<p><a href="http://feedads.g.doubleclick.net/~a/EiD3n6VsbOW1gEvOvB82ZD1Jb7U/0/da"><img src="http://feedads.g.doubleclick.net/~a/EiD3n6VsbOW1gEvOvB82ZD1Jb7U/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/EiD3n6VsbOW1gEvOvB82ZD1Jb7U/1/da"><img src="http://feedads.g.doubleclick.net/~a/EiD3n6VsbOW1gEvOvB82ZD1Jb7U/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/TheRe-entrantCoder/~4/JFATvdghIms" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://coding.stampfini.info/linux/hd-crash/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://coding.stampfini.info/linux/hd-crash</feedburner:origLink></item>
		<item>
		<title>That’s why I bought an e-reader…</title>
		<link>http://feedproxy.google.com/~r/TheRe-entrantCoder/~3/1TNyR71lmvE/thats-why-i-bought-an-e-reader</link>
		<comments>http://coding.stampfini.info/general/thats-why-i-bought-an-e-reader#comments</comments>
		<pubDate>Mon, 28 Dec 2009 10:39:22 +0000</pubDate>
		<dc:creator>Sander Alberink</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://coding.stampfini.info/?p=86</guid>
		<description><![CDATA[Amazon.com, Inc. (NASDAQ:AMZN) today announced that Kindle has become the most gifted item in Amazon&#38;apos;s history. On Christmas Day, for the first time ever, customers purchased more Kindle books than physical books. via Amazon.com &#8212; News Release. Related posts: Why Kindle Should Be An Open Book &#8211; Forbes.com
Related posts:<ol>
<li><a href='http://coding.stampfini.info/general/why-kindle-should-be-an-open-book-forbes-com' rel='bookmark' title='Why Kindle Should Be An Open Book &#8211; Forbes.com'>Why Kindle Should Be An Open Book &#8211; Forbes.com</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<blockquote><p>Amazon.com, Inc. (NASDAQ:AMZN) today announced that Kindle has become the most gifted item in Amazon&amp;apos;s history. On Christmas Day, for the first time ever, customers purchased more Kindle books than physical books.</p></blockquote>
<p>via <a href="http://phx.corporate-ir.net/phoenix.zhtml?c=176060&amp;p=irol-newsArticle&amp;ID=1369429&amp;highlight=">Amazon.com &#8212; News Release</a>.</p>
<p>Related posts:<ol>
<li><a href='http://coding.stampfini.info/general/why-kindle-should-be-an-open-book-forbes-com' rel='bookmark' title='Why Kindle Should Be An Open Book &#8211; Forbes.com'>Why Kindle Should Be An Open Book &#8211; Forbes.com</a></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/sBnA3WtrkV_Dq3Xy0oNFywvRsbs/0/da"><img src="http://feedads.g.doubleclick.net/~a/sBnA3WtrkV_Dq3Xy0oNFywvRsbs/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/sBnA3WtrkV_Dq3Xy0oNFywvRsbs/1/da"><img src="http://feedads.g.doubleclick.net/~a/sBnA3WtrkV_Dq3Xy0oNFywvRsbs/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/TheRe-entrantCoder/~4/1TNyR71lmvE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://coding.stampfini.info/general/thats-why-i-bought-an-e-reader/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://coding.stampfini.info/general/thats-why-i-bought-an-e-reader</feedburner:origLink></item>
		<item>
		<title>Simple, succinct and true…</title>
		<link>http://feedproxy.google.com/~r/TheRe-entrantCoder/~3/ikyktBInKCM/simple-succinct-and-true</link>
		<comments>http://coding.stampfini.info/general/simple-succinct-and-true#comments</comments>
		<pubDate>Mon, 21 Dec 2009 08:39:25 +0000</pubDate>
		<dc:creator>Sander Alberink</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Music]]></category>

		<guid isPermaLink="false">http://coding.stampfini.info/?p=82</guid>
		<description><![CDATA[I bought a CD, not a licensing agreement &#8211; â€œWhere words fail, music speaksâ€. Nuff said&#8230; No related posts.
No related posts.]]></description>
			<content:encoded><![CDATA[<blockquote><p><a href="http://gcn1.posterous.com/i-bought-a-cd-not-a-licensing-agreement#">I bought a CD, not a licensing agreement &#8211; â€œWhere words fail, music speaksâ€</a>.</p></blockquote>
<p>Nuff said&#8230;</p>
<p>No related posts.</p>
<p><a href="http://feedads.g.doubleclick.net/~a/vWf4TUI8b5HUADOMpPv01BqAQMk/0/da"><img src="http://feedads.g.doubleclick.net/~a/vWf4TUI8b5HUADOMpPv01BqAQMk/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/vWf4TUI8b5HUADOMpPv01BqAQMk/1/da"><img src="http://feedads.g.doubleclick.net/~a/vWf4TUI8b5HUADOMpPv01BqAQMk/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/TheRe-entrantCoder/~4/ikyktBInKCM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://coding.stampfini.info/general/simple-succinct-and-true/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://coding.stampfini.info/general/simple-succinct-and-true</feedburner:origLink></item>
		<item>
		<title>What have I been up to…</title>
		<link>http://feedproxy.google.com/~r/TheRe-entrantCoder/~3/ZumatX9gxpI/what-have-i-been-up-to</link>
		<comments>http://coding.stampfini.info/general/what-have-i-been-up-to#comments</comments>
		<pubDate>Mon, 14 Dec 2009 13:42:22 +0000</pubDate>
		<dc:creator>Sander Alberink</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://coding.stampfini.info/?p=78</guid>
		<description><![CDATA[Well, it&#8217;s been a while, shall we say. In the mean time, I&#8217;m still in full swing on another embedded Linux project and got a chance to cut my teeth on some D-Bus actions. In addition, two of my little pet peeves have moved significantly: Android on my HTC Touch Diamond has become much more [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>Well, it&#8217;s been a while, shall we say. In the mean time, I&#8217;m still in full swing on another embedded Linux project and got a chance to cut my teeth on some D-Bus actions. In addition, two of my little pet peeves have moved significantly:</p>
<ul>
<li>Android on my HTC Touch Diamond has become much more useable</li>
<li>I bought an E-reader ( a <a href="http://www.sonystyle.com/webapp/wcs/stores/servlet/ProductDisplay?catalogId=10551&amp;storeId=10151&amp;langId=-1&amp;productId=8198552921665921188" target="_blank">Sony PRS-300</a>)</li>
</ul>
<p>Both items will be covered in more detail in the future here. Very soon I will have some more time to give out some more details on both matters.</p>
<p>No related posts.</p>
<p><a href="http://feedads.g.doubleclick.net/~a/CoJgPfy-7i0OZD52NFOM3mIpI54/0/da"><img src="http://feedads.g.doubleclick.net/~a/CoJgPfy-7i0OZD52NFOM3mIpI54/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/CoJgPfy-7i0OZD52NFOM3mIpI54/1/da"><img src="http://feedads.g.doubleclick.net/~a/CoJgPfy-7i0OZD52NFOM3mIpI54/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/TheRe-entrantCoder/~4/ZumatX9gxpI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://coding.stampfini.info/general/what-have-i-been-up-to/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://coding.stampfini.info/general/what-have-i-been-up-to</feedburner:origLink></item>
	</channel>
</rss>

