thanks to some great info on the internet (see links) I managed to get CrashPlan running in a FreeNAS 9.1 Jail.
I documented my steps below, I wanted to clean it up some more but I leave on holiday tomorrow and wanted to post this already..
The whole concept of jails is new to me so it's quite possible that there's a better or faster way to get it done.
If so, comments with tips are appreciated!
I currently only tested it on a 32bit system as my old server is 32bit..
Install CrashPlan in FreeNAS 9.1 Jail
real-time backup will not happen because inotify isn’t supported yet:
https://wiki.freebsd.org/linux-kernel
You can however run CrashPlan and force a verify every time you need to run a backup..
links
Full install guides, I couldn’t have done it without these:
http://worrbase.com/2012/03/31/Crashplan.html
http://www.1stbyte.com/2011/01/26/how-to-install-crashplan-on-freebsd/
http://blog.oddbit.com/post/installing-crashplan-under-freebsd-8
Various info
http://clicklog.org/article/274954428.html
https://crashplan.zendesk.com/entries/112498
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports.html
http://vocalbit.com/posts/freebsd-jails-using-zfs-and-bsdinstall.html
Install CrashPlan
first make sure you have a Disk added (check in WebGUI - Storage - Volumes - View Disks) and an Active Volume (check in WebGUI - Storage - Volumes - View Volumes)
if not, add one with WebGUI - Storage - Volumes - ZFS Volume Manager
enable SSH
WebGUI - Services - SSH
you also might want to enable “Login as Root with password” for now (click on the wrench key button)
create a folder on that Volume that will serve as root folder for our Jails
mkdir /mnt/mydata/jails
configure general Jail settings
WebGUI - Jail - Configuration - Jail Root
select /mnt/mydata/jails
create new Jail
WebGUI - Jails - Add Jails
click Advanced Mode
Jail Name: CrashPlan
IPv4 address: 192.168.1.111/24
autostart: checked
type: standard
VIMAGE: unchecked
NAT: checked
vanilla: checked
if you get an error about extraction failed, just click OK again and it should complete..
load linux module
(needed to install linux_base-f10 etc.. below)
kldload linux
check if linux.ko is loaded
kldstat | grep linux
check the JID of your Jail
jls
open the shell of your Jail with the JID
jexec 1 /bin/tcsh
now you’re in your Jail and we need to get a list of packages (in Jail)
portsnap fetch extract
if you get a message “... can't find either v4 or v6 networking ...” you might need to reboot FreeNAS
install the needed stuff (in Jail)
cd /usr/ports/emulators/linux_base-f10/
make install clean
cd /usr/ports/sysutils/linux-f10-procps/
make install clean
cd /usr/ports/java/linux-sun-jre16
make install clean
this will now tell you that you need to manually download the java bin file, it will also tell you which version, in my case it was jre-6u45-linux-i586.bin which I downloaded from:
http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html#jre-6u45-oth-JPR
if you downloaded it to your PC you need to transfer it to FreeNAS in the distfiles dir where the Jail can access it
/mnt/mydata/jails/CrashPlan/usr/ports/distfiles
then try to install again, this should work
cd /usr/ports/java/linux-sun-jre16
make install clean
optionally you can install nano, I prefer it over vi as I find it easier :)
watch out though as it takes quite a while
cd /usr/ports/editors/nano
make install clean
get linprocfs loaded (inFreeNAS)
create a script that will mount proc (mounting will automatically load the linprocfs.ko module):
mount -uw /
nano /conf/base/etc/rc.d/mountproc
add (make sure the command in mountproc_start is on 1 line):
#!/bin/sh
# PROVIDE mountproc
# REQUIRE LOGIN
. /etc/rc.subr
name=mountproc
rcvar=mountproc_enable
start_cmd="${name}_start"
stop_cmd="${name}_stop}"
mountproc_start () {
/sbin/mount -t linprocfs linproc /mnt/mydata/jails/CrashPlan/compat/linux/proc/
}
mountproc_stop() {
echo "--- mountproc stopped ---"
}
load_rc_config $name
run_rc_command "$1"
make it executable
chmod +x /conf/base/etc/rc.d/mountproc
enable the variable so the script runs at boot:
nano /conf/base/etc/rc.conf
add:
mountproc_enable=”YES”
edit rc.conf to load linux module at boot (in FreeNAS)
mount -uw /
nano /conf/base/etc/rc.conf
add:
linux_enable=”YES”
reboot FreeNAS
install CrashPlan Linux (in Jail)
download CrashPlan for Linux from their site and move the file (CrashPlan_3.5.3_Linux.tgz) to your FreeNAS in the compat/linux folder of your Jail (/mnt/mydata/jails/CrashPlan/compat/linux)
open the shell of your jail
jexec 1 /bin/tcsh
cd /compat/linux
tar -xzf CrashPlan_3.5.3_Linux.tgz
cd CrashPlan-install
/compat/linux/bin/bash /compat/linux/CrashPlan-install/install.sh
now CrashPlan is installed but it won’t run just yet..
edit CrashPlan run.conf
we need to edit /compat/linux/usr/local/crashplan/bin/run.conf
and add following text to the end of the SRV_JAVA_OPTS line (still in the “)
-Djava.nio.channels.spi.SelectorProvider=sun.nio.ch.PollSelectorProvider
select correct Java for CrashPlan (in Jail)
by default, CrashPlan uses /usr/local/bin/java
it seems to work fine but we can change that by the one we installed if we want...
nano /compat/linux/usr/local/crashplan/install.vars
change JAVACOMMON=”...” to JAVACOMMON=”/usr/local/linux-sun-jre1.6.0/bin/java”
if you switched to the Java we installed you need to load the linprocfs module on boot, it will automatically load when the mountproc script is started but will cause the crashplan script below to fail as the module is loaded too late.. (I need to check this..)
original Java works fine..
start CrashPlanEngine and check Status
you can start CrashPlanEngine now, this can be done from within or outside the Jail
within the Jail:
start:
/compat/linux/bin/bash /compat/linux/usr/local/crashplan/bin/CrashPlanEngine start
get status:
/compat/linux/bin/bash /compat/linux/usr/local/crashplan/bin/CrashPlanEngine status
outside the Jail:
start:
jexec 1 /compat/linux/bin/bash /compat/linux/usr/local/crashplan/bin/CrashPlanEngine status
get status:
jexec 1 /compat/linux/bin/bash /compat/linux/usr/local/crashplan/bin/CrashPlanEngine status
launch CrashPlan on jail boot
open the shell of your jail:
jexec 1 /bin/tcsh
now you’re in the shell of your jail, create a script that will start CrashPlan when your Jail is started:
nano /etc/rc.d/crashplan
add (make sure the command in crashplan_start & stop is on 1 line):
#!/bin/sh
# PROVIDE crashplan
# REQUIRE LOGIN
. /etc/rc.subr
name=crashplan
rcvar=crashplan_enable
start_cmd="${name}_start"
stop_cmd="${name}_stop}"
crashplan_start () {
/compat/linux/bin/bash /compat/linux/usr/local/crashplan/bin/CrashPlanEngine start
}
crashplan_stop() {
/compat/linux/bin/bash /compat/linux/usr/local/crashplan/bin/CrashPlanEngine stop
}
load_rc_config $name
run_rc_command "$1"
make it executable
chmod +x /etc/rc.d/crashplan
still in your jail, enable the variable so the script runs at jail startup:
nano /etc/rc.conf
add:
crashplan_enable=”YES”
remote CrashPlan GUI
official way from CrashPlan:
http://support.crashplan.com/doku.php/how_to/configure_a_headless_client
both FreeNAS and the PC running CrashPlan Desktop are on the same network so I only changed the ui.properties file on the PC running CrashPlan Desktop.
I changed serviceHost from serviceHost=127.0.0.1 to serviceHost=<ip of jail>
add storage to Jail
WebGUI - Jails - Plugin Jails - CrashPlan - Storage - Add Storage
Source: something on your FreeNAS
Destination: /compat/linux/mnt
now CrashPlan can access this data from /mnt/
adopt another computer with CrashPlan (troubleshooting)
Adopting Another Computer
http://support.crashplan.com/doku.php/recipe/adopting_another_computer
I Don't See the "Adopt" Option
https://helpdesk.crashplan.com/entries/23709627-I-Don-t-See-the-Adopt-Option
double-click CrashPlan icon in CrashPlan Desktop
type
guid new
press enter
Changes needed after upgrading from FreeNAS 9.1RC1 to 9.1RC2
the Jail remains intact, only changes made to:
/conf/base/etc/rc.conf
and
/conf/base/etc/rc.d/mountproc
need to be done again
I documented my steps below, I wanted to clean it up some more but I leave on holiday tomorrow and wanted to post this already..
The whole concept of jails is new to me so it's quite possible that there's a better or faster way to get it done.
If so, comments with tips are appreciated!
I currently only tested it on a 32bit system as my old server is 32bit..
Install CrashPlan in FreeNAS 9.1 Jail
real-time backup will not happen because inotify isn’t supported yet:
https://wiki.freebsd.org/linux-kernel
You can however run CrashPlan and force a verify every time you need to run a backup..
links
Full install guides, I couldn’t have done it without these:
http://worrbase.com/2012/03/31/Crashplan.html
http://www.1stbyte.com/2011/01/26/how-to-install-crashplan-on-freebsd/
http://blog.oddbit.com/post/installing-crashplan-under-freebsd-8
Various info
http://clicklog.org/article/274954428.html
https://crashplan.zendesk.com/entries/112498
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports.html
http://vocalbit.com/posts/freebsd-jails-using-zfs-and-bsdinstall.html
Install CrashPlan
first make sure you have a Disk added (check in WebGUI - Storage - Volumes - View Disks) and an Active Volume (check in WebGUI - Storage - Volumes - View Volumes)
if not, add one with WebGUI - Storage - Volumes - ZFS Volume Manager
enable SSH
WebGUI - Services - SSH
you also might want to enable “Login as Root with password” for now (click on the wrench key button)
create a folder on that Volume that will serve as root folder for our Jails
mkdir /mnt/mydata/jails
configure general Jail settings
WebGUI - Jail - Configuration - Jail Root
select /mnt/mydata/jails
create new Jail
WebGUI - Jails - Add Jails
click Advanced Mode
Jail Name: CrashPlan
IPv4 address: 192.168.1.111/24
autostart: checked
type: standard
VIMAGE: unchecked
NAT: checked
vanilla: checked
if you get an error about extraction failed, just click OK again and it should complete..
load linux module
(needed to install linux_base-f10 etc.. below)
kldload linux
check if linux.ko is loaded
kldstat | grep linux
check the JID of your Jail
jls
open the shell of your Jail with the JID
jexec 1 /bin/tcsh
now you’re in your Jail and we need to get a list of packages (in Jail)
portsnap fetch extract
if you get a message “... can't find either v4 or v6 networking ...” you might need to reboot FreeNAS
install the needed stuff (in Jail)
cd /usr/ports/emulators/linux_base-f10/
make install clean
cd /usr/ports/sysutils/linux-f10-procps/
make install clean
cd /usr/ports/java/linux-sun-jre16
make install clean
this will now tell you that you need to manually download the java bin file, it will also tell you which version, in my case it was jre-6u45-linux-i586.bin which I downloaded from:
http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html#jre-6u45-oth-JPR
if you downloaded it to your PC you need to transfer it to FreeNAS in the distfiles dir where the Jail can access it
/mnt/mydata/jails/CrashPlan/usr/ports/distfiles
then try to install again, this should work
cd /usr/ports/java/linux-sun-jre16
make install clean
optionally you can install nano, I prefer it over vi as I find it easier :)
watch out though as it takes quite a while
cd /usr/ports/editors/nano
make install clean
get linprocfs loaded (inFreeNAS)
create a script that will mount proc (mounting will automatically load the linprocfs.ko module):
mount -uw /
nano /conf/base/etc/rc.d/mountproc
add (make sure the command in mountproc_start is on 1 line):
#!/bin/sh
# PROVIDE mountproc
# REQUIRE LOGIN
. /etc/rc.subr
name=mountproc
rcvar=mountproc_enable
start_cmd="${name}_start"
stop_cmd="${name}_stop}"
mountproc_start () {
/sbin/mount -t linprocfs linproc /mnt/mydata/jails/CrashPlan/compat/linux/proc/
}
mountproc_stop() {
echo "--- mountproc stopped ---"
}
load_rc_config $name
run_rc_command "$1"
make it executable
chmod +x /conf/base/etc/rc.d/mountproc
enable the variable so the script runs at boot:
nano /conf/base/etc/rc.conf
add:
mountproc_enable=”YES”
edit rc.conf to load linux module at boot (in FreeNAS)
mount -uw /
nano /conf/base/etc/rc.conf
add:
linux_enable=”YES”
reboot FreeNAS
install CrashPlan Linux (in Jail)
download CrashPlan for Linux from their site and move the file (CrashPlan_3.5.3_Linux.tgz) to your FreeNAS in the compat/linux folder of your Jail (/mnt/mydata/jails/CrashPlan/compat/linux)
open the shell of your jail
jexec 1 /bin/tcsh
cd /compat/linux
tar -xzf CrashPlan_3.5.3_Linux.tgz
cd CrashPlan-install
/compat/linux/bin/bash /compat/linux/CrashPlan-install/install.sh
now CrashPlan is installed but it won’t run just yet..
edit CrashPlan run.conf
we need to edit /compat/linux/usr/local/crashplan/bin/run.conf
and add following text to the end of the SRV_JAVA_OPTS line (still in the “)
-Djava.nio.channels.spi.SelectorProvider=sun.nio.ch.PollSelectorProvider
select correct Java for CrashPlan (in Jail)
by default, CrashPlan uses /usr/local/bin/java
it seems to work fine but we can change that by the one we installed if we want...
nano /compat/linux/usr/local/crashplan/install.vars
change JAVACOMMON=”...” to JAVACOMMON=”/usr/local/linux-sun-jre1.6.0/bin/java”
if you switched to the Java we installed you need to load the linprocfs module on boot, it will automatically load when the mountproc script is started but will cause the crashplan script below to fail as the module is loaded too late.. (I need to check this..)
original Java works fine..
start CrashPlanEngine and check Status
you can start CrashPlanEngine now, this can be done from within or outside the Jail
within the Jail:
start:
/compat/linux/bin/bash /compat/linux/usr/local/crashplan/bin/CrashPlanEngine start
get status:
/compat/linux/bin/bash /compat/linux/usr/local/crashplan/bin/CrashPlanEngine status
outside the Jail:
start:
jexec 1 /compat/linux/bin/bash /compat/linux/usr/local/crashplan/bin/CrashPlanEngine status
get status:
jexec 1 /compat/linux/bin/bash /compat/linux/usr/local/crashplan/bin/CrashPlanEngine status
launch CrashPlan on jail boot
open the shell of your jail:
jexec 1 /bin/tcsh
now you’re in the shell of your jail, create a script that will start CrashPlan when your Jail is started:
nano /etc/rc.d/crashplan
add (make sure the command in crashplan_start & stop is on 1 line):
#!/bin/sh
# PROVIDE crashplan
# REQUIRE LOGIN
. /etc/rc.subr
name=crashplan
rcvar=crashplan_enable
start_cmd="${name}_start"
stop_cmd="${name}_stop}"
crashplan_start () {
/compat/linux/bin/bash /compat/linux/usr/local/crashplan/bin/CrashPlanEngine start
}
crashplan_stop() {
/compat/linux/bin/bash /compat/linux/usr/local/crashplan/bin/CrashPlanEngine stop
}
load_rc_config $name
run_rc_command "$1"
make it executable
chmod +x /etc/rc.d/crashplan
still in your jail, enable the variable so the script runs at jail startup:
nano /etc/rc.conf
add:
crashplan_enable=”YES”
remote CrashPlan GUI
official way from CrashPlan:
http://support.crashplan.com/doku.php/how_to/configure_a_headless_client
both FreeNAS and the PC running CrashPlan Desktop are on the same network so I only changed the ui.properties file on the PC running CrashPlan Desktop.
I changed serviceHost from serviceHost=127.0.0.1 to serviceHost=<ip of jail>
add storage to Jail
WebGUI - Jails - Plugin Jails - CrashPlan - Storage - Add Storage
Source: something on your FreeNAS
Destination: /compat/linux/mnt
now CrashPlan can access this data from /mnt/
adopt another computer with CrashPlan (troubleshooting)
Adopting Another Computer
http://support.crashplan.com/doku.php/recipe/adopting_another_computer
I Don't See the "Adopt" Option
https://helpdesk.crashplan.com/entries/23709627-I-Don-t-See-the-Adopt-Option
double-click CrashPlan icon in CrashPlan Desktop
type
guid new
press enter
Changes needed after upgrading from FreeNAS 9.1RC1 to 9.1RC2
the Jail remains intact, only changes made to:
/conf/base/etc/rc.conf
and
/conf/base/etc/rc.d/mountproc
need to be done again