HOWTO: Sharespace RAID 5 Data Recovery

I managed to rebuild the raid 5 array using a computer and a Ubuntu LiveCD after the Sharespace unit was bricked after a firmware update.  Even if you are not very computer savvy, this tutorial tries to be very straight forward.  Probably the most difficult part is physically attaching the drives correctly in the right order on the temporary machine.

I need to give credit to this link:  http://www.linuxjournal.com/article/8874?page=0,1  The info there was invaluable!

You can go to the Ubuntu website and download a Live CD image that can be burned either to a DVD or a usb jump drive.  Go to  Ubuntu Download Page.  There are instructions and links on how to burn and create the bootable media.

You will need a computer with a CD rom drive or usb port to use an Ubuntu bootable jump drive and a hard drive controller capable of handling the number of drives you have.  It doesn’t have to be anything fancy and can even be a system you already have sitting around.  I had to go and buy a four port serial ATA card for $25 at compusa to plug into an old system I had.  No biggy, I guess.  You need to remove the drives from the Sharespace and label them in order from top to bottom.  Attach them to your temporary computer disk controller making sure that you attach them in the same order by adding one at a time, booting and checking the system or controller bios, which ever is applicable.  I recommend you disconnect any other drives from the controller if you are using a functioning system with other existing drives.  You should really be able to do this without effecting the existing system as you should be able to just plug the existing drives back in when you are done.  I am using my network to transfer the files off of the drive onto my new system.  Perhaps you could use an external usb drive and would be faster, but may muck up the drive numbering in Ubuntu.  If you use an external USB drive, I recommend waiting and plugging it in after you have the raid rebuilt.  Note that booting to the LiveCD creates a temporary session of linux and anything you do in that session in terms of configuration is lost on reboot.  If you need to reboot for any reason, you will effectively have to restart.

Once you have the drives from your WD box attached to the temporary computer properly, boot up using the LiveCD and click on the “Try Ubuntu…” to load the operating system.  Once the system is loaded, you will need to load a terminal shell by clicking on Applications->Accessories->Terminal.

To set yourself as the root user and not have to type “sudo” 1000 tims, once in terminal, type:

sudo su -

You will need to install the raid softward and LVM2 to access the drive partitions.  Type:

apt-get install mdadm lvm2  (you will need to answer “Y” to some questions when asked)

If the drives are connected properly, they should be the devices as follows:

Drive 1:  /dev/sda

Drive 2:  /dev/sdb

Drive 3:  /dev/sdc

Drive 4:  /dev/sdd

You can check this by typing fdisk -l and it will list the drives and associated partition information.  Each of my drives had four partitions on them and are labeled sda1. sda2, sda3, sda4 for drive 1 and sdb1, sdb2, etc. for the subsequent drives.

Only the fourth partitoin sdx4 is the one with the data and you need to recreate that raid array.  You do this by typing:

mdadm --assemble /dev/md0 /dev/sda4 /dev/sdb4 /dev/sdc4 /dev/sdd4

You should get a message that the raid is functioning.  You can check the status by typing:

mdadm --detail /dev/md0

and

cat /proc/mdstat

Your raid is now reassembled, but the WD uses lvm2.  If you try to use the standard mounting with autodetect you will get an error of unknown fs type LVM2 something or other. 

To get the volume name type:

vgscan

The volume on yours should be the same.  Mine was called “vg0”

Then type:

vgchange vg0 -a y

You should get a message telling you that your logical volume is active.  From here you only need to mount the drive to the file system.  My logical volume was called “lvo”

First create a directory to mount to by typing:

mkdir /mnt/raid

I am not sure if this is necessary, but I went ahead and completely opened up the permissions to the folder by typing:

chmod 777 /mnt/raid

Then mount the drive to that folder by typing:

mount -t auto /dev/vg0/lv0 /mnt/raid

Your files should now be accessible through the file browser.  Go to Places->Computer, then click on “File System” on the left.  Then, navigate to the /mnt/raid folder in the main window.  I found that there were strange permissions on my files so I went ahead and removed all restrictions using the chmod on the raid drive by typing the following into the terrminal window:

chmod 777 -R /mnt/raid

I hope this helps anyone else out that has as much precious data as I did that was feared lost!

Good luck!

7 Likes

WOW, nice tutorial, saving this just in case and thank you for sharing…

Wow, thank you VERY much for this tutorial! It will save the community thousands of dollars to data recovery services (which is the standard “solution” of the WD support to this problem).

This community has asked WD countless times to provide this kind of tutorial - to no avail.

Now you did what WD could not do.

I can’ thank you enough! :slight_smile:

Thanks a lot

I followed your instructions and it worked perfectly!

My WD ShareSpace was inaccessible after a firmware update and was getting very worried about my data!

Awesome!  Glad I could help! 

Hey, I’m Little confused about the LVM2 structure on WD ShareSpace?! I have a working system at the moment to explore the file system LIVE to aid with my recovery but three is no LVM structure to be found… Every LVM scan command to scan the drives reveals there isn’t one… This should not matter whether the system is LIVE or not… I think this is why I couldn’ t recover my data following your method… Whats your thoughts??

I unfortunately and not a wiz kid on LVM… you can see from my tutorial that my info on it is limited.  I believe I referred to it as “LVM or something…”.  Regardless, I don’t have a system here to tinker with anymore.  For others who may know, are you getting anything from the vgscan output?

You may want to look through the links that I included credits for near the beginning of my initial post.  There is a lot more detailed information about the partition tables and structure in that link that may be of help to you.  I simply parsed out a step by step method that worked for me.

