NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
Stanman130
Apr 03, 2014Guide
OS6 Data Recovery - How to Mount BTRFS Volumes
I recently purchased a ReadyNAS 314 and 5 Seagate ST2000VN000 hard disks (one as a cold spare). I work as a system administrator, so I've been reading up on OS6 before I entrust this new system with m...
Stanman130
Jul 20, 2014Guide
First OS6 Data Recovery Test
ReadyNAS 314 configuration
OS 6.1.6
Default configuration - one user created
Drives - 4 x Seagate ST2000NV000 disks - 2 Tb (on the approved hardware list)
Volume configuration - XRAID2 default - RAID 5 array for data partition (appears as MD127)
Approximately 17 Gb of data copied over - Debian Linux 7.4 AMD64 DVD ISO files (five files) verified with MD5
One user created - SMB used as the file share protocol
Recovery PC configuration
OS - Debian Linux 7.4 with all updates to 19 July 2014 - default install with Desktop, File Server and Base packages only
Added MDADM package using APT-GET (as described in the recommended directions above)
Volumes default but with separate partition for /home
OS name 3.2.0-4-amd64
Kernel 3.2.60-1+deb7u1
Motherboard Gigabyte GA-Z77X-UP5TH
i5 CPU 3570
8 Gb RAM
6 SATA ports
Port 0 - Plextor DVD drive
Port 1 - Seagate ST3808110AS - 80 Gb SATA drive for OS install
Port 2 - Drive 1 from ReadyNAS
Port 3 - Drive 2 from ReadyNAS
Port 4 - Drive 3 from ReadyNAS
Port 5 - Drive 4 from ReadyNAS
BIOS set to AHCI and "Legacy" mode (meaning non-UEFI)
Recovering the data at the command line
Followed the above guide shown above (all commands executed as root at the command line):
apt-get update (updates packages and kernel to latest online version)
apt-get install mdadm (RAID volume manager package)
mdadm --assemble --scan (finds and connects the RAID arrays as /dev/md0, /dev/md1, /dev/md127)
cat /proc/mdstat (shows the connected arrays and their properties - shows if the above command worked)
mount -t btrfs -o ro /dev/md127 /mnt (mounts the data volume at /mnt and allows access)
NOTE: I found that the correct name for the btrfs utilities is actually "btrfs-tools", but I didn't install or use any of them.
Data recovery
Once the volume was mounted, I was able to move to the /mnt/Documents folder where the test ISO files were stored. The files were moved to the folder /home/<username>/recov. The files were checked again by generating an MD5 sum and checking it against the official MD5 sum in the distro. The MD5 signature matched showing that the data was not corrupted. This was only 17 Gb of test data, but it was just a proof of concept.
Final Thoughts
This was a lot easier than I thought it would be. One important thing is to use a recent distro with kernel 3.x and BTRFS support. The 7 series of Debian Linux has BTRFS support built in and appears to be able to recognize XRAID2 RAID5 volumes and mount them without special settings. There is a package called "btrfs-tools" with testing and repair tools, but I didn't use them at all. It's easier if the motherboard has at least 5 or 6 SATA ports, but it could be done with just 4 if you would be willing to boot to a USB stick or use a net boot.
Please post here if you have questions or need more information. I'm kind of a Linux newbie, but I'll help as much as I can.
CAUTION: FlexRAID with RAID 6 DOES NOT WORK USING THIS METHOD
After the above test, I changed the configuration on the ReadyNAS to FlexRAID with all the disks in a RAID 6 array. This erased all the data, but no other configuration changes were made. I set up an SMB share named "test" and copied the exact same data to the folder and verified the MD5 sums. I pulled the drives and tried to recover the data use the exact same configuration and attempted to mount the volumes, but it didn't work using the method shown above. I'm still testing, but there might be some issues with RAID 6. FlexRAID seems to change the configuration to one RAID 1 OS volume and one RAID 6 data volume. The OS volume mounts using the above method, but the data array won't mount up. I'll do some more testing and try to fix it. If I can't get it to work, I'll update to Debian 7.6.x to see if the updated version might have better support.
If anyone has any ideas about mounting this, please let me know. The error message says that it can't identify the type of the file system and thinks it might be a swap file. Auto type doesn't work and setting the type to BTRFS fails with that error message.
More later when I have more time. Sorry for the long delay in following up on the original post, but I'm working crazy hours these days.
Stan
ReadyNAS 314 configuration
OS 6.1.6
Default configuration - one user created
Drives - 4 x Seagate ST2000NV000 disks - 2 Tb (on the approved hardware list)
Volume configuration - XRAID2 default - RAID 5 array for data partition (appears as MD127)
Approximately 17 Gb of data copied over - Debian Linux 7.4 AMD64 DVD ISO files (five files) verified with MD5
One user created - SMB used as the file share protocol
Recovery PC configuration
OS - Debian Linux 7.4 with all updates to 19 July 2014 - default install with Desktop, File Server and Base packages only
Added MDADM package using APT-GET (as described in the recommended directions above)
Volumes default but with separate partition for /home
OS name 3.2.0-4-amd64
Kernel 3.2.60-1+deb7u1
Motherboard Gigabyte GA-Z77X-UP5TH
i5 CPU 3570
8 Gb RAM
6 SATA ports
Port 0 - Plextor DVD drive
Port 1 - Seagate ST3808110AS - 80 Gb SATA drive for OS install
Port 2 - Drive 1 from ReadyNAS
Port 3 - Drive 2 from ReadyNAS
Port 4 - Drive 3 from ReadyNAS
Port 5 - Drive 4 from ReadyNAS
BIOS set to AHCI and "Legacy" mode (meaning non-UEFI)
Recovering the data at the command line
Followed the above guide shown above (all commands executed as root at the command line):
apt-get update (updates packages and kernel to latest online version)
apt-get install mdadm (RAID volume manager package)
mdadm --assemble --scan (finds and connects the RAID arrays as /dev/md0, /dev/md1, /dev/md127)
cat /proc/mdstat (shows the connected arrays and their properties - shows if the above command worked)
mount -t btrfs -o ro /dev/md127 /mnt (mounts the data volume at /mnt and allows access)
NOTE: I found that the correct name for the btrfs utilities is actually "btrfs-tools", but I didn't install or use any of them.
Data recovery
Once the volume was mounted, I was able to move to the /mnt/Documents folder where the test ISO files were stored. The files were moved to the folder /home/<username>/recov. The files were checked again by generating an MD5 sum and checking it against the official MD5 sum in the distro. The MD5 signature matched showing that the data was not corrupted. This was only 17 Gb of test data, but it was just a proof of concept.
Final Thoughts
This was a lot easier than I thought it would be. One important thing is to use a recent distro with kernel 3.x and BTRFS support. The 7 series of Debian Linux has BTRFS support built in and appears to be able to recognize XRAID2 RAID5 volumes and mount them without special settings. There is a package called "btrfs-tools" with testing and repair tools, but I didn't use them at all. It's easier if the motherboard has at least 5 or 6 SATA ports, but it could be done with just 4 if you would be willing to boot to a USB stick or use a net boot.
Please post here if you have questions or need more information. I'm kind of a Linux newbie, but I'll help as much as I can.
CAUTION: FlexRAID with RAID 6 DOES NOT WORK USING THIS METHOD
After the above test, I changed the configuration on the ReadyNAS to FlexRAID with all the disks in a RAID 6 array. This erased all the data, but no other configuration changes were made. I set up an SMB share named "test" and copied the exact same data to the folder and verified the MD5 sums. I pulled the drives and tried to recover the data use the exact same configuration and attempted to mount the volumes, but it didn't work using the method shown above. I'm still testing, but there might be some issues with RAID 6. FlexRAID seems to change the configuration to one RAID 1 OS volume and one RAID 6 data volume. The OS volume mounts using the above method, but the data array won't mount up. I'll do some more testing and try to fix it. If I can't get it to work, I'll update to Debian 7.6.x to see if the updated version might have better support.
If anyone has any ideas about mounting this, please let me know. The error message says that it can't identify the type of the file system and thinks it might be a swap file. Auto type doesn't work and setting the type to BTRFS fails with that error message.
More later when I have more time. Sorry for the long delay in following up on the original post, but I'm working crazy hours these days.
Stan
Related Content
NETGEAR Academy

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