Backing up FreeBSD
by David Lay <[email protected]>
It's probably fair to say that everyone who works with computers
understands the importance of making regular backups. It's probably
also fair to say that most people aren't in the habit of making any
backups whatsoever. Establishing a backup schedule is one of the most
important jobs you may ever have to do, and it can be a daunting task.
This series of articles aims to demystify the process.
The first step is establishing a backup schedule involves deciding how
much data you have and how much of it you need to keep backed up.
Generally you need to consider this from the viewpoint of a worst case
scenario. Imagine all the disks in all your hosts spontaneously
combusted and you lost every file. Now, some data may be easy
to restore by simply re-installing software packages from scratch.
Other data (such as personal data files) are probably either
impractical or impossible to re-create in such a way. These
irreplaceable files are the ones which you definately want to keep
backed up. The files which you can restore via other means may be
ommitted from the backup schedule - it's only a question of whether
it's more convenient to install them from scratch or to restore them
from a backup image. If it's easy to start from scratch, you can
probably save some trouble (and storage space) by leaving them out.
Once you've determined what to backup it shouldn't be too difficult to
work out how much storage space you'll need. This will be an
important factor in choosing an appropriate backup medium. There are
various backup media available, each with different storage capacities
and data read/write speeds. Ideally, your backup medium should be
large enough to hold all of your data on a single volume. Some backup
software may be capable of splitting backup dumps across several
volumes, but it's best to avoid complication where possible.
When considering backup media selection, there's three main choices:
hard disk, CD, and magnetic tape.
The price per gigabyte of hard disk drives has steadily decreased over
the past few years, and additional hard disk space is often the first
backup medium considered. Although not the cheapest backup medium the
price is affordable in most situations and the read/write speed
greatly exceeds other media, but there's an important attribute of
hard disk storage which makes it an inappropriate choice.
In my humble opinion, it's absolutely critical that backup images are
stored offline. Remember that the purpose of keeping a backup is so
that you may restore data in the event of a data loss. Obviously one
way data loss might occur is due to a hardware component failure, but
another way which is often overlooked is deliberate (or accidental)
removal. It's rare to find a Unix sysadmin who can't tell at least
one tale of woe involving a root shell and the
'f' arguments to
rm(1). There is also the
(hopefully remote) possibility of a malicious intruder compromising a
machine and deliberately removing files. Backup images held in online
storage can be easily removed along with the original data. The best
way to protect against this is to keep your backup images on removable
media and store them in a safe place. Removable hard disks, such as
Zip or Jaz drives address the offline storage issue, but their storage
capacity is small compared with other media.
If you are contemplating hard disk backup, you may be better served by
putting the additional disks into a fault tolerant RAID array. This
probably makes better use of the disk, but don't forget that this is
not a substitute for a backup scheme - RAID arrays aren't immune to an
Writeable compact discs have become a commodity item. Drives are
available from several different manufacturers, and the widespread
acceptance of the format has made the drive price affordable to even
home computer users. Blank CDs can be purchased for just a few
dollars just about anywhere (even local supermarkets). There are
drives capable of writing to CD media at up to 600 kilobytes per
second, and most CD drives can read them many times faster. Unlike
tape, the media is not sensitive to magnetic fields, and the discs
themselves are virtually indestructible. The only drawback is the
comparitively limited storage capacity of aroung 0.7 gigabytes, which
is too small for many applications. Nevertheless, CD is an excellent
medium for archival backups which need to be stored for many years
(even though you must create an archive which spans several volumes).
Magnetic tape is still a popular backup medium. There has been a
variety of different formats which have come and gone over the but DDS
(Digital Data Storage) and DLT (Digital Linear Tape) are the two most
common formats right now. Tape drive units are considered something
of a high end device, so there tends to be fewer manufacturers to
choose from and you will end up paying a higher price than for, say, a
CD-R drive. The media cost is comparable to CD-R (a few dollar per
gigabyte) but there's a huge difference in the storage capacity.
The DDS-3 format will hold 12 GB per tape, and the DLT format is
capable of holding up to 40 GB per tape. Most tape drives support
some form of hardware compression and manufacturer's specifications
tend to quote the compressed capacity. Only the raw (uncompressed)
capacity of a tape format should be used when making comparisons,
because the effect of compression can be difficult to predict. The
quoted compressed capacities may not always be achievable.
That's the brief overview of available backup media complete. The
next article in this series will deal with using a tape drive under
FreeBSD, for no other reason than that's the only backup medium I've
got first hand experience with.