Friday, December 27, 2013

Setting up WD MyCloud with Crashplan

tl;dr skip to INSTRUCTIONS

Crashplan is a great backup solution: inexpensive, fast, easy to set up. I have it running under a multi-computer plan for a small home office which uses a NAS as a file server. It runs on each computer fine, but I wanted to also back up all the shared files on the NAS.

Additionally, we recently had a Buffalo TeraStation PRO failure, so I wanted our system to rely less on any one piece of hardware.

Enter the WD MyCloud. Cheap, fast, small, quiet. 4TB for $199 in Dec 2013. VERY easy to set up. Just plug it in. Seriously - if you don't need a lot of customization - this is how computer equipment should work.

Now to set it up took several hours and a lot of debugging. If you follow the instructions below though it should be quick. You can do this. You'll have a NAS accessable across your network which automatically backs itself up to Crashplan without any user intervention.

The instructions below cover ALL of the steps and hopefully don't require knowledge of Unix or Linux commands so feel free to skip if you know what you're doing. The indented items and blue links go into more detail. I used a PC, but instructions should be the same on a Mac though the tools used may be different.

Shoutouts to all who are linked, thank you for the help.

INSTRUCTIONS


  1. Plug the device in to power and your network
  2. Optional: Change the Device Name
    1. Load your device dashboard
    2. Click Settings and change Device Name and Device Description. Make sure to click Save.
  3. Enable SSH on your device & note the username and password given
  4. Log in to the MyCloud device using SSH (I like PuTTY, it is lightweight, free and has been around for 15 years). IMPORTANT: This voids your warranty. Proceed at your own risk.
    1. Download putty.exe from this site or wherever you can find it
    2. Run putty.exe from wherever you downloaded it and click "Session" in the "Category" browser on the left.
    3. Use your device IP address as the "Host Name (or IP address)" and click "Open" at the bottom
    4. If a Security Alert pops up, you can click yes to allow connection. This is YOUR server after all.
    5. Log-in by typing the username and password given on step 3 (Default is "root" and "welc0me" - yes, that's a zero)
  5. Your PuTTY screen should look like this:

  6. You may notice that at the end of the 3rd line, we are dealing with an armv71 processor, not an Intel. When we install crashplan in the next step we will have to modify a file to make it able to communicate with the ARM processor.
  7. IMPORTANT Install Java first (trust me - see this)
    1. First we need to update apt-get: sudo apt-get update
    2. Install JRE headless: sudo apt-get install openjdk-6-jre-headless
    3. The following may be optional, I have not tested without them:
    4. Get the java version for our OS: sudo apt-get install libjna-java
    5. Install the Java Runtime Environment (JRE) sudo apt-get install default-jre
  8. Install Crashplan using these instructions. 
    1. Using my windows machine, I downloaded the installer and then copied to a new folder called "tmp" I created in the Public folder on the MyCloud device
    2. Then in the PuTTY session from step 4 use the following commands to unzip and run the installer:
      1. cd /shares/Public/tmp
      2. tar zxvf CrashPlan_3.5.3_Linux.tgz
        1. This line may be slightly different depending on the filename of the Crashplan download, just change the part after "tar zxvf" to the filename you downloaded
      3. cd CrashPlan-install
      4. sudo ./install.sh
  9. Follow all the prompts for the Crashplan install. Accept the defaults. If you don't, you probably know what you're doing - just change the below instructions to point to the locations you installed the files. If it asked to install java, cancel and go back to step 7.
    1. The installer ends by saying the service is started, but if you check the status, after a few seconds it will not be running. We need to fix one file to work with the ARM processor.
      1. To check the status, run: /etc/init.d/crashplan status
  10. First, let's increase the number of files the Crashplan client will watch (while you remember how to log in to the MyCloud!). Follow these directions (section 3.2) - copied below.
    1. To see # of watches: cat /proc/sys/fs/inotify/max_user_watches
    2. To change the # of watches, run the following:
      1. sudo echo 1048576 > /proc/sys/fs/inotify/max_user_watches
      2. sudo nano /etc/sysctl.conf
      3. Then once the editor opens, add this to the end of the file:
      4. # Set up inotify kernel module to keep watch on up to 1M files
        fs.inotify.max_user_watches=1048576
  11. Then we need to patch the crashplan files as in step 2 of this tutorial, with some minor changes.
    1. Modify the crashplan launcher script to point to the new java version
      1. nano /usr/local/crashplan/bin/CrashPlanEngine
      2. Change the line starting with FULL_CP to:
        1. FULL_CP="/usr/share/java/jna.jar:$TARGETDIR/lib/com.backup42.desktop.jar:$TARGETDIR/lang"
  12. Now we need to change the libjtux.so file to a version that will work with the ARM processor. We will need to download it, fix it and build and compile it. This is the hard part. 
    1. Rename original libjtux.so file to get it out of the way
      1. mv /usr/local/crashplan/libjtux.so /usr/local/crashplan/libjtux.so.intel
    2. You can skip all of the following by downloading the file from here and replacing the original one.
      1. cd /shares/Public/tmp/
      2. wget https://dl.dropboxusercontent.com/u/21924000/libjtux.so
      3. cp /shares/Public/tmp/libjtux.so /usr/local/crashplan/libjtux.so
    3. If you'd rather compile from scratch (maybe the above doesn't work), then follow these directions:
      1. Download the jtux package to your tmp directory on the share and unzip it:
        1. cd /shares/Public/tmp
        2. wget http://www.basepath.com/aup/jtux/jtux.tar.gz
          1. if  you can't find it there, just do a google search for jtux and paste the link after wget
        3. tar -zxvf jtux.tar.gz
        4. sudo apt-get install build-essentials, using any packages from here if they don't match the version that is needed. I had to use version 2.17-6. Install them using dpkg -i <package-name>
          1. To install, download to your drive and then unzip as you did with previous files. Then use dpkg -i on the .deb file that you get after unzipping. I'll go into more detail if there are a lot of questions on this.
        5. Follow the patch instructions here (don't forget the #include line!)
  13. Once you have the right version of libjtux.so in place, start the CrashPlanEngine
    1. /usr/local/crashplan/bin/CrashPlanEngine start
  14. Check to make sure it is running
    1. /etc/init.d/crashplan status
  15. Now follow these Directions for Configuring a Headless Client
  16. You should be good to go!! Hopefully you have a fast internet connection for the first upload. Good luck!