You are on page 1of 18

Week 10

Backup and Recovery

Objectives
Planningfor Disasters and Everyday Needs
Backup Media
Backing Up Files and Filesystems
Restoring Files from Backup
Network Backup Systems

Learning Outcomes
Demonstrate strategies for planning/designing systems.
Planning for Diasaters and Everyday
Needs
 Developing an effective backup strategy is an ongoing
process.

 You usually inherit something when you take over an existing


system and start out doing the same thing you’ve always
done when you get a new system.

 This may work for a while.


 But, the time to develop a good backup strategy is right now,
starting from however you are approaching things at the
moment.

 Basically,backups are insurance. They represent time


expended in an effort to prevent future losses. The time
required for any backup strategy must be weighed against
the decrease in productivity, schedule slippage, and so on.
Planning for Diasaters and Everyday Needs (cont…)
 The overall requirement of any backup plan is that it be
able to restore the entire system—or group of systems—
within an acceptable amount of time in the event of a large-
scale failure.

 At the same time, a backup plan should not sacrifice too


much in the way of convenience, either in what it takes to
get the backup done or how easy it is to restore one or two
files when a user deletes them accidentally.

 The approaches one might take when considering only


disaster recovery or only day-to-day convenience in
isolation are often very different, and the final backup plan
will need to take both of them into account (and will
accordingly reflect the tension between them).
Planning for Diasaters and Everyday Needs (cont…)
 There are many factors to consider in developing a backup
plan. The following questions are among the most important:

 What files need to be backed up? General


 What are these files? S
 Who will back up the files? Person responsible.
 Where, when, and under what conditions should backups be
performed?
 How often do these files change? Daily, weekly, monthly, etc..
 How quickly does an important missing or damaged file need
to be restored?
 How long do we need to retain this data? Date ( from - time )
 What should the backup media be stored?
 Where will the data be restored?
Planning for Diasater and Everyday Needs:
Backup Capacity Planning
 Once all the data about what needs to be backed up and the resources
available to do are gathered,
 the following procedures can be used to develop the detailed backup plan
itself:

1. Begin by specifying an ideal backup schedule without


considering any of the constraints imposed by your actual
situation. List what data you would like to be backed up, how
often it needs to be backed up, and what subdivisions of the
total amount make sense.

2. Now compare that ideal schedule to what is actually possible in


your environment, taking the following points into
consideration:
◦ When the data is available to be backed up
◦ How many tape drives (or other backup devices) are available to perform
backups at those times and their maximum capacities and transfer rates
Backup Capacity Planning (cont…)
3. Make modifications to the plan to take into account the
constraints of your environment.
• Adding additional backup hardware,
• Decreasing the amount of data to be backed up or the backup
frequency.
• Increasing the amount of time available/used for backups
• Staging backups to disk. This scheme writes the backup archives to
a dedicated storage area. The files can then be written to tape at any
subsequent time. Disks are also faster than tape drives, so this method
also takes less time than directly writing to tape. It does, of course,
require that sufficient disk space be available to store the archives.

4. Test and refine the backup plan. Actually trying it out will
frequently reveal factors that your on-paper planning has failed
to consider.
5. Review the backup plan on a periodic basis to determine if it is
still the best solution to your site’s backup needs.
Backup Media
 Today, there are many different media suitable for storing
backed-up data. This section provides a quick summary of
the available choices. This list includes most of the drives
and media types which are in common use.
 Hard disk: The capacity-to-price ratio of hard disk has
been rapidly improving for many years.
 This is making it more competitive with magnetic tape as a
bulk storage medium.
 The main advantages of hard disk storage are low access
times, availability, capacity and ease of use. 
◦ External disks can be connected via local interfaces like SCSI
, USB, FireWire, or eSATA, or via longer distance
technologies like Ethernet, iSCSI, or Fibre Channel.
◦ Some disk-based backup systems, such as Virtual Tape
Libraries, support data deduplication which can dramatically
reduce the amount of disk storage capacity consumed by
daily and weekly backup data.
Backup Media (cont…)
◦ The main disadvantages of hard disk backups are that they
are easily damaged, especially while being transported (e.g.,
for off-site backups), and that their stability over periods of
years is a relative unknown.
 Optical storage : Recordable CDs, DVDs, and Blu-ray Discs
 are commonly used with personal computers and generally
have low media unit costs.
 However, the capacities and speeds of these and other optical
discs are typically an order of magnitude lower than hard disk or
tape.
 Many optical disk formats are WORM(Write once read
many) type, which makes them useful for archival purposes
since the data cannot be changed.
 The use of an auto-changer or jukebox can make optical discs a
feasible option for larger-scale backup systems. Some optical
storage systems allow for cataloged data backups without
human contact with the discs, allowing for longer data integrity.
Backup Media (cont…)
 Solid state storage:  Also known as flash memory, 
