Tag: Linux

Restoring an Embedded Linux Raid Device

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.
  1. Copy your files off quick to another drive and pray for good weather!
  2. Credits:  I got alot of the help from this post on the WDMBWEII wiki dot page.
Google Buzz

Tags: , , , , , , , , , , , ,

OpenWRT + Router Station Pro + Arduino = Fun

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.

DSC_4002

Google Buzz

Tags: , , , , , ,

Powered by Wordpress and Stripes Theme Entries (RSS) | Comments (RSS)

Bad Behavior has blocked 88 access attempts in the last 7 days.