Learning Objectives
By the end of this chapter, you should be able to:
Why Backups?
Name a few reasons to back up data?
What Needs Backup?
Some data is critical for backup, some less critical, and some never needs saving.
What data should be backed up?
Definitely yes
Maybe
Probably not
Definitely not
Obviously, files essential to your organization require backup. Configuration files may change frequently, and along with individual user’s files, require backup as well.
Logging files can be important if you have to investigate your system’s history, which can be particularly important for detecting intrusions and other security violations.
You don’t have to back up anything that can easily be re-installed. Also, the swap partitions (or files) and /proc filesystems are generally not useful or necessary to backup, since the data in these areas is basically temporary (just like in the /tmp directory).
Backup vs. Archive
All backup media have a finite lifetime before becoming unreadable. The conventional estimates are listed below:
Environmental conditions (temperature, humidity, etc.)
For lifetimes longer than the usual backup timescales, data can be preserved using multiple copies, plus copying over to newer media from time to time.
For very long times (i.e., many decades, centuries, etc.), standard methods do not work easily, as everything can go obsolete: hardware, software and document format, media.
None of the inexpensive digital formats can actually compete with paper and film for long periods of time (if they are properly stored and continuously cared for - like wine).
This is a problem serious people think about and there should be good solutions available before all is lost.
Tape Drives
Tape drives are not as common as they used to be. They are relatively slow and permit only sequential access. On any modern setup, they are rarely used for primary backup. They are sometimes used for off-site storage for archival purposes, for long time reference. However, magnetic tape drives always have only a finite lifetime without physical degradation and loss of data.
Modern tape drives are usually of the LTO (Linear Tape Open) variety, whose first versions appeared in the late 1990s as an open standards alternative; early formats were mostly proprietary. Early versions held up to 100 GB; newer versions can hold 2.5 TB or more in a cartridge of the same size.
Day-to-day backups are usually done with some form of NAS (Network Attached Storage) or with cloud-based solutions, making new tape-based installations less and less attractive. However, they can still be found, and system administrators may be required to deal with them.
In what follows, we will try not to focus on particular physical forms for the backup media, and will speak more abstractly.
Backup Methods
What are the different types of backs?
You should never have all backups residing in the same physical location as the systems being protected. Otherwise, fire or other physical damage could lead to a total loss. In the past, this usually meant physically transporting magnetic tapes to a secure location. Today, this is more likely to mean transferring backup files over the Internet to alternative physical locations. Obviously, this has to be done in a secure way, using encryption and other security precautions as is appropriate.
Backup Methods
Explain the full backup method
Backup for all files on the system.
Backup Methods
Explain the Incremental backup method
Backup for all files that have changed since the last incremental or full backup.
Backup Methods
Explain the Differential backup method
Backup for all files that have changed since the last full backup.
Backup Methods
Explain the Multiple level incremental backup method
Backup for all files that have changed since the previous backup at the same or a previous level.
Backup Methods
Explain the User backup method
Backup only for files in a specific user’s directory.
Backup Strategies
We should note that backup methods are useless without associated restore methods. You have to take into account the robustness, clarity and ease of both directions when selecting strategies.
The simplest backup scheme is to do a full backup of everything once, and then perform incremental backups of everything that subsequently changes. While full backups can take a lot of time, restoring from incremental backups can be more difficult and time consuming. Thus, you can use a mix of both to optimize time and effort.
An example of one useful strategy involving tapes (you can easily substitute other media in the description):
A good rule of thumb is to have at least two weeks of backups available.
Some Backup Related Utilities
Name a few of the backup utilties
Some Backup Related Utilities
What is the cpio and tar back up utilities used for?
cpio and tar create and extract archives of files.
Some Backup Related Utilities
What is the gzip, bzip2, and xz back up utilities used for?
The archives are often compressed with gzip, bzip2, or xz. The archive file may be written to disk, magnetic tape, or any other device which can hold files. Archives are very useful for transferring files from one filesystem or machine to another.
Some Backup Related Utilities
What is the dd back up utilities used for?
This powerful utility is often used to transfer raw data between media. It can copy entire partitions or entire disks.
Some Backup Related Utilities
What is the rsync back up utilities used for?
This powerful utility can synchronize directory subtrees or entire filesystems across a network, or between different filesystem locations on a local machine.
Some Backup Related Utilities
What is the dump and restore back up utilities used for?
These ancient utilities were designed specifically for backups. They read from the filesystem directly (which is more efficient). However, they must be restored only on the same filesystem type that they came from. There are newer alternatives.
Some Backup Related Utilities
What is the mt back up utilities used for?
This utility is useful for querying and positioning tapes before performing backups and restores.
Using tar for Backups
tar is easy to use:
When creating a tar archive, for each directory given as an argument, ___.
all files and subdirectories will be included in the archive
Using tar for Backups
tar is easy to use:
When restoring, __.
it reconstitutes directories as necessary
Using tar for Backups
tar is easy to use:
It even has a –newer option that lets you do ___.
Using tar for Backups
tar is easy to use:
The version of tar used in Linux can also handle backups that do not fit on one ___ or ___.
Using tar for Backups
What command option with tar is used to create a archive?
Examples: