Jump to content

Retrospect client on FreeBSD

Recommended Posts

For anyone interested, I've been playing around with using FreeBSD's Linux emulation to run Retrospect Client and would like to share some results and compare notes. While it's officially unsupported by Retrospect Inc, it's proven to be a useful exercise.


Over the short term, I'll try to start using Retrospect to do file-based backups of my jail snapshots, using a single instance of Retrospect Client sitting on the jail host. Each jail has its own ZFS dataset, allowing for snapshots and portability. The jail can be easily shut down, snapshotted while offline, and brought back online within a few seconds. The Retrospect incremental backup can run against the snapshot (assuming a consistent naming convention) without having to contend with live databases or active processes.



This is officially unsupported. It might break things. The following setup is only slightly tested.


Bare-metal restore is likely going to be impossible. Even regular restore might be impossible.


The Retrospect Client has problems parsing the mtab file. Use only single spaces when building the file.


Tests inside a Jail indicate that the Retrospect client crashes when it tries to use the multicast address, though it might be possible to work around this by enabling raw sockets.


No effort has been made to get the GUI running. Being Java-based, it might be possible to do with sufficient mangling of the scripts.


ACLs and Case Sensitivity? Completely untested.


Before Installing:

- Download a copy of the Linux client (7.7.100 as of current writing)

- FreeBSD 9.1 host

- Retrospect 10 with Multi-Server license


Dependency Installation:

Begin by installing and enabling Linux support. Add the following to /etc/rc.conf:



Ensure that the Linux support module is loaded:

kldload linux


Install the Linux support libraries:

portinstall emulators/linux_base-f10


Retrospect Client Installation:

Extract the Retrospect installer, then extract its contents, then move the client into a FreeBSD'ish location:

mkdir -p ~/rs-installer/client
curl -O http://download.retrospect.com/archives/linux_client-7_7_100.tar
tar xvf linux_client-7_7_100.tar -C ~/rs-installer
tar xvf RCL.tar -C ~/rs-installer/client
mkdir /usr/local/retrospect
mv ~/rs-installer/client /usr/local/retrospect/client


To simplify life, a minimal init script can be used to start/stop/restart the Retrospect Client. Place the following into /usr/local/etc/rc.d/retroclient:


. /etc/rc.subr



load_rc_config $name
run_rc_command "$1"


Mark the script as executable:

chmod +x /usr/local/etc/rc.d/retroclient


Retrospect Client Configuration:

Configure the client's connection password:

cd /usr/local/retrospect/client
./retroclient -setpass


At this point, it is safe to launch the client and register it with the Retrospect Server. No filesystems have been configured at this point, so nothing will show up. This is still a good point for a test, as there are fewer things to go wrong. Launch the retrospect client, and add it to the server:

./retroclient -debuglevel 9


The client can be shut down with Control-C, and state/output will be stored in /var/log/retroclient.state alongside the log files.


Configure Available Volumes:

The Linux compatibility layer has its own list of mounted filesystems in /compat/linux/etc/mtab. This file must be managed manually. It is important to note that Retrospect's mtab parser seems to have some issues with handling whitespace, though these are easily worked around. This may be an issue to do with FreeBSD's library functions, or it may be due to strict adherence to the specification. In any case, it is imperative that there is only one space between each field.


As a starting point, you can dump a list of the mounted filesystems in a user-friendly format:

mount -p


This can be automatically transformed into the required format by piping through sed to replace any occurrence of whitespace (including tabs) with a single space:

mount -p | sed -E 's/[[:space:]]+/ /g'


An example entry in /compat/linux/etc/mtab would be:

tank/retro-test /tank/retro-test zfs rw,nfsv4acls 0 0


As an added bonus, it is possible to access ZFS snapshots directly through the filesystem under the dataset's .zfs directory. These can be added directly to the mtab, allowing for backup of a ZFS snapshot. This provides some healthy competition for Windows' Shadow Volume Copies, and can probably integrate nicely with Samba's Shadow Copy module as well. With a bit of scripting, it is possible to do a "zfs destroy tank/retro-test@backMeUp; zfs snapshot tank/retro-test@backMeUp" and Retrospect will simply pick up the latest version of the snapshot thanks to the consistent path.


For a FreeBSD Jail, you can even shut down the jail, snapshot the jail, then relaunch the jail, allowing for a backup of the machine in a safely shut-down state, removing the need for things like SQL dumps if your environment can permit a few seconds of downtime.


As an example, to capture the retro-test@backMeUp snapshot, add the following line to /compat/etc/linux/mtab. Ensure that the snapshot's mount options field contains the read-only "ro" flag (as opposed to read-write "rw") just to ensure that nothing attempts to modify the volume:

tank/retro-test@latest /tank/retro-test/.zfs/snapshot/latest zfs ro,nfsv4acls 0 0


This will show up in the UI as a volume called /tank/retro-test/.zfs/snapshot/latest.


Launch the Client:

Allow the client to launch at startup by placing the following into /etc/rc.conf:



To override the default options, some settings (notably -ip) may be supplied by the retroclient_args variable. Remember to include -daemon!


Start the Retrospect Client:

/usr/local/etc/rc.d/retroclient start


Reference Material:

Special thanks to Mhornyak for initial work over a decade ago: "FreeBSD client/Linux client under FreeBSD"


EDIT 2013-03-19 12:58: Reformat section headings for readability. Describe benefits and interaction of snapshot+backup.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...