Martin Aspeli
Dabbler
- Joined
- Jan 13, 2016
- Messages
- 29
There are a lot of threads about CrashPlan, and it's kind of a pain to set up, but once you have it, it's very good. I recently got it to work, and here are my notes.
First, some background:
Then symlink the bash binary to /bin/bash (this is used by a CrashPlan upgrade script):
We then need to enable SSH in the jail, and create a user that can be used to SSH in. This is to enable us to do port forwarding later:
Set up some sensible values for the crashplan user. You need to know the password so you can use it when you SSH in (unless you want to set up key based access).
We're now going to upgrade CrashPlan in-place from the version installed by the FreeNAS plugin, to the same version as the client version (4.5.2). These steps worked for me, but clearly may not work forever with different versions of CrashPlan, so take precaution. If it all goes wrong, you can always blow away the plugin jail and try again.
At this point, there should be a file in "/var/lib/crashplan/.ui_info" inside the crashplan_1 jail. You will need values from this, so print it to the console and copy it somewhere safe:
Here's how mine looks (almost...):
There are three bits of information here, separated by commas: a port (4243), a GUID string (the long middle one), and the IP address where CrashPlan is running.
Note that this file is a bit prone to getting over-written by the CrashPlan GUI, so keep a copy of it in case you need to re-create it.
In this example, the crashplan_1 jail is running on a local network where it has the hostname crashplan_1. If that's not the case, substitute the correct hostname or IP address. We're starting SSH in non-interactive mode here, so you'll see some logging messages, but not console.
Martin
First, some background:
- CrashPlan is a backup service, which offers unlimited cloud storage as well as peer-to-peer models. In this scenario, I wanted to send the photos and documents stored on my FreeNAS to the CrashPlan cloud storage and keep them backed up.
- CrashPlan does not support "headless" installation. However, it's a Java app and it uses a client/server architecture even when installed locally, so you can trick it into running the client (which you use to set up what gets backed up, manage your account, etc) on your local machine (a Mac in my case), and the server somewhere else (the FreeNAS in my case).
- FreeNAS 9.x ships with a CrashPlan plugin. It works, but it's a really old version, and you'll get into trouble because you're likely to have a newer local client version for the UI and the two will get confused.
- CrashPlan will automatically update itself, but this is something of a black art and may not work if client and server are too far out of sync.
- Install CrashPlan locally, but do not start it yet. If the installer starts it, shut it down. I'm using the Mac version, 4.5.2. This should work on Windows and Linux too, but some of the file paths for the local machine will be different.
- Install the CrashPlan plugin via the FreeNAS admin GUI. This will create a new plugin jail called crashplan_1 (at least if this is the first time you're doing it)
- After installation, find it in the tree on the left, click on it, and accept the Java license terms.
- Make sure the plugin is started in the FreeNAS admin GUI plugin settings.
- Use the Jails -> Storage tab to mount some storage in the crashplan_1 jail. This needs to encompass everything you want to eventually back up. You probably want to mount it as read-only.
- Log into the FreeNAS terminal (ssh or the web console) as root (or a sudo-capable user). We now need to do a number of things in the Jail:
Code:
$ jexec crashplan_1 /bin/tcsh
Then symlink the bash binary to /bin/bash (this is used by a CrashPlan upgrade script):
Code:
$ ln -s /usr/bin/bash /bin/bash
We then need to enable SSH in the jail, and create a user that can be used to SSH in. This is to enable us to do port forwarding later:
Code:
$ sysrc sshd_enable=YES $ service sshd start $ adduser crashplan
Set up some sensible values for the crashplan user. You need to know the password so you can use it when you SSH in (unless you want to set up key based access).
We're now going to upgrade CrashPlan in-place from the version installed by the FreeNAS plugin, to the same version as the client version (4.5.2). These steps worked for me, but clearly may not work forever with different versions of CrashPlan, so take precaution. If it all goes wrong, you can always blow away the plugin jail and try again.
Code:
$ cd /usr/pbi/crashplan-amd64/share/crashplan $ wget --no-check-certificate http://download.code42.com/installs/linux/install/CrashPlan/CrashPlan_4.5.2_Linux.tgz $ tar -xf CrashPlan_4.5.2_Linux.tgz $ cd crashplan-install $ cpio -idv < CrashPlan_4.5.0.cpi $ service crashplan stop $ cd .. $ rm -r lib* $ cp -r crashplan-install/lib* . $ service crashplan start
At this point, there should be a file in "/var/lib/crashplan/.ui_info" inside the crashplan_1 jail. You will need values from this, so print it to the console and copy it somewhere safe:
Here's how mine looks (almost...):
Code:
$ cat /var/lib/crashplan/.ui_info 4243,9a413ec1-1250-43c4-85cb-2fee5ab0cd12,127.0.0.1
There are three bits of information here, separated by commas: a port (4243), a GUID string (the long middle one), and the IP address where CrashPlan is running.
- We now need to go back to the Mac and trick the client app into using the server on the FreeNAS. We're going to do this by (a) using SSH port forwarding so that port 4243 (the CrahsPlan port) in the crashplan_1 jail will be forwarded to port 4200 on the local machine; and (b) change the file the CrashPlan GUI uses to look up the port and GUID of the CrashPlan server.
- You'll need to edit the file "/Library/Application Support/CrashPlan/.ui_info" on the Mac so that it uses port 4200 and the GUID string. Here's an example:
Code:
$ cat /Library/Application\ Support/CrashPlan/.ui_info 4200,9a413ec1-1250-43c4-85cb-2fee5ab0cd12,127.0.0.1
Note that this file is a bit prone to getting over-written by the CrashPlan GUI, so keep a copy of it in case you need to re-create it.
- You also need to edit "/Library/Application Support/CrashPlan/ui_<username>.properties", where <username> is your Mac username, to add or modify a "port=4200" line:
Code:
# other stuff, then add: port=4200
- Now start the SSH tunnel from the Mac:
Code:
ssh -L 4200:localhost:4243 crashplan@crashplan_1 -Nv
In this example, the crashplan_1 jail is running on a local network where it has the hostname crashplan_1. If that's not the case, substitute the correct hostname or IP address. We're starting SSH in non-interactive mode here, so you'll see some logging messages, but not console.
- Finally (!) start up the CrashPlan GUI on the Mac. It should now connect to localhost port 4200, which will forward to crashplan_1 port 4243, and let you log in and start to manage your backup. The key thing here is that when you are choosing files to back up, you're actually browsing directories in the FreeNAS crashplanj_1 jail, not your local machine. If you mounted the relevant storage, you should be able to choose whatever you want to back up.
- Once you're done, you can shut down the CrashPlan GUI and terminate the SSH tunnel (Ctrl+C).
- If you need to access the GUI again, you need to start the SSH tunnel once more before opening it. If you're getting errors (or asked to set up an account again), it's probably because either the SSH tunnel isn't running, or the .ui_info file has gotten reset on the Mac, in which case you need to edit it again to have the right port and access key before starting the GUI.
Martin