NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
mjw1
Jul 01, 2012Aspirant
Successful Readynas X6 X-RAID data recovery
Writing this down in case it's useful to anyone.
A few weeks ago my old Readynas X6 would no longer boot but I was pretty sure the disks were all in decent shape. Firmware is 4.1.6 and it has 4x500GB disks with a 4KB block size and 512 byte sectors. It would start to boot and was visible for short periods via RAIDar but seemed to be caught in an endless loop from which it could never fully boot. I thought I had a USB backup of all the critical data, but it turned out that my sister had stored some of her critical files on a non-backed up share! So the recovery hell began.
Recovering large amounts of data on disks is a slow and tedious process. It took me 2 weeks with all the various things I tried that didn't work initially. Ideally I would have found a way to connect all 4 drives simultaneously via SATA cables, but in this case I'd given the NAS to my sister in the UK and all she had was a Windows 7 laptop with one USB 3.0 port.
The first step was to buy StarTech SuperSpeed USB 3.0 eSATA Hard Drive Docking Station so she could attach the disks via USB 3 to a laptop. Then I went to work via Teamviewer.
Getting Ubuntu Running on the Laptop
Initially I tried installing Ubuntu 12.04 Desktop onto a pendrive using Universal USB Installer. The advantage of this method was the disk transfers were quick but I found for some reason (perhaps the pendrive was poor quality) it was not stable and after a couple of days the pendrive would not successfully boot. I then switched to installing Ubuntu on top of VMWare. Disk transfers were much slower, and I couldn't get USB 3 speeds at all but it was stable.
Suggestions:
R-Studio for Linux
Next I needed to create images of each disk. I could have used the linux dd command, but I decided to try R-Studio since others in the forums had reported success with R-Studio for Linux. R-Studio for Linux has an option to Create a Disk Image (select the byte-for-byte). To have sufficient space to store 4 500GB disk images we had to buy two external USB drives (1TB plus 2TB). In retrospect it would have been quicker to have created the disk images from within Windows. In the end it took a few days.
Mount LVM-based volumes from loopback full disk images
The above link had some great instructions for mounting the Logical Volume using my disk images.
Using fdisk I was able to find the sector where my LVM physical volume started on each disk:
The starting sector is 4608003 and since my disks have 512 bytes per sector, 512 * 4608003 = 2359297536
I ran the following commands in Ubuntu 12.04 64-bit (replace your path with whatever the correct path is to your disk images):
This resulted in the following output showing 3 physical volumes have been found - success!
Next I activated the LVM array:
After this, all the data was available intact within the "tera" directory and I was able to copy it off to a spare USB drive.
Here's some useful links
http://home.bott.ca/webserver/?p=306
Also tried the acmtn vmware image mentioned in this thread, but found it was very old and had trouble getting it to work with the disks
Caveats
My device is a Sparc device using X-RAID (not X-RAID2) and has 4KB block size, not 16KB like the newest models. Instructions may differ for other Readynas models. Here's a good place to look if you have a different model: http://home.bott.ca/webserver/?p=306
Dead-ends
I tried Reclaime software which claimed to be able to automatically detect the correct RAID parameters. I initially thought I would need this because R-Studio requires a number of parameters before it can recover a RAID. I ran Reclaime in RAID 0 mode and also RAID 5 mode for several days and it was unable to determine the RAID parameters for my X6. In the end it turned out that all I needed was Ubuntu linux!
A few weeks ago my old Readynas X6 would no longer boot but I was pretty sure the disks were all in decent shape. Firmware is 4.1.6 and it has 4x500GB disks with a 4KB block size and 512 byte sectors. It would start to boot and was visible for short periods via RAIDar but seemed to be caught in an endless loop from which it could never fully boot. I thought I had a USB backup of all the critical data, but it turned out that my sister had stored some of her critical files on a non-backed up share! So the recovery hell began.
Recovering large amounts of data on disks is a slow and tedious process. It took me 2 weeks with all the various things I tried that didn't work initially. Ideally I would have found a way to connect all 4 drives simultaneously via SATA cables, but in this case I'd given the NAS to my sister in the UK and all she had was a Windows 7 laptop with one USB 3.0 port.
The first step was to buy StarTech SuperSpeed USB 3.0 eSATA Hard Drive Docking Station so she could attach the disks via USB 3 to a laptop. Then I went to work via Teamviewer.
Getting Ubuntu Running on the Laptop
Initially I tried installing Ubuntu 12.04 Desktop onto a pendrive using Universal USB Installer. The advantage of this method was the disk transfers were quick but I found for some reason (perhaps the pendrive was poor quality) it was not stable and after a couple of days the pendrive would not successfully boot. I then switched to installing Ubuntu on top of VMWare. Disk transfers were much slower, and I couldn't get USB 3 speeds at all but it was stable.
Suggestions:
Label each of your disks 1,2,3,4 etc so you know exactly which bay they came from.
Make sure the computer is shutdown before connecting/disconnecting disks to be absolutely safe.
R-Studio for Linux
Next I needed to create images of each disk. I could have used the linux dd command, but I decided to try R-Studio since others in the forums had reported success with R-Studio for Linux. R-Studio for Linux has an option to Create a Disk Image (select the byte-for-byte). To have sufficient space to store 4 500GB disk images we had to buy two external USB drives (1TB plus 2TB). In retrospect it would have been quicker to have created the disk images from within Windows. In the end it took a few days.
Mount LVM-based volumes from loopback full disk images
The above link had some great instructions for mounting the Logical Volume using my disk images.
Using fdisk I was able to find the sector where my LVM physical volume started on each disk:
Disk /dev/loop0: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc2d98e1c
Device Boot Start End Blocks Id System
/dev/loop0p1 2 4096001 2048000 83 Linux
/dev/loop0p2 4096002 4608001 256000 82 Linux swap / Solaris
/dev/loop0p3 4608002 976736305 486064152 5 Extended
/dev/loop0p5 4608003 976736305 486064151+ 8e Linux LVM
The starting sector is 4608003 and since my disks have 512 bytes per sector, 512 * 4608003 = 2359297536
I ran the following commands in Ubuntu 12.04 64-bit (replace your path with whatever the correct path is to your disk images):
#Install LVM2
sudo apt-get install lvm2
#Map the right offset location in each disk image to a /dev/loop device file using read-only mode
#I don't know if it's important but I ran these commands in disk sequence i.e. disk1.dsk first, disk2.dsk second, etc
sudo losetup -r -f "/media/FreeAgent GoFlex Drive/disk1.dsk" -o2359297536
sudo losetup -r -f "/media/GoFlex Home/disk2.dsk" -o2359297536
sudo losetup -r -f "/media/GoFlex Home/disk3.dsk" -o2359297536
sudo losetup -r -f "/media/GoFlex Home/disk4.dsk" -o2359297536
#See if Linux can now find 3 physical volumes (one drive is parity so we only see 3)
sudo lvm pvscan
This resulted in the following output showing 3 physical volumes have been found - success!
PV /dev/loop0 VG c lvm2 [463.50 GiB / 0 free]
PV /dev/loop2 VG c lvm2 [463.50 GiB / 0 free]
PV /dev/loop3 VG c lvm2 [463.53 GiB / 0 free]
Total: 3 [1.36 TiB] / in use: 3 [1.36 TiB] / in no VG: 0 [0 ]
Next I activated the LVM array:
sudo lvm vgchange -ay c
#Create a directory where the data will be accessible
mkdir tera
#Mount the Logical Volume to this directory
sudo mount -o ro /dev/mapper/c-c tera
After this, all the data was available intact within the "tera" directory and I was able to copy it off to a spare USB drive.
Here's some useful links
http://home.bott.ca/webserver/?p=306
Also tried the acmtn vmware image mentioned in this thread, but found it was very old and had trouble getting it to work with the disks
Caveats
My device is a Sparc device using X-RAID (not X-RAID2) and has 4KB block size, not 16KB like the newest models. Instructions may differ for other Readynas models. Here's a good place to look if you have a different model: http://home.bott.ca/webserver/?p=306
Dead-ends
I tried Reclaime software which claimed to be able to automatically detect the correct RAID parameters. I initially thought I would need this because R-Studio requires a number of parameters before it can recover a RAID. I ran Reclaime in RAID 0 mode and also RAID 5 mode for several days and it was unable to determine the RAID parameters for my X6. In the end it turned out that all I needed was Ubuntu linux!
9 Replies
- mdgm-ntgrNETGEAR Employee Retired:) Nice writeup.
Are you able to mount the 2GB OS partition?
What are the contents of /var/spool/frontview and its sub-directories? - mdgm-ntgrNETGEAR Employee RetiredFrom your systems my suspicion is that you've run into an issue with some old firmware where the shutdown spool script is left behind leading to endless reboots. If this was the problem it could've been fixed remotely very quickly.
- mjw1Aspirant
mdgm wrote: :) Nice writeup.
Are you able to mount the 2GB OS partition?
What are the contents of /var/spool/frontview and its sub-directories?
Yes, I just tried and was able to mount the root partition using the disk1.dsk image and an offset of 1024 bytes. Here's the content below /var/spool/frontview:
ls -lR frontview/
frontview/:
total 12
-rw-r--r-- 1 98 98 89 Nov 8 2010 60_SERVICE_READYNASREMOTE
drwx------ 2 98 98 4096 Sep 2 2009 boot
drwx------ 2 98 98 4096 Aug 2 2009 shutdown
frontview/boot:
total 8
-rwx------ 1 98 98 1197 Mar 19 2007 00_UpdateVendorResource
-rwx------ 1 98 98 1942 Jul 13 2009 01_AddColdSpare
frontview/shutdown:
total 4
-rwx------ 1 98 98 3735 Jul 13 2009 080_Poweron
Does anything look amiss? - mdgm-ntgrNETGEAR Employee RetiredNo. Looks like I was wrong unfortunately.
- mjw1Aspirant
mdgm wrote: If this was the problem it could've been fixed remotely very quickly.
I was planning tomorrow to put all the disks back into the X6 do a factory reset, but if a jedi is willing to take a look at fixing remotely that would be fantastic. I'd rather not have to wipe and start again if it can be avoided. Please let me know. Thanks.
P.S. Here's some log files that I copied from disk1 of the X6. - Thanks for the write up.
It will come in very useful for many users. - mdgm-ntgrNETGEAR Employee RetiredYour disks look like they're quite old. Have you tried testing them using SeaTools?
Also have you run the memory test on the NAS a few times recently? If not, please do this. - mjw1AspirantI ran the memory test and that was fine. I'll try sea tools.
- mjw1AspirantI've created a new thread for the X6 troubleshooting to separate from the data recovery discussion.
Related Content
NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!