Oct 272006
 

Sponsored Link

Most of the people want to know about the backups because one of the other day you will definitely need backup of your data.There are many different types of backups and here i try to cover some of them.If something is missing or something need to be added to this article you can post your suggestions.


Why do you need backup?

Backups are needed in case a file or a group of files is lost. The reasons for losing files include

Hardware failure like disk breaking,accidentally deleting wrong file and computer being stolen.

Backups help in all the above situations. In addition, it may be good to have access to older versions of files, for example a configuration file worked a week ago, but since then it has been changed and nobody remembers how, its just not working anymore.

There are other solutions, and they are good to have if you can afford them. These include

redundant disks (RAID 1 or 5), so that one disk can break without loss of data,using an undelete system (or not making mistakes when deleting files locking up computers.

These help, but if there is anything you do not want to lose on the computer, make sure there are backups and they can be restored.

What to backup?

If there is room on the backup media, and time limits permit running backups long enough, it probably is wisest to back up everything. You may skip /tmp or other places where it is known there are only temporary files that nobody wants to backup.

If space or time limits place restrictions, consider not backing up the following

Files that come directly from a CD or other removable media. It may even be faster to copy them again from CD than restoring from backup media.

Files that can be regenerated easily. For example, object files that can be made with make. Just make sure all the source files and compilers are backed up.

If the Internet connection is fast, it may be easy enough to download files again. Just keep a list of the files and where to download them from.

Backup devices and media

You need some media to store the backups. It is preferable to use removable media, to store the backups away from the computer and to get "unlimited" storage for backups.

If the backups are on-line, they can be wiped out by mistake. If the backups are on the same disk as the original data, they do not help at all if the disk fails and is not readable anymore. If the backup media is cheap, it is possible to take a backup every day and store them indefinitely.

Floppy,Disk,Tapes,CD-R and CD-RW are the medias available for backup

Planning a Backup

Before doing a backup, plan it carefully. Consider

Which files are irreplaceable without a back up. Irreplaceable files probably include those in users' home directories (including /root), and configuration files, such as those in the /etc/ directory.

Which files are on removable drives, such as cd s or floppies. Since you probably do not need to back up removable drives, you might unmount them before doing a complete system backup.

Which files can be easily replaced by installing a package or doing a selective install or upgrade of the operating system. You can save time and storage space by not including these files in a backup.

Which files are unnecessary or dangerous to backup. For example, files in /tmp are probably unnecessary, while restoring some files that are in the /proc directory could crash the system.

Whether to compress files using gzip or bzip2 . Compressing saves space, but adds another step to the backup. Also, while compression is generally reliable, it creates another stage at which the process can fail.

Whether users are responsible for backing up their own files. Since only the root user has full permissions for all files on the system, usually backups are best done by the root user. However, if users back up their own files, you might omit backing up the home directory, or at least not back it up regularly.

Choosing a Backup Tool

Linux has several tools for backing up and restoring files

dump / restore : Old tools that work with filesystems, rather than files, and can back up unmounted devices. Although you can easyly control what is backed up with dump by editing a single column in the /etc/fstab file, for some reason these utilities have fallen into disuse. Today, many distributions of Linux, including Debian, do not even include them by default. If you want to use dump and restore , you must install them yourself.

tar : A standard backup tool, and by far the easiest to use. It is especially useful for backing up over multiple removable devices using the -M option.

cpio : A very flexible command, but one that is hard to use because of the unusual way in which the command must be entered.

dd : The dd command is one of the original Unix utilities and should be in everyone's tool box. It can strip headers, extract parts of binary files and write into the middle of floppy disks; it is used by the Linux kernel Makefiles to make boot images.

Mondo : Mondo is reliable. It backs up your GNU/Linux server or workstation to tape, CD-R, CD-RW, DVD-R[W], DVD+R[W], NFS or hard disk partition. In the event of catastrophic data loss, you will be able to restore all of your data [or as much as you want], from bare metal if necessary. Mondo is in use by Lockheed-Martin, Nortel Networks, Siemens, HP, IBM, NASA's JPL, the US Dept of Agriculture, dozens of smaller companies, and tens of thousands of users.

Dar: dar is a shell command that backs up directory trees and files. It has been tested under Linux, Windows, Solaris, FreeBSD, NetBSD, MacOS X and several other systems

Many commercial or free software back up tools are also available.

Types of Backup

There are different kinds of backups, the following lists some of them:

Full Backup

Full backup is the starting point for all other backups, and contains all the data in the folders and files that are selected to be backed up. Because full backup stores all files and folders, frequent full backups result in faster and simpler restore operations. Remember that when you choose other backup types, restore jobs may take longer.

Advantages

Restore is the fastest

Disadvantages

Backing up is the slowest

The storage space requirements are the highest

Incremental Backup

Incremental backup means backing up everything that has changed since last full backup.

Advantages

Backing up is the fastest

The storage space requirements are the lowest

Disadvantages

Restore is the slowest

Differential Backup

Differential seems to be another name for incremental.differential backup offers a middle ground by backing up all the files that have changed since the last full backup

Advantages

Restore is faster than restoring from incremental backup

Backing up is faster than a full backup

The storage space requirements are lower than for full backup

Disadvantages

Restore is slower than restoring from full backup

Backing up is slower than incremental backup

The storage space requirements are higher than for incremental backup

Network Backup

Network backup usually means backing up a client to a backup server, this means the client sends the files to the server and the server writes them to backup medium.

Dump Backup

Dump backups are not ordinary file by file backups. The whole disk partition or file system is "dumped" to the backup medium as is. This means it is also necessary to restore the whole partition or file system at one go. The dump backup may be a disk image, which means it must be restored to a similar disk with same disk geometry and bad blocks in same places. Watch out for this.

Level 0 -- 9 Backup

Level 0 to 9 backups are a finer grained version of incremental backups. Level N backup means backing up everything that has changed since a same or lower lever backup.

Check the backup can be restored, with original file owners, permissions and timestamps.

To be useful, you must be able to restore the backup. Very often not only the contents of file are important, but their time stamps, permissions and owners. Check that you can restore the backup so that all these are preserved.

Sponsored Link

 Posted by at 9:20 pm
  • Chris

    You can have the ease of restore of a full backup, with the speed and space efficiency of an incremental backup using rsync and hard links.

    Lets say we are backing up everything from / to /backup/

    This gives you a full backup in /backup/1: rsync –archive –delete –links –progress –stats –verbose –exclude /backup/ / /backup/1

    Then if you run: cp -al /backup/1 /backup/2
    You’ll get a hardlinked copy of the full backup.

    If you then run:
    rsync –archive –delete –links –progress –stats –verbose –exclude /backup/ / /backup/2
    Rsync will perform an incremental backup into 2, and only replace updated files. Thus, in /backup/1 you have the original backup, in /backup/2 you have the updated backup, and common files arn’t duplicated, so it’s nice and space efficient.

    To restore, simply copy the most recent backup folder.

    Of course, you might want more meaningful folders than /backup/1 and /backup/2. I use the date as the folder name myself.

  • Larry

    (* I think those long options in Chris’ note above need double-hyphens *)

    Some other commands available in Linux that may be of interest –
    partimage
    rdiff-backup
    copydir (in pkg “mirrordir”)

    I still think that dump/restore (through a process pipe) is quite useful
    for migrating (populating) a new/local filesystem. Larry

  • http://www.killercoke.org Pepito

    “s. Check that you can restore the backup so that all these are preserved.”

    That is the only thing I know and why I expected to read. The same applies to almost everything in the article.

  • AJ

    how much storage space will I need for a typical full backup?

  • Phillip Susi

    This block on dump is entirely wrong:

    “Dump backups are not ordinary file by file backups. The whole disk partition or file system is “dumped” to the backup medium as is. This means it is also necessary to restore the whole partition or file system at one go. The dump backup may be a disk image, which means it must be restored to a similar disk with same disk geometry and bad blocks in same places. Watch out for this.”

    This is a description of dd, not dump. Dump scans the filesystem and intelligently chooses which files it needs to copy to the dump tape/file based on the last time and the level of this dump. When restoring files, you can ask restore to extract all files, or use it interactively and explore the files with cd and ls, and choose which ones you want to selectively restore. It restores to a new clean fs on any block device. It does not write to the raw block device when restoring, so it does not know or care about its size or bad blocks.

  • YUGAL KUMAR

    A Server is a computer or device on a network that manages network resources. For example, a file server is a computer and storage device dedicated to storing files any user on the network can store files on the server. A print server is a computer that manages one or more printers and a network server is a computer that manages network traffic.

    Servers are often dedicated, meaning that they perform no other tasks besides their server tasks. On multiprocessing operating systems however, a single computer can execute several programs at once. A server in this case could refer to the program that is managing resources rather than the entire computer.

    A server is a computer or a device on a network that manage network devices like network printer and other thing which is connected to the network.

  • YUGAL KUMAR

    DEAR AJ
    how much storage space will I need for a typical full backup?
    ANS:- This is depend on your pc data that how much data in your pc because full backup takes whole computer back up but normally we need 10 to15 GB storage to fire a full backup.

  • manik

    good job. Thank u

  • musarandega

    need to mention 1.grandfather-father-son backup(where each diskette for a specific day is prepared to save all data) 2.offside backup(Friday backup disk is taken home)

  • sanjay kumar prajapati

    backup is a process that prevent the loss of impotent information.

  • shanu jain

    i want to know about flash archival backup…. its a type of backup…..

  • http://www.midbeam.com/ Rohit Agarwal

    This article will help me lot…. great job!!

  • Vishu

    i want the somewhat more detailed explanation regarding backup basics and types and storage basics

  • Monica

    This is a very helpful article. What I need to know is how to do a backup that will backup just files. What my backup program (Im using the windows 7 backup) is doing is creating an image. But I want to be able to choose a certain file in the event that something becomes corrupt.

  • Mothichandar

    hey i have my phone memory’s back up in my pc and then added some files and deleted it so will i get my files back which i deleted and didnt save in my pc?