thumb drives, USB flash drives, CompactFlash, SmartMedia, 
Memory Stick, Secure Digital cards, etc., these devices are
relatively expensive for their low capacity in comparison to
hard disk drives, but are very convenient for backing up
relatively low data volumes.

 A solid-statedrive does not contain any movable parts


unlike its magnetic drive counterpart, making it less
susceptible to physical damage, and can have huge
throughput in the order of 500Mbit/s to 6Gbit/s.

 The capacity offered from SSDs continues to grow and


prices are gradually decreasing as they become more
common.
Backup Media (cont…)
 Remote backup service:  As broadband Internet access
 becomes more widespread, remote backup services are
gaining in popularity.
 Backing up via the Internet to a remote location can protect
against some worst-case scenarios such as fires, floods, or
earthquakes which would destroy any backups in the
immediate vicinity along with everything else.
 There are, however, a number of drawbacks to remote
backup services.
◦ First, Internet connections are usually slower than local data
storage devices. Residential broadband is especially
problematic as routine backups must use an upstream link
that's usually much slower than the downstream link used
only occasionally to retrieve a file from backup. This tends to
limit the use of such services to relatively small amounts of
high value data.
Backup Media (cont…)
◦ Secondly, users must trust a third party service provider to
maintain the privacy and integrity of their data, although
confidentiality can be assured by encrypting the data before
transmission to the backup service with an encryption
key known only to the user.
◦ Ultimately the backup service must itself use one of the above
methods so this could be seen as a more complex way of
doing traditional backups.

 Floppy disk: During the 1980s and early 1990s, many


personal/home computer users associated backing up
mostly with copying to floppy disks.
 However, the data capacity of floppy disks failed to catch
up with growing demands, rendering them effectively
obsolete.
 https://en.wikipedia.org/wiki/Backup
Backing Up Files and Filesystems
 Most systems offer a variety of utilities for performing
backups, ranging from general-purpose archiving
programs like tar and cpio to programs designed for
implementing multilevel incremental backup schemes on a
per-filesystem basis

1. tar Command:
 tar is the standard UNIX/Linux archiving application tool.

 In its early stage it used to be a Tape Archiving Program


which gradually is developed into General Purpose
archiving package which is capable of handling archive
files of every kind.

 tar accepts a lot of archiving filter with options.


Backing Up Files and Filesystems
 taroptions
-A : Append tar files to existing archives.
-c : Create a new archive file.
-d : Compare archive with Specified filesystem.
-j : bzip the archive
-r : append files to existing archives.
-t : list contents of existing archives.
-u : Update archive
-x : Extract file from existing archive.
-z : gzip the archive
–delete : Delete files from existing archive.
Backing Up Files and Filesystems
 tar Examples

 Create a tar archive file.

 Decompress an tar archive file.


Backing Up Files and Filesystems
1. cpio Command:
 cpio stands for Copy in and out. Cpio is a general purpose
file archiver for Linux.
 It is actively used by RedHatPackage Manager (RPM) and
in the initramfs of Linux Kernel as well as an important
archiving tool in Apple Computer’s Installer (pax).

cpio options
-0 : Read a list of filenames terminated by a null character
instead of a newline.
-a : Reset Access time.
-A : Append.
-b : swap.
-d : Make Directories.
Backing Up Files and Filesystems
 cpio Examples
 Create an ‘cpio’ archive file.

 To extract a cpio archive file.


Backing Up Individual Filesystems with dump
 The BSD dump utility represents the next level of
sophistication for backup systems under Unix.
 It selectively backs up all of the files within a filesystem
(single disk partition), doing so by copying the data
corresponding to each inode to the archive on the backup
device.
 It also has the advantage of being able to back up any type of
file, including device special files and sparse files.
Although there are slight variations among different versions
of this command, the discussion here applies to the following
Unix implementations of this command:
◦ AIX backup
◦ FreeBSD dump
◦ HP-UX dump and vxdump
◦ Linux dump (but the package is not usually installed by default)
◦ Solaris ufsdump
◦ Tru64 dump and vdump
Backing Up Individual Filesystems with dump
 The dump command takes two general forms:
  $ dump options-with-arguments filesystem
  $ dump option-letters corresponding-arguments
filesystem
  where filesystem is the block special file corresponding to
the filesystem to be backed up or the corresponding mount
point from the filesystem configuration file.

 In the first, newer form, the first item is the list of options
to be used for this backup, with their arguments
immediately following the option letters in the normal way
(e.g., -f /dev/tape).
 In the second, older form, option-letters is a list of argument letters
corresponding to the desired options, and corresponding-arguments are the
values associated with each argument, in the same order. This syntax is still
the only one available under Solaris and HP-UX.

You might also like