Installing CrashPlan on my QNAP TS-210 NAS in headless mode means that I have an instant online backup of all of my archive data stored on my NAS drive. CrashPlan keeps revision history of all my files, allowing me to recover my NAS to a state at any date should I lose data or overwrite something.
I have for a while now been looking for a solution for backing up my important files and photos online. After much research and testing various backup providers I found that CrashPlan offered the best value vs quality of service.
Crashplan provides both a Windows and a Linux service that can be used to backup files, in particular interest is that the service can be run in a 'headless' mode whereby the service can be run on a linux box and administered from a windows desktop client.
I currently use a QNAP TS-210 NAS box to backup all of my data and my ideal setup is to keep this in place and automatically backup everything on it to the internet.
On a standard Linux box this setup is simple and straight-forward, unfortunately things on the QNAP are not so straight forward because it uses a Kirkwood Marvel Atom processor that the java jre that crashplan uses does not directly support.
I have used a number of resources in order to achieve my working setup, these acknowledgements are given at the bottom of this post.
The main problem in running the CrashPlan engine on the QNAP is that the java runtime that it installs fails to start the service correctly, reporting an error in the engine_error.log file. To try and rectify this I removed and reinstalled CrashPlan without installing the bundled java environment. I chose to manually install the java sdk using ipkg. This enabled the service to start but it immediately stopped with an invalid jtux error in the engine_output.log file. Google searching revealed that this meant that the java jtux library needs to be recompiled on the QNAP itself in order to generate a working jtux library file. After multiple attempts I found that I could not re-build this library on the QNAP firmware as the required packages could not be installed (or I simply couldn't find the correct combination of packages to install).
Debian Squeeze on the QNAP
I came across an interesting article that detailed how to install Debian on the QNAP and decided I would give this route a try in order to achieve what I wanted. This proved the correct choice. I followed this article in order to install Debain which went quite smoothly. The main steps for this were:
First create backups of the QNAP flash blocks:
cat /dev/mtdblock0 > mtd0
cat /dev/mtdblock1 > mtd1
cat /dev/mtdblock2 > mtd2
cat /dev/mtdblock3 > mtd3
cat /dev/mtdblock4 > mtd4
cat /dev/mtdblock5 > mtd5
Download the flash installer:
busybox wget ftp://ftp.debian.org/debian/dists/testing/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-219/initrd.gz
busybox wget ftp://ftp.debian.org/debian/dists/testing/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-219/kernel
busybox wget ftp://ftp.debian.org/debian/dists/testing/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-219/flash-debian
busybox wget ftp://ftp.debian.org/debian/dists/testing/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-219/model
Run the flash installer, this will load the installer into flash so that upon the next reboot it will load the Debian installer:
This will display something similar to:
Updating MAC address...
Your MAC address is XX:XX:XX:XX:XX:XX
Writing debian-installer to flash... done.
Please reboot your QNAP device.
Reboot your NAS box. The NAS will start to boot and the status led will flash red/green for a short while before turning solid green and then it will give a short beep to indicate it is ready.
Debian Installer Setup
As the NAS doesn't have a display you need to SSH into the installer. If the NAS was setup before with a static IP it is likely this IP will still be used, if not it may have booted from DHCP. Login to SSH with the username: installer and the password: install.
Follow the installer GUI to setup the NAS box as required. The Installer Guide may help with the options available. I setup RAID0 to maximise my available disk space and otherwise used quite standard setup options. If I re-install the box again I will further detail these setup pages. For disk partitioning I used the 'Guided Partitioning' option and chose to use the entire disk (without LVM) and to basic partition split. After this I setup RAID0 choosing the two large partitions to RAID.
Setup your Debian installation as required, I setup Apache, MySQL, and Samba to start with. Format your RAID partition using mke2fs and mount it by adding it to /etc/fstab.
Installed required packages in order to get crashplan working.
apt-get install openjdk-6-jdk
apt-get install make
apt-get install gcc
apt-get install libjna-java
tar xfz CrashPlan_3.0.1_Linux.tgz
Choose default paths for installation but choose NOT to install the embedded java runtime.
Download the jtux patch file from this discussion post.
tar zxfv jtux.tar.gz
Copy jtux.PS3-YDL6.1.patch.txt into jtux path
Set JAVA_INCLUDE = /usr/lib/jvm/java-6-openjdk/include
I have now attached my compiled version of the jtux library: libjtux.so
Backup existing crashplan jtux library:
cp /usr/local/crashplan/libjtux.so /usr/local/crashplan/libjtux.so.bak
Copy new file in:
cp libjtux.so /usr/local/crashplan/
Replace line starting with FULL_CP:
Start CrashPlan Engine:
At this point your CrashPlan engine should be starting, check its status with ./CrashPlanEngine status
Be patient though, it may take a few minutes for the service to come up fully. Check whether it is listening with: netstat -na | grep 4243 and see if any ports are open, once they are you should be able to connect using the CrashPlan desktop client.
Configure your desktop client as per the guide on the CrashPlan support site: Configuring a Headless Client. I used Putty to SSH into the box, creating a tunnel and then connected using the client software.
You should now be able to login and setup backups as normal.
I selected my raid disk directory for backup and left it to upload my entire backup storage to the cloud!
If I have time I want to perform some further tests in order to see if I could have re-compiled the jtux library on the QNAP firmware without installing Debian and also I would like to provide some more detail (for my own reference as much as anything) on how the RAID partitions were setup.
Although not tested, I believe this method will work for any Marvel cpu device, including the QNAP TS-110, QNAP TS-119, QNAP TS-119P+, QNAP TS-210, QNAP TS-219, QNAP TS-219P QNAP TS-219P+, Sheevaplug and ReadyNAS equivalents. Please let me know if you have installed on any of these or any other devices.