<?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>Synthetos &#187; Linux</title>
	<atom:link href="http://blog.synthetos.com/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.synthetos.com</link>
	<description>Complex Ideas...</description>
	<lastBuildDate>Wed, 30 Jun 2010 21:16:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Restoring an Embedded Linux Raid Device</title>
		<link>http://blog.synthetos.com/restoring-an-embedded-linux-raid-device/</link>
		<comments>http://blog.synthetos.com/restoring-an-embedded-linux-raid-device/#comments</comments>
		<pubDate>Sat, 01 May 2010 01:00:05 +0000</pubDate>
		<dc:creator>Ril3y</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[embedded device]]></category>
		<category><![CDATA[fail]]></category>
		<category><![CDATA[linear drive]]></category>
		<category><![CDATA[losetup]]></category>
		<category><![CDATA[mdadm]]></category>
		<category><![CDATA[Nas]]></category>
		<category><![CDATA[raid]]></category>
		<category><![CDATA[raid controller failed]]></category>
		<category><![CDATA[restore]]></category>
		<category><![CDATA[software raid]]></category>
		<category><![CDATA[WDG2NC10000N]]></category>
		<category><![CDATA[Western Digital]]></category>

		<guid isPermaLink="false">http://blog.synthetos.com/?p=360</guid>
		<description><![CDATA[So I picked up a Western Digital My Book II World Edition (WDMBWEII) a few years back to place all of my digital &#8220;life&#8221; on. Well being stupid&#8230; (perhaps pre-occupied) I did not have a up-to-date backup of the NAS since 2008 OCT. Needless to day the NAS failed. However, interestingly enough as luck would [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://salestores.com/stores/images/images_747/WDG2NC10000N.jpg" alt="" width="192" height="240" />So I picked up a <a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16822136083" target="_parent">Western Digital My Book II World Edition</a> (WDMBWEII) a few years back to place all of my digital &#8220;life&#8221; on.  Well being stupid&#8230; (perhaps pre-occupied) I did not have a up-to-date backup of the NAS since 2008 OCT.  Needless to day the NAS failed.  However, interestingly enough as luck would have it the NAS embedded system is the part that failed.  Meaning&#8230; The software raid devices we (Hard Drives) were just fine.. No corruption or anything.  In spirit of helping someone else out that might experience this problem I thought I would document the journey to recovery.</p>
<p>Backups.  You should backup your drives before you try to re-assemble them.  This will take a significant amount of time.  However, should you fat finger something or just have bad luck it will be worth the effort.</p>
<p>Assumptions:  You know what Linux is.  You have a vaild Ubuntu system to use as a &#8220;2 day dedicated raid restore system&#8221;.  You have a way to attach the 2 drives you popped from your WD MBWEII.  I used <a href="http://www.tigerdirect.com/applications/SearchTools/item-details.asp?Sku=T925-1500" target="_parent">this</a>.  You have 1 drive that is 1.5 TB (1tb will do it but its cutting it close)  to put the new images on.</p>
<p>Ok so backup your drives with dd_rescue (you can use dd if you prefer however dd_rescue gives you some nice &#8220;feedback&#8221; to show your backup progress).  Once you do that mount them as &#8220;loop devices&#8221;.  Then you reassemble the raid device with the mdadm command.  Below will walk you through all of this.</p>
<p><span style="color: #ff0000;"><strong><span style="background-color: #ffff00;">BACKUP YOUR DRIVES:</span></strong></span></p>
<p><span style="color: #ff0000;"><strong><span style="color: #cccccc; font-weight: normal;">Find out what the names of your drives are:</span></strong></span></p>
<p>
<strong><em><span style="color: #ff6600;">sudo fdisk -l<br />
</span></em></strong>This should return your drive information.  Look for the 2 drives that appear to be the same size.  So something like:<br />
 /dev/sdb and /dev/sdc<br />
 There will be multiple partitions on each drive.  The partition we want to backup is the /dev/sdX4 this contains the data.  So:</p>
<p><br class="spacer_" /></p>
<p><span style="display: inline;"> </span></p>
<div id="_mcePaste"><span style="color: #ff6600;"><em><strong>sudo dd_rescue /dev/sdb1 /media/drive_to_backup_to<br />
</strong></em></span><br />
 Replace drive_to_backup_to with whatever / wherever you want to place the 465GBish image to.<br />
 Do this for both of the drives then set them aside.</div>
<div id="_mcePaste">Ok 24 hoursish later you should have your images.  Now its time to set them up as virtual devices via the losetup command.  So this is what we are going to do in psuedo speak.  We make both image files local loop back devices.  Then we re-assemble the stripped array (which I believe is a raid 0) fromt he images.  ***Note your original drives you took from the WDMYBEII should be somewhere safe&#8230; You should not need them again.  That is until you remove all your data and want to &#8220;do&#8221; something with them again.   So lets ressaemble the drives and restore our data!</div>
<div id="_mcePaste"><em><strong><span style="color: #ff6600;">sudo losetup /dev/loop0 /path/to/backup_drive1</span></strong></em></div>
<div id="_mcePaste"><em><strong><span style="color: #ff6600;">sudo losetup /dev/loop1 /path/to/backup_drive2</span></strong></em></div>
<div id="_mcePaste">That will setup your created images as &#8220;virtual devices&#8221; .  So now lets reassemble them via mdadm. <br />
<em><strong><span style="color: #ff6600;">sudo mdadm &#8211;assemble /dev/md1  &#8211;force /dev/loop0 /dev/loop1 </span></strong></em></div>
<div id="_mcePaste">I am not sure if &#8211;force is needed however its what I did.</div>
<div id="_mcePaste">Lastly we need to mount this newly created &#8220;raid&#8221;device via the mount command.   I created a mount point for it too.  So:<br />
 sudo mkdir /media/NAS</div>
<div id="_mcePaste">sudo mount /dev/md1 /media/NAS</div>
<div id="_mcePaste">***Note if your mount fails (which mine did not)  it might be asvisible to run an fsck on the /dev/md1 device an then trying again. howeve ryou are on your own on this.</div>
<ol>
<li>Copy your files off quick to another drive and pray for good weather! </li>
<li>Credits:  I got alot of the help from <a href="http://mybookworld.wikidot.com/rescue-procedure-take-2" target="_parent">this</a> post on the WDMBWEII wiki dot page. </li>
</ol>
<a class="google_buzz"  
href="http://www.google.com/reader/link?url=http://blog.synthetos.com/restoring-an-embedded-linux-raid-device/&title=Restoring+an+Embedded+Linux+Raid+Device&srcURL=http://blog.synthetos.com" target="_blank" rel="nofollow"><img
src="http://blog.synthetos.com/wp-content/plugins/google-buzz-button-for-wordpress/images/google-buzz.png" alt="Google Buzz" /></a>]]></content:encoded>
			<wfw:commentRss>http://blog.synthetos.com/restoring-an-embedded-linux-raid-device/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>OpenWRT + Router Station Pro + Arduino = Fun</title>
		<link>http://blog.synthetos.com/openwrt-router-station-pro-arduino/</link>
		<comments>http://blog.synthetos.com/openwrt-router-station-pro-arduino/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 16:06:59 +0000</pubDate>
		<dc:creator>Ril3y</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[openwrt]]></category>
		<category><![CDATA[pyserial]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://blog.synthetos.com/?p=7</guid>
		<description><![CDATA[Around 11PM last night I finally was able to get all the Arduino Hardware talking to my Openwrt Router Station Pro Installation.  These are the packages you need to have on your system.  (if you built your own firmware with theses great! otherwise just opkg install them) Like So: root@OpenWrt:~# opgk install usbutils Install the [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Around 11PM last night I finally was able to get all the <a href="http://WWW.ARDUINO.CC">Arduino </a>Hardware talking to my <a href="http://openwrt.org/">Openwrt</a> <a href="http://www.ubnt.com/products/rspro.php">Router Station Pro</a> Installation.  These are the packages you need to have on your system.  (if you built your own firmware with theses great! otherwise just opkg install them)</p>
<p style="text-align: left;">Like So:</p>
<p style="text-align: left;"><em>root@OpenWrt:~# opgk install usbutils</em></p>
<p style="text-align: left;">Install the rest of these packages the exact same way:</p>
<blockquote style="text-align: left;">
<blockquote>
<ul>
<li>usb-ohci</li>
<li>kmod-usb-serial-ftdi</li>
<li>kmod-usb2</li>
<li>kmod-usb-serial<em>(Note: these packages are needed if you want to us the MMC/SD Card on the RS PRO)</em></li>
<li>kmod-usb-storage</li>
<li>kmod-mmc</li>
</ul>
</blockquote>
</blockquote>
<p style="text-align: left;">Once that is done you can issue the <em>lsusb</em> command to see if your system recognizes the Arduino FTDI interface.  You should see something like this.</p>
<p style="text-align: left;"><em><span style="color: #000000;"><span style="background-color: #ffff00;"><span style="font-family: arial black,avant garde;"><strong>Bus 002 Device 002: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC</strong></span></span></span><br />
 Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
 Bus 001 Device 003: ID 05e3:0723 Genesys Logic, Inc.<br />
 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub</em></p>
<p style="text-align: left;">If you do not see the UART (FTDI) device go ahead and reboot your system and it should come up.  If it does not you are missing a package email me we can see whats up.</p>
<p style="text-align: left;">Will add more later but here some screenshots of the system working.</p>
<p style="text-align: left;"><a title="DSC_4002" href="http://www.flickr.com/photos/31697990@N00/3968087992/"><img class="alignleft" style="float: left;" src="http://farm3.static.flickr.com/2444/3968087992_16a466d125.jpg" alt="DSC_4002" /></a></p>
<a class="google_buzz"  
href="http://www.google.com/reader/link?url=http://blog.synthetos.com/openwrt-router-station-pro-arduino/&title=OpenWRT+++Router+Station+Pro+++Arduino+=+Fun&srcURL=http://blog.synthetos.com" target="_blank" rel="nofollow"><img
src="http://blog.synthetos.com/wp-content/plugins/google-buzz-button-for-wordpress/images/google-buzz.png" alt="Google Buzz" /></a>]]></content:encoded>
			<wfw:commentRss>http://blog.synthetos.com/openwrt-router-station-pro-arduino/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
