Using the Raspberry Pi as a backup server

Installation

The RPi3 runs without any problems from a microSDHC card. However, when a hard drive is added to the system, it makes sense to install an operating system directly on the drive. Currently you still need the card for the boot partition, although the Raspberry Pi Foundation has indicated that this will be changing in the near future. Instructions for installing Raspbian on the hard drive can be found on the Internet [7]. Installation is easier with a script I wrote, and you can find a description of this script in the "Automatic Installation of Raspbian on a Hard Drive" box.

Automatic Installation of Raspbian on a Hard Drive

If you want to save yourself the trouble of manually installing Raspbian on a hard drive and then adapting it, you can use a script that automatically completes the process in one step. The script can be downloaded from GitHub to a Linux PC:

$ git clone https://github.com/bablokb/apiinst

Next, you should insert a microSDHC card for the boot partition into the computer. In the example, this is /dev/sdb, although the name of your device might be different, and the hard drive here is /dev/sdc. After downloading the Raspbian image, you then install the system:

$ apiinst/bin/apiinst -i /<Path_to>/20160527-raspbian-jessie-lite.zip -B /dev/<sdb> -t /dev/<sdc> -D 285G

For purposes of this example, I have assumed you retain the directory path after git clone. It is a good idea to be sure that the command deletes all of the data on the devices indicated. Therefore, you should first determine the device name that is being used. The commands blkid and fdisk -l assist with this task.

You should adjust the size specifications for the data partition with -D according to your hard drive. Only 296GB of the 314GB capacity of the PiDrive can actually be used. The difference between actual capacity and the 285GB specified in the command is reserved for the system partition. Later, the system will automatically install the data partition in the /data directory when booting.

After installing Raspbian on the card and hard drive, you should connect the prepared storage to the Rasp Pi. Once started, the system should be configured as usual.

Installation of Raspbian "jessie" Lite and some supplemental packages suffice for the purpose of performing backups (Listing 1). When this issue of Raspberry Pi Geek is published, it is entirely possible that UrBackup will have an updated version number (line 3). The current version can be found online [8].

Listing 1

Installing UrBackup

$ sudo apt-get update
$ sudo apt-get install sqlite3 libcrypto++9 libfuse2
$ wget http://raspberrybuild.urbackup.org/nightly/urbackup-server_2.0.30.1529-1_armhf.deb
$ mkdir -p /data/backups
$ sudo dpkg -i urbackup-server_2.0.30.1529-1_armhf.deb

During installation, UrBackup will only ask for the path to the backup directory. This should be carefully considered since changing it later only happens with some effort. Consequently, you should first to set up the backup directory (line 4). In my example, this is the /data/backups/ directory.

Configuration

You can configure UrBackup using a web interface at http://<RaspPi_IP>:55414 (Figure 2). Most of the settings are self-explanatory. If you have further questions, you should consult the detailed administration manual found on the project page. Some of the options also contain a question mark with a direct link to the relevant section of the online manual.

Figure 2: The modest UrBackup web interface includes all of the necessary functions, almost all of which are self-explanatory.

One of UrBackup's great strengths is its large number of settings. For example, it is possible to set up user administration for the web interface, although it is not absolutely necessary. Likewise, the administrator interface can be operated by way of an encrypted connection behind a real web server. This makes it possible for a private network solution to scale to a remote solution that encrypts data from clients via the Internet and stores them on remote servers. In larger environments, the administrator can also maintain an overview of everything from a web interface (Figure 3) or, if necessary, receive messages by email.

Figure 3: The Activities overview in the web interface keeps you informed about the current storage allocation and jobs that are running or completed.

Experience shows that you should disengage default options that let Windows clients run only with background priority. If the extended option is checked, then Windows will slow the backup down significantly. Otherwise, you can adjust the cycles for complete and incremental backups according to need.

Buy this article as PDF

Express-Checkout as PDF

Pages: 6

Price $2.95
(incl. VAT)

Buy Raspberry Pi Geek

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content