I am currently working on a couple of infrastructure upgrades at home at the moment. The first is updating all my LAN cabling to CAT6 and the second is re-establishing my backup regime. I’ll post more on my LAN upgrade later so will focus more on the backup regime now.
The extent of ones backup regime depends on what value one places on ones data. It’s not until you suffer data loss that you can truly grasp what I’ve just said. In my case, I have hundreds of gigabytes of just family photos ranging from very old slides that have been digitised to weddings to our children as they grow up. In addition to that, I’ve also got family videos, a ton of documents and a lot of source code for apps that I’ve written in the past.
My backup requirements are simple but come at a cost:
- Needs to survive single disk failure
- Needs to survive whole machine failure
- Needs to survive environmental failure (fire, flood, etc…)
- Needs to survive theft
To achieve this I have 2 local FreeNAS servers that are configured with 4 x 3TB HDDs in RAIDZ (ZFS). This addresses my first 2 requirements. For my remaining requirements, I have a QNAP TS-210 at a remote site hooked up to a ADSL2+ router. At this point, I should also mention that a common mistake a lot of new comers make is thinking that using RAID is the same concept as backing up. So for the sake of simplicity RAID != Backup. 😎
My previous configuration with 3 QNAP servers was simple to install and configure for local and remote replication. I have since replaced 2 of the QNAPs with 2 HP N36L Microservers running FreeNAS 8.0.2. Configuring RSYNC between the 2 FreeNAS boxes is easy to do and there are plenty of instructions available to show you how.
Configuring RSYNC from FreeNAS to QNAP required some additional tweaking. Firstly, the QNAP doesn’t have the option of creating rsync “modules” that you need to reference back in FreeNAS. Fortunately, some searching of threads on the QNAP and FreeNAS forums gave me the answer I needed. The Share name that you create on QNAP is what you will need to use.
QNAP Share: Documents
Module name referenced on FreeNAS: Documents
After configuring FreeNAS, I ran a test sync and was greeted with the following error:
rsync: Password: @ERROR: auth failed on module Documents
This is a known issue with FreeNAS, it doesn’t provide an option to enter/store a password. The only workaround for this is to create a password file and to use this in the extra options field: –password-file=FILE (FILE = full path to password file).
Before you go ahead and do this, you need to understand one thing – this file is a text file that sits on the FreeNAS server. Anyone with access to the server can open the file.
Understanding the risks, I made a unique rsync username/pwd combo. This username should exist on the source and target machines. I called the password file rsync.pwd and placed it on my server. The file should just have one line and it should be the password only.
After creating the file, tried second attempt at syncing. New error this time:
password file must not be other-accessible
Oooops, I forgot to set the correct *nix permissions. The file permission should be set to 600 and the owner should be the user created for the rsync.
After all this the sync worked perfectly. Now to get dynamic DNS configured and test over ADSL2+.
Tip: You can use the following command to test the rsync module name along with the username/password combination – rsync –list-only email@example.com::Documents (lists the contents of Documents on the remote NAS located at IP 192.168.1.14 using the user admin. It should also prompt for the password.)