Wednesday 28 December 2011

Restoring Data from Netgear ReadyNAS Duo Hard Drive

Recently, a new clients Netgear ReadyNAS Duo NAS device malfunctioned. Unfortunately, the hard drive that he had neglectfully placed in the NAS, WD 1.0 TB (WD10EALX), was not covered by the Netgear ReadyNAS Duo HCL list. I contacted Netgear Support anyway and as expected, they were unable to help.


Here are the steps I used to restore the data from the Linux based EXT3 file system that the ReadyNAS uses to store files internally. 


Note: This only works for non-RAIDed drives. i.e. Single drive only.


Pre-requisite: Installed version of VMware Player/Server running on a Windows machine.
Difficulty: Intermediate Linux, Beginner Windows, Beginner VMware.


1. Download acmtn Debian VMware Linux Image from here. (Size: 1.6GB - Kudos to Dekkit on the ReadyNAS forums) Tip: The VM requires at least 8GB of space.


2. Import the Debian5 VM onto your VMware platform. 
Tip: On your VMware platform, choose Virtual Machine > Add Virtual Machine to Inventory


3. Start the Debian5 VM and enter in vmuser as username and vmuser1 as the password


4. At this point, you will need a way to connect your HDD onto your machine. For my purposes, I ran this process from my laptop so I needed a SATA to USB adapter. 



Tip: If you are plugging your HDD via USB and  you are unable to detect it within your Debian5 VM, ensure you select it within VMware Server as shown below.


On your VMware platform, you should now be able to access the HDD. 


5. In the Debian5 VM, go to System > Administration > Partition Editor. On the right of the toolbar you should see a selection menu. Check  to ensure that you have a partition that is about the same as your HDD. e.g. /dev/sdb (931.51GB) for my 1TB WD HDD. Close the GParted window.




6. Now that your Debian5 VM can see the drive, we need to attempt to access the data. On the VM, click on Root Terminal on the Desktop and run the following commands, one after the other. Rmodprobe 


7. modprobe fuse This command is used to add modules to linux to be able to "talk" to the HDD


8. vgscan scans all SCSI, IDE and other disk devices on the system looking for LVM physical volumes


9. vgchange -ay c allows you to change the attribute of the HDD volume groups to "activate" and name the volume group as C


10. mkdir /mnt/lvm create a mount point for the volume group


11. ext2fuse /dev/c/c /mnt/lvm uses the installed ext2fuse utility to support the mounted EXT3 file system. You will notice a slight delay in output until this is displayed
"/dev/c/c is to be mounted at /mnt/lvm fuse-ext2 intiailized for device: /dev/c/c block size is 16384"
Once this is displayed, your HDD should be accesible.

12. Open another terminal window and enter cd /mnt/lvm. You should notice a few folders such as Media, Home, etc. If you enter in cd media then ls, this will list the files/folders in the Media folder.


13. Now you need to decide where you will be restoring your data to. The best is to copy to the VM Host machine so that you can access the data via your Windows machine. Remember that the Debian5 VM is only 8GB in total size. 


a. To mount a Windows network location, Open a Root Terminal again. 


b. Install smbfs by entering apt-get install smbfs and follow the prompts


c. modprobe smbfs allows the linux VM to talk to the Windows partitions


d. mkdir -p /mnt/restore creates a new mount point to later mount the access to the Windows share


e. On the host machine, create a new Windows share folder e.g. C:\Restored


f. Right click the folder and ensure Everyone has full share permissions and folder permissions

g. In the terminal, enter mount -t smbfs -o username=<PC name or domain>\<local user accountname> \\<host computer name>\c$\Restored /mnt/restore
e.g. my host computer is in a workgroup with name ERIKPC and account Erik. I entered in mount -t smbfs -o username=ERIKPC\Erik \\ERIKPC\c$\Restored /mnt/restore


h. you may need to enter in your local user password for the Host account (e.g. Erik account)


14. Now, you can simply copy files from the /mnt/lvm folder to the /mnt/restore folder. Enter cp -r /mnt/lvm/Media /mnt/restore will copy the files in the Media folder to the Windows share.


15. Install a new HDD into the ReadyNAS, re-configure it and copy the data back. 


More information:  Source: http://www.readynas.com/forum/viewtopic.php?f=11&t=35153




1 comment:

  1. Awesome blog and Great guide, really easy, sound and clear. i like it.. keep it up..

    Visit Mt site- Netgear Router Support

    ReplyDelete