Also, did you attempt it more than once?  My system froze up during the file copy when I was transferring the data off the drives.  It had been copying for a couple days if memory serves and got hung up at some point.  My luck was good that day since the copy crapped out after all of my necessary data had been copied over.  When I rebooted and tried the same sequence, it no longer worked.  I am not sure if it did something to the drive formatting but I got to the same point and was getting no result from the vgscan.  I gave up and considered myself lucky for getting the data I needed off the drives.

Keep us posted.  Good luck!

Well, I’ve been instructing myself on how LVM can be implemented on systems, if you so wish… And from my understanding, it makes absolutely no sense having an LVM file structure on the ShareSpace… If you had more than one RAID structures you could combine them both to form one drive, or if you had a RAID structure and several spare HDDs, you could also combine them to form one drive and change the amount of space you require on the fly (except changing the RAID structure of course). You can create one directory using LVM over several drives too, it’s very dynamic… And, you don’t even need a RAID structure either to do the same thing… These types of file structures seem useless in the ShareSpace, particularly when the RAID 5 has already combined the drives to create a file structure; it seem useless applying LVM on top of this to perform exactly the same thing…

Hi

would it work using a USB to USB from the WD sharespace? I can see each HD through a single dock that i have connected to my pc. the only system i have come by is 4 Bay eSATA USB 2.0 to SATA Hard Drive Docking Station for 2.5/3.5-Inch HDD witch is quite expencive / this migth work.

is there a command where i can copy my /dev/sda4 (eg) to the local drive om my laptop one at a time and then assemble them after?

hope you can help

regards Gadgetgirl63

It would be my recommendation to try and leave the drives as they are.  Trying to copy partitions may work but my tutorial is strictly to rebuild the array as it stood in the ShareSpace.  You only need to connect three of the drives if you had a four drive raid 5 in order to get the files off.  The nature of the raid 5 is that you have one drive redundancy so one of them can be omitted for the purpose.  I recommend trying to find a way to connect all drives simultaneously either with three separate docks or the one four bay you listed.

You just need to get the drives connected to a PC where they will come up as devices in the dev folder.  I have not seen anyone successfully copy partitions over to another drive and then reassemble the raid from a copied partition.

Most people have at least one PC connected to their network and Sharespace.  In this day, most should have a sata controller.  If you have one, I highly recommend you just disconnect the existing drives and temporarily connect the SS drives to it.

Got all 4 harddrives set up to my pc now, and yes it is set up as RAID5.

i cannot get passed your tutorial from mdadm --assemble /dev/md0 /dev/sdh1 /dev/sdi1 /dev/sdj1 /dev/sdk1

i keep getting /dev/md0 is already in use. i tried to scan my array via mdadm --examine --scan /dev/sdh1 /dev/sdi1 /dev/sdj1 /dev/sdk1 to see if my ARRAY was different than /dev/md0 or if i had more than this one, but i only had  this ARRAY /dev/md0.

Hello,

You have to remember when the system is LIVE in your NAS, there are 3 RAID systems active (md0, md2 and md3). The first two are RAID 1 (this primarily consists of your Linux system) and the 3rd is your primary RAID, holding all your data… However, i’m still trying to figure out how this system is set-up, it isn’t in the usual way.  So, when your trying to activate md0, it may already have initiated somehow, in the auto boot up sequence… I’m not sure how this could of happened in another machine, but it is worth exploring… 

I do know the ShareSpace utilises a watered down verison of a BusyBox Linux system, however. 

When my sharespace failed recently following a firmware update, I was able to ssh into it and see that the following had been initiated:

md0 raid1

md1 raid1

By follwing the instructions elsewhere in this forum I was able to configure md2 as raid5 to copy my data off the sharespace.

If the drives are right out of the SS, then the data partition would be the fourth one.  You are showing sdh1, etc.  I would think it should be sdh4, etc.

Are you booting from a LiveCD?  If you only have the four drives attached as in my tutorial, it would seem odd that your drives wouldn’t be sda, sdb, sdc, sdd.  If you are not booting from a LiveCD and have other drives in the system, perhaps the other drives are already assembled as a raid?  I am not really sure.

Try booting from a Live CD with no other drives attached to the system to see if this may be your issue.

Good luck!

1 Like

**bleep** i’m in the same situation 

after power fault and update firmware 

in ssh i’ve found

md0 raid1

md1 raid1

also have

md2 raid5 not active

but i’m not able to activate mount etc etc

help help me?

What commands did you enter and what error messages did you get?

finally i got it to work :slight_smile: i am VERY happy!

i am copying all my data over to and other external harddrive.

it took leaving a hardisk in my ladtop with nothing on it, for it to work! (on top of the 3 HD with the Raid5 on them) i foud out that 1 of th HD had failed!

So now i need you to help me wipe/formate my 4 harddisks om my WD sharespace as the system does not react as soon as i put the harddisks back in the “box” it simply does not work.

I have an agreament with the company that i bougth it from that they will give me a new one, but i would really like to remove and format  ALL our data before i give back the harddrives.

Any good ideas or ubunto coding for formating a raid5 or maybe just 1 HD at a time?

I must admit that i am not wanting to have to do with WD again so i am on a lookout for a better system, that is more trustworthy and have a good support that you can contakt in case of any problems.

thanks :slight_smile:

It would helpful if you can share what you had to do to get it working for others to follow!

Glad you got things working.

Thanks for creating this process for us.

I have a 4TB unit and had the #1 drive in fail mode. I received a new unit from WD and luck have it…the whole RAID went down on a reboot just as I went to do a copy.

I’m at the vgscan part of your process and I’m getting

root@ubuntu:~# vgscan
 > Reading all physical volumes.  This may take a while…
 > No volume groups found

Is there a way to create a new vloume group without wiping out any data?