Posted by
Ril3y on April 30, 2010 |
One comment
So I picked up a Western Digital My Book II World Edition (WDMBWEII) a few years back to place all of my digital “life” on. Well being stupid… (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… 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.
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.
Assumptions: You know what Linux is. You have a vaild Ubuntu system to use as a “2 day dedicated raid restore system”. You have a way to attach the 2 drives you popped from your WD MBWEII. I used this. You have 1 drive that is 1.5 TB (1tb will do it but its cutting it close) to put the new images on.
Ok so backup your drives with dd_rescue (you can use dd if you prefer however dd_rescue gives you some nice “feedback” to show your backup progress). Once you do that mount them as “loop devices”. Then you reassemble the raid device with the mdadm command. Below will walk you through all of this.
BACKUP YOUR DRIVES:
Find out what the names of your drives are:
sudo fdisk -l
This should return your drive information. Look for the 2 drives that appear to be the same size. So something like:
/dev/sdb and /dev/sdc
There will be multiple partitions on each drive. The partition we want to backup is the /dev/sdX4 this contains the data. So:
sudo dd_rescue /dev/sdb1 /media/drive_to_backup_to
Replace drive_to_backup_to with whatever / wherever you want to place the 465GBish image to.
Do this for both of the drives then set them aside.
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… You should not need them again. That is until you remove all your data and want to “do” something with them again. So lets ressaemble the drives and restore our data!
sudo losetup /dev/loop0 /path/to/backup_drive1
sudo losetup /dev/loop1 /path/to/backup_drive2
That will setup your created images as “virtual devices” . So now lets reassemble them via mdadm.
sudo mdadm –assemble /dev/md1 –force /dev/loop0 /dev/loop1
I am not sure if –force is needed however its what I did.
Lastly we need to mount this newly created “raid”device via the mount command. I created a mount point for it too. So:
sudo mkdir /media/NAS
sudo mount /dev/md1 /media/NAS
***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.
- Copy your files off quick to another drive and pray for good weather!
- Credits: I got alot of the help from this post on the WDMBWEII wiki dot page.
Tags: embedded device, fail, linear drive, Linux, losetup, mdadm, Nas, raid, raid controller failed, restore, software raid, WDG2NC10000N, Western Digital
Posted by
Ril3y on April 12, 2010 |
2 comments

I used 603 components in some spots where it called for 402.
Travis Goodspeed was cool enough to toss me a few goodfet PCB’s in the mail. I got them quite a while ago and have been waiting for a good time to assemble one and get it rocking. At work I have a project that I need an MSP programmer so I can go ahead and flash some code onto a prototype system. Well that being said it seemed like the perfect time to get this board working.
You can see how to build this board from the great flick photo travis has here. Or you can download the eagle files and go from there. Pick your prefrered poison. I just followed the flickr page / notes. If you are not used to soldering smd stuff I would suggest practice a bit on some cheaper IC’s as the MSP4302618 is about $13.
Once you get it all built up (y ou checked for solder bridges right?) you can plug it into a usb port. The TX and RX light flashes quickly then it just sits there as a VCP on your system (assuming you have the FTDI drivers installed). At this point we need to load up the latest goodfet firmware. Travis has authored a few python scripts + some other glue code that automates the download and install of the firmware over the net! A quick ./goodfet.bsl –fromweb and its on its way. See screen shot below. One thing to note is you will need pyserial on your system for the firmware downloader / installer to work. I did this from OSX however it works just as well on linux. I have not got this setup working from Windows yet. I did take 2 mins to try however. But it does seem like the way windows handles serial ports might blowup the firmware dl/installer script.

However as it would seem the way Travis does his hack to where there is not a need for a crystal is still a bit off. (hes fixing this soon) You can read the information here on how the non need for a crystal works here. To fix this Travis has a bunch of txt files with different timing values. The command to execute is.
./goodfet.bsl -e -p contrib/infos/2618-002.txt; ./goodfet.bsl -p msp430x2618.hex
Obviously choose your chip txt file and hex file. I am using the Goodfet 2.2. It uses the MSP4302618 so this is the file that I used. Note, the only 2 files that worked for my specific uC was:
2618-002.txt
2618-004.txt
You can verify that the goodfet is now working by doing a
./goodfet.monitor info
ril3y@linux:~/Desktop/goodfet/svngoodfet/trunk/client$ ./goodfet.monitor info
GoodFET with f26f MCU
ril3y@linux:~/Desktop/goodfet/svngoodfet/trunk/client$
Here is a video of the flashing process. Note, its super exciting

Tags: Electronics, flash, ftdi, GoodFet, travis goodspeed
Posted by
Ril3y on September 30, 2009 |
3 comments
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 rest of these packages the exact same way:
- usb-ohci
- kmod-usb-serial-ftdi
- kmod-usb2
- kmod-usb-serial(Note: these packages are needed if you want to us the MMC/SD Card on the RS PRO)
- kmod-usb-storage
- kmod-mmc
Once that is done you can issue the lsusb command to see if your system recognizes the Arduino FTDI interface. You should see something like this.
Bus 002 Device 002: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 003: ID 05e3:0723 Genesys Logic, Inc.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
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.
Will add more later but here some screenshots of the system working.

Tags: arduino, hacking, Linux, openwrt, pyserial, python, Security