Do Automated Cross-Platform Network Backups The Easy Way (Part 2)

Tuesday Jun 6th 2006 by Carla Schroder

Networked backup software can introduce a bewildering variety of licensing issues and costs. Some free and open source choices come to the rescue.

In Part 1 we discussed all manner of fascinating backup tools and strategies. Today we roll up our sleeves and build a sleek, dependable cross-platform network backup server with the excellent BackupPC. We're not going to mess around with dumb old tape drives, nor CDs, nor DVDs, nor floppy diskettes, but nice, fast high-capacity hard drives.

Your backup server should be robust, and not some tired old classic Pentium recycled from a moldy basement. It needs at least an 800 megahertz processor, 256 megabytes of RAM, and enough disk space. A three-disk SATA RAID 5 array, managed with EVMS (Enterprise Volume Management System) is great for a small shop. With EVMS you can painlessly scale up as you need.

Networks with a small number of users might consider using RAID1 (mirroring), with the second drive in a removable bay for offsite storage. Rotate at least two removable drives for easy redundancy.

Unison or rsync are good programs for performing offsite network backups of your backup server. Yes, that's a whole lot of backing up. Ever since we abandoned good old reliable paper for digital media, it's just layers upon layers.

Fierce battles are waged over which is better, software or hardware RAID. Forget the cheapie built-in RAID that comes on a lot of motherboards these days, or the inexpensive PCI-IDE RAID cards for under $30 — those are junky and nowhere near as good as Linux RAID. Good-quality hardware controllers cost $150- $600, and are operating-system independent. The best ones have onboard CPUs and RAM, do SATA hot-swap and hot spare, and support as many as eight disks. Linux software RAID is more flexible, as it works at the block level instead of whole disks, so you can use individual partitions in your array. It does not support hot-swap, but it does support hot spares.

The most important components are the power supply and cooling. All those drives suck up a lot of power and throw off a lot of heat. Wattage alone does not tell the tale; power supplies must deliver multiple different voltages. SATA drives need 12V. A good power supply delivers a steady, clean 12V to multiple drives; bad ones can't. Big roomy cases with nice big 120mm case fans are cooler and quieter than small crammed cases.

Modern CPUs and RAM are also significant energy users, sucking up small voltage but big wattages. (See Resources for a comparison table.)

Calculating Storage Space
BackupPC is extremely efficient, because it uses a pool system that hardlinks to identical files. So instead of storing multiple copies of the same file, it only stores one. The first three or four backups will consume the most time and space as the main pool is built; after that only changes will be recorded. Turning on compression reduces the pool size as much as 40%. Using compression uses more CPU cycles, but once the initial pool is built this won't affect performance. So it is possible that a complete backup of every host on your network will require less storage space than the aggregate total. The BackupPC manual gives an example of 240GB of raw data being reduced to 87GB. As a starting point, allow for twice your raw total.

Get Your DNS/DHCP House In Order
Make sure your name resolution and DHCP are working correctly. If they aren't, neither will BackupPC.

Installing BackupPC
On Debian it's as easy as falling over: apt-get install backuppc. The installer will give it a minimal configuration, a startup file, and create a dedicated "backuppc" user. You may indulge in instant gratification and fire up the Web interface at http://[hostname]/backuppc. Log in as the "backuppc" user with the password created by the installer. (You did make a note of this, didn't you?) Now you can cruise the log and configuration files, and check status, which at this point is a big ole zero.

Change the default password with htpasswd:

# htpasswd /etc/backuppc/htpasswd backuppc [new password]

Then all you have to do is edit the two configuration files, /etc/backuppc/ and /etc/backuppc/hosts.

The only RPMs I could find are for Trustix and Mandrake. On Red Hat/Fedora and other Linuxes, you're probably better off installing from sources. Just follow the instructions in the user manual.

Configuring BackupPC
First take a cruise through the very well-commented I can't improve on the instructions, so just take your time and look at every directive. For now we won't change a thing, except to turn on compression:

$Conf{CompressLevel} = 3;

Next, add all your client machines to /etc/backuppc/hosts. Use either their Unix hostnames or Windows NetBIOS names. Don't touch the first two lines:

host        dhcp    user        moreUsers
localhost   0       backuppc
uberpc      0       carla       terry,pinball
stinkpad    0       ellyn       boris
freya       0       mail_admin	

The "user" field is the login name of the primary user of the machine, who will be able to initiate backups and fetch restore files from the server. BackupPC will send this user administrative emails. The "moreUsers" field is for additional users who need backup/restore privileges. You don't have to name any users; it's OK to leave both fields blank. The user manual says that the DHCP field should be set to 0 for all clients, whether they have static or dynamic IPs. However, sometimes this doesn't work correctly. BackupPC uses nmblookup to find DHCP clients. You can test this to see if it will work:

$ nmblookup stinkpad
querying stinkpad on
querying stinkpad on
name_query failed to find name stinkpad
Well, fiddlesticks. Now see if it will find stinkpad by its IP:
$ nmblookup -A
Looking up status of
        STINKPAD        <00> -         B 
        SAMBA1          <00> -  B 
        STINKPAD        <03> -         B 
        STINKPAD        <20> -         B 
        SAMBA1          <1e> -  B 
        ADMINISTRATOR   <03> -         B 

        MAC Address = 00-0A-E4-40-8B-FD
Rather than brawling with nmblookup, change the "dhcp" field to 1, and add a DHCP range in
$Conf{DHCPAddressRanges} = [
     ipAddrBase => '192.168.1',
     first => 1,
     last  => 25,
Keep the range as narrowly defined as you can, because nmblookup does a brute-force lookup, trying one address at a time.

That completes the server configuration. Come on back next week for client configurations, and to learn about some excellent FOSS tools for backing up and restoring Windows systems.


Mobile Site | Full Site
Copyright 2017 © QuinStreet Inc. All Rights Reserved