Tuesday, October 29, 2013

Mounting Sparc-based ReadyNAS Drives on a Raspberry Pi

dbott at http://home.bott.ca/webserver/?p=306 gives a simple process for mounting ReadyNAS disks on a Linux box. Unfortunately, that Linux box is presumed to be a Debian Linux PC with at least a few spare disk trays.

In my case, my ReadyNAS NV+ stalled and wouldn't reboot. I installed the latest firmware (4.1.12) a couple of days ago and I am thus suspicious about the cause of the stalling...

However it was obvious from the way the boot process happened that the disks were OK. The NV+ simply refused to read them. I was fed up. A similar event happened just over a year ago and I am tired of this potentially complete loss of data. In the light of my experience last year I at least had a full backup on my old Drobo 1 but the backup itself took so long I was only running it monthly.

I googled for info about reading ReadyNAS Sparc disks and found the above link. I don't have a spare Linux box sitting around. I do, however, have a Raspberry Pi which was running my backups to the Drobo and was thus doing nothing.

Courtesy of dbott's notes, I realised I had to install fuse-ext2 and lvm2 on the RPi in order to read the disks. I used apt-get to install lvm2 but there didn't seem to be a .deb package for fuse-ext2.

I googled once more and found this:
http://loveraspberrypi.blogspot.com.au/2013/07/modify-raspberian-image-file-on-mac-osx.html which is actually the reverse of what I want. I want to read an ext2 disk on an RPi. This article tells how to read an RPi SD card on a Mac. However it contains the critical link to the fuse-ext2 source:
http://alperakcan.net/?open=projects&project=fuse-ext2. And then I had to install the GNU devel toolchain (apt-get install autoconf automake libtool libfuse-dev ext2fs-dev).

Finally the configure/make/install process succeeded and I thought I had plain sailing from there. I put disk 1 from the NV+ into a USB docking station and connected it to the RPi via a powered USB hub connected to one of the USB ports. Then I followed dbott's instructions. Unfortunately vgscan told me there were two disks missing from the set. Which was correct of course. I needed at least three of the four disks from the NV+ to make the virtual volume.

After a hasty visit to my local computer parts shop, I installed the remaining two disks using SATA to USB cables connected to the hub and was delighted to run vgscan and see the three disks.

Finally I ran
fuse-ext2 -o ro -o sync_read /dev/c/c /mnt/media
and was delighted to see the "unreadable" volume fully accessible with all my files listed.

In my disgust :) I went out and bought a ReadyNAS RN104. I'm quite happy with the Netgear hardware. I just hate their crappy (firm|soft)ware. So I'm hopeful that the latest firmware (OS6) will be a bit more stable than that on the NV+. I'm currently letting the RN104 format some disks and then I hope to be able to transfer all the files from the USB disks to the RN104. I'll add an update if/when it completes.

Update: Initially I tried a simple 'cp -r' from the llvm filesystem on the RPi to the RN104 filesystem. It stalled. So, realising that there was quite a high probability of the copy stalling again, I'm using rsync because it can pick up where it stopped if the llvm volume disappears, which for some reason, it seems to do occasionally. (Actually I suspect the cause of the stalling is the WD Green disks spinning down to "save power" and then not recovering quick enough when they are needed. This might also have caused the NV+ problems. Not sure how to verify this. The WD Greens are definitely not on the recommended list for the RN104.) I'm about 1/3rd through the data transfer and am listening to some of my music from the new server so it looks like I'll be able to pick up without data loss. Phew! what a relief!

Update2: I finally discovered that one of the power packs for the SATA to USB cables was faulty. Actually, the pack was OK. But two of the connecting cables were faulty. What can I expect for $20? Anyway, I swapped the mains cable and fixed the moving pin in the 12v/5v connector. And the uploads have been much more stable since. But the RPi still occasionally stalls. And I have to pull the power plug to restart the RPi and twice the SD card was corrupted. I had to re-copy the image to the SD card using dd. Restore still not completed but the most important files have copied.

No comments: